Poc-sealed-secrets - An alternative to store sensitive data in the template Secrets Kubernetes an encrypted way

Overview

POC Sealed Secrets

Overview

Proof of concept with the objective of showing an alternative to store sensitive data in the template Secrets Kubernetes an encrypted way, so that we can leave it recorded inside some git repository (github, gitlab etc).

Problem

We can't expose sensitive data just encoded in our git repositories.

Solution

Encrypt the sensitive data contained in the template secret Kubernetes using SealedSecret.
"The SealedSecret can be decrypted only by the controller running in the target cluster and nobody else (not even the original author) is able to obtain the original Secret from the SealedSecret."

Requirements

Testing

Create a cluster with registry:

$ make create-cluster-with-registry 

Check the status of the cluster and registry:

$ docker ps

Expected:

CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS              PORTS                       NAMES
fca935967b37        kindest/node:v1.19.1   "/usr/local/bin/entr…"   11 hours ago        Up 6 hours          127.0.0.1:33087->6443/tcp   kind-control-plane
17ef425d81a6        registry:2             "/entrypoint.sh /etc…"   11 hours ago        Up 6 hours          127.0.0.1:5000->5000/tcp    kind-registry

Install the Custom Controller and CRD (Custom Resource Definition) for SealedSecret:

$ make install-controller-kubeseal

Check the status of the controller pod:

$ kubectl get pods -n kube-system | grep sealed-secrets-controller

Expected:

sealed-secrets-controller-5556b8c9bd-wt95s   1/1     Running   1          10h

Create SealedSecret YAML manifests with Kubeseal:

  • Use the template /tools/basesecret.yaml with example.
make create-secrets-kubeseal

Expected type:

apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
  creationTimestamp: null
  name: poc-sealed-secrets
  namespace: default
spec:
  encryptedData:
    application.yaml: AgAV97KIg5vkhdCa5fGvmvVrkGyIHXh25ULDdwiL6E7p3SoCb15m8VaiMhqO0bjnrC2bnQHjaR4qe6oCwOx8OnoIyxoQYTMrHCFnhf8XAmxdUTS3O1LgZm6sdSnZ7GkgKc017NvlKKmOwxDuk9bK+uu1kEhCickK61FkGXULeJMgVWl74y2NhH1CY142LoSX5WylVFjCKV6qJd3EKDP0V5SqOpDFkFKaSOI5xxXmF8CGtgj7sGmaFYf63y1oHBG6HWNEenz2wFlQPGpDPBwLsRZo7I1WjWj6R0GDnJTjVzibok6HMxpU+6oxtFE+Bfx36h+oy9ncPneYGjJLU0J7poqlVVVmNV93pNsr6FjA+LZqEXbuVIbvbx7DdDz3+IoqteYm6tSV4ylbUUaNsj5aR0hNrfGkJubzQA2PmgtT8I/JEaAvv3rj6Q0G+4xSLIzv+T5NlttNul2NL4x5HImFZXosIgtp6IJlMs47G31Xhvku65e4liKr0nYO4H/BXWig1EWdXs0JIk8pKwGvCLFQ+FtoHbSNJUFaGWImi9k2WMK49K6593eNHDKe/biUut+NLAe47O5/mKu5l1aPsGZTQZ6+tGzlFg68xE1YFJ2DfvVBsiGmNfGazTncW+eC/wpbhs66gd5HOohfn98K4jDyxg4DY2fBKsU0H+5WcjAP/nbe6JZGkbLWHK06vGRqX9XNN3w3glNkdTLHOxzif/gXXH3GIs7XhDE39iQ7V8oU5y7a7GDy
  template:
    data: null
    metadata:
      creationTimestamp: null
      name: poc-sealed-secrets
      namespace: default
    type: Opaque

Build poc and generate image:

$ make docker-build 

Push image a local registry:

$ make docker-push

Create deployment

$ make create-deployment

Check deployment:

$ kubectl get pods

Expected:

NAME                                  READY   STATUS    RESTARTS   AGE
poc-sealed-secrets-6b8784df75-xwxbn   1/1     Running   0          5h30m

Test decryption:

kubectl logs poc-sealed-secrets-6b8784df75-xwxbn

Expected:

 __  __ _                                  _   
