GithubHelp home page GithubHelp logo

itmustbejj / aws-secret-sidecar-injector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-samples/aws-secret-sidecar-injector

0.0 1.0 0.0 103 KB

Kubernetes mutating webhook to fetch secrets from AWS Secrets Manager

License: MIT No Attribution

Dockerfile 2.55% Starlark 8.59% Go 79.55% Smarty 1.68% Python 7.63%

aws-secret-sidecar-injector's Introduction

AWS Secret Sidecar Injector

The aws-secret-sidecar-injector is a proof-of-concept(PoC) that allows your containerized applications to consume secrets from AWS Secrets Manager. The solution makes use of a Kubernetes dynamic admission controller that injects an init container, aws-secrets-manager-secret-sidecar, upon creation/update of your pod. The init container relies on IRSA to retrieve the secret from AWS Secrets Manager. The Kubernetes dynamic admission controller also creates an in-memory Kubernetes volume (with name secret-vol and emptyDirectory.medium as Memory) associated with the pod to access the secret.

Prerequsites

  • An IRSA ServiceAccount that has permission to access and retrive the secret from AWS Secrets Manager
  • Helm to install the mutating admission webhook

Installation

Deploying mutatating webhook to inject the init container

  • Add the Helm repository which contains the Helm chart for the mutating admission webhook

    helm repo add secret-inject https://aws-samples.github.io/aws-secret-sidecar-injector/

  • Update the Helm repository

    helm repo update

  • Deploy the mutating webhook admission controller

    helm install secret-inject secret-inject/secret-inject

Accessing the secret

Add the following annotations to your podSpec to mount the secret in your pod

secrets.k8s.aws/sidecarInjectorWebhook: enabled

secrets.k8s.aws/secret-arn: <SECRET-ARN>

The decrypted secret is written to a volume named secret-vol and the filename of the secret is secret. The Kubernetes dynamic admission controller also creates corresponding mountPath /tmp/secret for containers within the pod to access the secret.

This repository contains a sample Kubernetes deployment manifest which uses this project to access AWS Secrets Manager secret.

Creating Secrets

AWS Secrets Manager secrets can be created and managed natively in Kubernetes using Native Secrets(NASE). The NASE project is a serverless mutating webhook, which "intercepts" the calls to create and update native Kubernetes Secrets and writes the secret in the secret manifest to AWS Secrets Manager and returns the ARN of the secret to Kubernetes which stores it as a secret.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

aws-secret-sidecar-injector's People

Contributors

amazon-auto avatar amit0701 avatar jicowan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.