Coder Social home page Coder Social logo

kube-auth's Introduction

Kube Auth

Kube Auth is a webhook handler service for the kubernetes token and auhorizations webhook modes. The service essentually wraps the code for CSV tokens and ABAC policy and presents them to the kubernetes API as a HTTP endpoint. The service will also handle the reloading of files on changes, i.e a new token added will reload etc.

- Integretion

This is better documented in the kubernetes docs, but a general gist is you need to create the two webhook files as below and update the kubeapi settings.

clusters:
- name: local
  cluster:
    certificate-authority: /etc/ssl/certs/platform_ca.pem
    server: https://127.0.0.1:8443/authorize/token
users:
- name: local
current-context: local
contexts:
- context:
    cluster: local
    user: local
  name: local
clusters:
- name: local
  cluster:
    certificate-authority: /etc/ssl/certs/platform_ca.pem
    server: https://127.0.0.1:8443/authorize/token
users:
- name: local
current-context: local
contexts:
- context:
    cluster: local
    user: local
  name: local
[staging@platform]$ cat secrets/secure/auth-
auth-policy.json   auth-webhook.yaml
[staging@platform]$ cat secrets/secure/auth-webhook.yaml
clusters:
- name: local-auth
  cluster:
    certificate-authority: /etc/ssl/certs/platform_ca.pem
    server: https://127.0.0.1:8443/authorize/policy
users:
  - name: local-auth
current-context: webhook
contexts:
- context:
    cluster: local-auth
    user: local-auth
  name: webhook
...
spec:
  containers:
  - args:
    - --region=eu-west-1
    - get
    - --output-dir=/etc/secrets
    - --bucket=some-bucket
    - --sync=true
    - --sync-interval=1m
    - --recursive=true
    - secure/
    image: quay.io/gambol99/kmsctl:v1.0.3
    name: secrets
    volumeMounts:
    - mountPath: /etc/secrets
      name: secrets
  - args:
    - --listen=127.0.0.1:8443
    - --token-file=/etc/secrets/tokens.csv
    - --auth-policy=/etc/secrets/auth-policy.json
    - --tls-cert=/etc/secrets/kubeapi.pem
    - --tls-key=/etc/secrets/kubeapi-key.pem
    image: quay.io/gambol99/kube-auth:v0.5.0
    name: kube-auth
    volumeMounts:
    - mountPath: /etc/secrets
      name: secrets
      readOnly: true
    - mountPath: /etc/ssl/certs
      name: certs
      readOnly: true
  - command:
    - /hyperkube
    - apiserver
    - --admission-control=AlwaysPullImages,NamespaceLifecycle,LimitRanger,ResourceQuota,ServiceAccount
    - --authentication-token-webhook-cache-ttl=1m
    - --authentication-token-webhook-config-file=/etc/secrets/token-webhook.yaml
    - --authorization-mode=Webhook
    - --authorization-webhook-config-file=/etc/secrets/auth-webhook.yaml
    ...
    image: quay.io/coreos/hyperkube:v1.4.7_coreos.0
    ...
    volumeMounts:
    - mountPath: /etc/secrets
      name: secrets
      readOnly: true
    - mountPath: /etc/ssl/certs
      name: certs
      readOnly: true
  ...
  volumes:
  - emptyDir: {}
    name: secrets
  - hostPath:
      path: /etc/ssl/certs
    name: certs
  - hostPath:
      path: /etc/kubernetes
    name: kubernetes

kube-auth's People

Contributors

gambol99 avatar

Watchers

James Cloos avatar  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.