|  \/  (_) ___ _ __ ___  _ __   __ _ _   _| |_ 
| |\/| | |/ __| '__/ _ \| '_ \ / _` | | | | __|
| |  | | | (__| | | (_) | | | | (_| | |_| | |_ 
|_|  |_|_|\___|_|  \___/|_| |_|\__,_|\__,_|\__|
  Micronaut (v2.5.13)

18:27:12.634 [main] INFO  i.m.context.env.DefaultEnvironment - Established active environments: [k8s, cloud]
18:27:13.303 [main] INFO  com.example.POCSealedSecrets - [com.example.POCSealedSecrets] - sensitive data: data encrypted
18:27:13.304 [main] INFO  io.micronaut.runtime.Micronaut - Startup completed in 747ms. Server Running: http://poc-sealed-secrets-6b8784df75-xwxbn:8080

References

You might also like...
AptiBit is an android application that uses Firebase firestore to store the questions and categorize different types of aptitude questions into their categories
AptiBit is an android application that uses Firebase firestore to store the questions and categorize different types of aptitude questions into their categories

AptiBit is an android application that uses Firebase firestore to store the questions and categorize different types of aptitude questions into their categories. It also uses firebase authentication service that allows you to sign in to the app using your custom credentials.

COVID-19 Check-in solution for store using a safe number based on MVVM model.
COVID-19 Check-in solution for store using a safe number based on MVVM model.

wave-in-listener English version : README_EN.md wave-in-listener 는 매장에 방문한 고객의 개인안심번호를 음파통신을 이용해 수신할 수 있는 앱입니다. 이 앱은 wave-in-speaker 앱과 함께 사용됩니다. wave

Application that shows a store's phone inventory

PhoneInventory Application that shows a store's phone inventory The Basics A basic inventory application that shows a store's inventory. Tech Kotlin 1

You can store all your password, bank details, card details in one place and remember only one master PIN. The application works totally offline.
You can store all your password, bank details, card details in one place and remember only one master PIN. The application works totally offline.

Keep Password An application where you can store all your password, bank details, card details in one place and remember only one master PIN. The appl

It is an Android app that uses an SQLite database to store an inventory of products

A project completed for a Udacity course. It is an Android app that uses an SQLite database to store an inventory of products. Each product’s name, price, quantity available, supplier, and picture are tracked. The main screen lists all products in a list and provides a button to add a new product. Clicking on a product shows a detailed view for that product. Options to modify or delete the product are available in this detailed view.

The App Store for the BlazeOS operating system project.

By: Seanpm2001, Et; Al. Top README.md Read this article in a different language Sorted by: A-Z Sorting options unavailable ( af Afrikaans Afrikaans |

Bookstore - online store with books, audiobooks and ebooks

Bookstore - online store with books, audiobooks and ebooks How to run After clon

NikeStore - Nike Store Online shop App With Kotlin
NikeStore - Nike Store Online shop App With Kotlin

Nike Store - Online shop November 2021 Online store to buy Nike shoes ● - Develo

Groceries Store is a project to help people order grocery online
Groceries Store is a project to help people order grocery online

🚀 Groceries Store Download on Google Play Store About Groceries Store is a project to help people order grocery online. The main purpose of this proj

Owner
Cainã Ferreira da Silva
Cainã Ferreira da Silva
The application is a PoC that helps in identifying modern bankers, potentially malicious and remote controlling applications abusing Android AccessibilityService.

Motivation Project aims to help in: identifying keyloggers and events hijacking malicious applications such as Anubis/TeaBot, identifying a "fake bank

Krzysztof Pranczk 33 Dec 9, 2022
Mobile application for Decentralized ML POC: Spotify Recommendation

Mobile application for Decentralized ML POC: Spotify Recommendation This repo co

Datax 1 Dec 29, 2021
Mobile application for Decentralized ML POC: Spotify Recommendation

Mobile application for Decentralized ML POC: Spotify Recommendation This repo contains mobile applications to perform training on Spotify listening hi

Morigin Network 0 Jan 14, 2022
A dummy application used for POC for Future of Furniture application using AR serivces provided by Google.

Furture A dummy application used for POC for Future of Furniture application using AR serivces provided by Google. Demo video.mp4 Splash Home Sofa Cha

Kapil Yadav 8 Nov 28, 2022
PoC 결과 사내 발표 자료 - Choreography Saga Pattern (with SQS, SNS)

PoC-Choreography-Saga-Pattern-Kotlin PoC 및 사내 발표 자료 - Choreography Saga Pattern (with SQS, SNS) 아쉽게도 Multi-Module은 아니고.. 그냥 나눠져 있던 프로젝트들을 한 폴더로 합치기만 했

SeokHyun Kim 6 Dec 11, 2022
when you use restful api and network get disconnect you have to store your data local for make your app faster and work on ofline mode

AppArchitectureOflineMode when you use restful api and network get disconnect you have to store your data local for make your app faster and work on o

Kareem-Mansy 3 Jun 20, 2021
Twire is an alternative and open source Twitch client for Android

Twire This is a fork of the Pocket Plays for Twitch Android application. More information in this issue. Twire is an open source, ad-free Twitch brows

Twire 749 Jan 2, 2023
PayByBank SDK is an alternative and easier form of Open Banking solutions.

PayByBank SDK (Android) The Ecospend Gateway presents PayByBank SDK as an alternative and easier form of Open Banking Instant Payment solutions. PayBy

Ecospend Technologies Limited 4 Aug 10, 2022
Tidy up your Android status bar before taking screenshots for the Play Store

DEPRECATED This project no longer works on recent versions of Android. Use Android's build-in Demo mode instead. For the curious, more information abo

Emma Vanbrabant 891 Nov 10, 2022
An android app to browse KDE Store and other Linux Desktop Environment stores of Pling

A free and open source android application for browsing KDE Store and other Linux Desktop Environment's Stores in Pling. Couldn't check it in different devices so there could be some bugs. Bug Report and Feedbacks are highly appreciated.

null 14 Dec 27, 2022