Code Monkey home page Code Monkey logo

remote-secrets's Introduction

remote-secrets

Remote Secrets allows you to use remote secret management systems, SSM parameter store, application configuration, Cloudformation stack outputs, and more to add a single secret in k8s.

How to use it

Install CRD

  1. from url
kubectl apply -f https://raw.githubusercontent.com/jerry153fish/remote-secrets/main/config/crd.yaml
  1. from source
make crd

Install controller

  1. from url
kubectl apply -f https://raw.githubusercontent.com/jerry153fish/remote-secrets/main/config/default/manager.yaml
  1. from source
make manifest

Create simple secret

  1. simple plain text secrets
kubectl apply -f https://raw.githubusercontent.com/jerry153fish/remote-secrets/main/config/simple/plaintext.yaml

It will just add a s simple plain text as the backend

apiVersion: jerry153fish.com/v1beta1
kind: RSecret # Identifier of the resource type.
metadata:
  name: test-plaintext # Name of the "RSecret" custom resource instance, may be changed to your liking
  namespace: default # Namespace must exist and account in KUBECONFIG must have sufficient permissions
spec:
  description: "test plaintext secrets" # Optional description of the resource
  resources:
    - backend: Plaintext
      data:
        - remote_value: test-rsecret-plaintext-value
          secret_field_name: test-rsecret-plaintext
        - remote_value: test-rsecret-plaintext-value-1
          secret_field_name: test-rsecret-plaintext-1

Configure backends access

if you want to add other backend you need to configure the backend access with k8s secret eg:


apiVersion: v1
kind: Secret
metadata:
  name: remote-secrets
  namespace: remote-secrets
type: Opaque
stringData:
  APP: "remote-secrets"
#  AWS_ACCESS_KEY_ID: "aaa"
#  AWS_SECRET_ACCESS_KEY: "secret"
#  AWS_REGION: "ap-southeast-2"
#  LOCALSTACK_URL: "http://dockerhost:4572"
#  TEST_ENV: "true"
  1. aws backend

The example above uses the environment variable to configure the AWS credentials. However, the remote-secrets is using aws-config which utilizes the AWS credential provider chain, so you can configure the credentials the way you want.

AWS Parameter Store

ensure you have correct access to SSM

  1. add the parameter
aws ssm put-parameter --name MyStringParameter --type "String" --value "Vici"
  1. add a SSM backend
    - backend: SSM
      data:
        - remote_value: MyStringParameter
          secret_field_name: test-rsecret-ssm-param

AWS Secret Manager

ensure you have correct access to Secret manager

  1. add the secret
aws secretsmanager create-secret --name MyTestSecret --secret-string "Vicd" 
  1. add a secret manager backend
    - backend: SecretManager
      data:
        - remote_value: MyTestSecret
          secret_field_name: test-rsecret-secretmanager

AWS Cloudformation outputs

ensure you have correct access to Cloudformation

  1. add a simple cloudformation stack
aws cloudformation create-stack --stack-name MyTestStack --template-body file://e2e/mock-cfn.yaml
  1. add as a cloudformation backend
    - backend: Cloudformation
      data:
        - remote_value: MyTestStack # import all the outputs
        - remote_value: MyTestStack # import specific output key
          secret_field_name: test-cfn-stack
          output_key: S3Bucket

remote-secrets's People

Contributors

jerry153fish 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.