• Stars
    star
    167
  • Rank 226,635 (Top 5 %)
  • Language
    Go
  • License
    MIT License
  • Created over 6 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

dexter is a Kubernetes OIDC helper with as much automation as possible

dexter

dexter is a OIDC (OpenId Connect) helper to create a hassle-free Kubernetes login experience powered by Google or Azure as Identity Provider. All you need is a properly configured Google or Azure client ID & secret.

Supported identity providers

Identity Provider State
Google complete
Microsoft Azure complete

Authentication Flow

dexter will open a new browser tag/window and redirect you to your configured Idp. The only interaction you have is the login at your provider and your k8s config is updated automatically.

dexter flow

See dexter in action

dexter in action

OIDCProvider Configuration

Each OpenID Connect provider requires some configuration. This basic description may not be all you have to do but it worked at the time of writing.

Google

Microsoft Azure

Auto pilot configuration

dexter also support auto pilot mode. If your existing kubectl context uses one of the supported Identity Providers, dexter will try to use extract the OIDC data from kubeconfig.

Installation

You can download a prebuilt version from the Github release section or build it yourself. The easiest way to get everything set up correctly (e.g. ldflags) is to use goreleaser.

# cd DEXTER_SOURCE
# goreleaser release --snapshot --rm-dist
• releasing...
• loading config file       file=.goreleaser.yml
• loading environment variables
• getting and validating git state
   • building...               commit=377677a03da17461acf7775519518fb3336e6753 latest tag=v0.4.1
   • pipe skipped              error=disabled during snapshot mode
• parsing tag
• running before hooks
   • running                   hook=go mod tidy
• setting defaults
• snapshotting
   • building snapshot...      version=0.4.2-next
• checking distribution directory
   • --rm-dist is set, cleaning it up
• loading go mod information
• build prerequisites
• writing effective config file
   • writing                   config=dist/config.yaml
• building binaries
   • building                  binary=dist/dexter_darwin_arm64/dexter
   • building                  binary=dist/dexter_darwin_amd64/dexter
   • building                  binary=dist/dexter_linux_amd64/dexter
• universal binaries
   • creating from 2 binaries  binary=dist/dexter_darwin_all/dexter
• archives
   • creating                  archive=dist/dexter_0.4.2-next_Linux_x86_64.tar.gz
   • creating                  archive=dist/dexter_0.4.2-next_Darwin_all.tar.gz
• calculating checksums
• storing release metadata
   • writing                   file=dist/artifacts.json
   • writing                   file=dist/metadata.json
• release succeeded after 8.18s

Check ./dist for the build that matches your platform.

Embed credentials and template

You can also customize the build and embed client credentails and a default kubectl config into the binary. Again, using goreleaser for the build is the easiest approach. Client credentials are embedded automatically when you set two environment variables.

CLIENT_ID=abc123.apps.googleusercontent.com
CLIENT_SECRET=mySecret

You can streamline your user experience even more by also specifying a default provider. dexter auth will then run the specified provider. Valid choices are google and azure.

DEFAULT_PROVIDER=google

If you want to to change the default config template that is deployed when there is no config on the system you have to replace the contents of ./tmpl/kube-config.yaml with your valid kubectl configuration. This can come in handy if you want to pre-populate clusters and certificates.

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: XXX
    server: https://stage.cluster:6443
  name: stage
- cluster:
    certificate-authority-data: YYY
    server: https://production.cluster:6443
  name: production
contexts:
- context:
    cluster: stage
    user: {{ .User }}
  name: stage
- context:
    cluster: production
    user: {{ .User }}
  name: production
current-context: stage
kind: Config
preferences: {}

Please make sure that you have {{ .User }} in all contexts that need you want to enrich with the OIDC account you are about to configure.

Run dexter

Run dexter without a command to access the help screen/intro.

❯ ./dexter
    .___               __
  __| _/____ ___  ____/  |_  ___________
 / __ |/ __ \\  \/  /\   __\/ __ \_  __ \
/ /_/ \  ___/ >    <  |  | \  ___/|  | \/
\____ |\___  >__/\_ \ |__|  \___  >__|
     \/    \/      \/           \/

dexter is a authentication helper for Kubernetes that does the heavy
lifting for SSO (Single Sign On) for Kubernetes.

Usage:
  dexter [command]

Available Commands:
  auth        Authenticate with OIDC provider
  help        Help about any command
  version     Print the version number of dexter

Flags:
  -h, --help          help for dexter
      --timeout int   Timeout for HTTP requests to OIDC providers (default 2)
  -v, --verbose       verbose output

Use "dexter [command] --help" for more information about a command.

Running dexter auth [Idp] will start the authentication process.

 ❯ ./dexter auth --help
Use a provider sub-command to authenticate against your identity provider of choice.
For details go to: https://gini.net/en/blog/frictionless-kubernetes-openid-connect-integration/

Usage:
  dexter auth [flags]
  dexter auth [command]

Available Commands:
  azure       Authenticate with the Microsoft Azure Identity Provider
  google      Authenticate with the Google Identity Provider

Flags:
  -c, --callback string        Callback URL. The listen address is dreived from that. (default "http://127.0.0.1:64464/callback")
  -i, --client-id string       Google clientID (default "REDACTED")
  -s, --client-secret string   Google clientSecret (default "REDACTED")
  -d, --dry-run                Toggle config overwrite
  -h, --help                   help for auth
  -k, --kube-config string     Overwrite the default location of kube config (default "/Users/dkerwin/.kube/config")
  -t, --kube-template          Use the embedded template when there is no kubectl configuration (default true)
  -u, --kube-username string   Username identifier in the kube config
  -f, --write-email string     Write user email to the specified file for use with other tooling

Global Flags:
  -v, --verbose   verbose output

Use "dexter auth [command] --help" for more information about a command.

Contribution Guidelines

It's awesome that you consider contributing to dexter and it's really simple. Here's how it's done:

  • fork repository on Github
  • create a topic/feature branch
  • push your changes
  • update documentation if necessary
  • open a pull request

Authors & Contributors

Initial code was written by Daniel Kerwin & David González Ruiz

Contributors (in alphabetical order):

Thank you so much!

Acknowledgements

dexter was inspired by this blog post series by Joel Speed, Micah Hausler's k8s-oidc-helper & CoreOS dex.

License

MIT License. See License for full text.

More Repositories

1

puppet-git-hooks

githooks(5) scripts for working with puppet code
Shell
55
star
2

dropwizard-gelf

Addon bundle for Dropwizard to support logging to a GELF-enabled server like Graylog or logstash
Java
52
star
3

puppet-cassandra

A Puppet module to install Apache Cassandra from the DataStax distribution
Puppet
24
star
4

youtrack-githook

Python script to integrate GitLab with YouTrack by processing the payload of a webhook sent by GitLab
Python
22
star
5

gini-sdk-ios

Gini IOS SDK
Objective-C
13
star
6

gini-vision-lib-android

Android library providing components for capturing, reviewing and analyzing photos of invoices and remittance slips.
Java
11
star
7

puppet-virtualbox

Puppet module to install Oracle VirtualBox
Puppet
10
star
8

gini-vision-lib-ios

Swift library providing components for capturing, reviewing and analyzing photos of invoices and remittance slips.
Swift
10
star
9

gini-api-ruby

Ruby client for the Gini API
Ruby
7
star
10

puppet-idea

Puppet module to install IntelliJ IDEA
Puppet
7
star
11

gini-mobile-ios

Monorepo for Gini iOS SDKs
Swift
6
star
12

jersey-smime

A port of the S/MIME implementation in resteasy-crypto to Jersey
Java
5
star
13

puppet-gradle

Puppet module to install Gradle
Puppet
5
star
14

ginivision-android-example

Example project that shows how to use the Gini Vision Framework.
Java
3
star
15

puppet-rundeck

Puppet module to manage Rundeck, an open-source process automation and command orchestration tool.
Puppet
3
star
16

doctag-xml-schema

docTag XML schema work-in-progress.
Ruby
3
star
17

gini-demo-ios

A demo application to show the integration and functionality of the Gini Vision Library and Gini SDK for iOS.
Objective-C
2
star
18

puppet-tayu

A Puppet module to manage tayu, a webservice for integrating PuppetDB with Rundeck.
Puppet
2
star
19

puppet-scala

Puppet module to install Scala
Puppet
2
star
20

trello-dashboard

Dashboard for Trello
Go
2
star
21

gini-api

Official API documentation for Gini
HTML
2
star
22

gini-switch-sdk-android

The Gini Switch SDK allows to capture & analyze documents (e.g. electricity bills). The information extracted can then be used to easily switch to a new contract or tariff.
Java
2
star
23

puppet-googlechrome

Puppet module to install Google Chrome
Puppet
2
star
24

gini-switch-sdk-ios

The Gini Switch SDK allows to capture & analyze documents (e.g. electricity bills). The information extracted can then be used to easily switch to a new contract or tariff.
Swift
2
star
25

ginivision-sdk-assets

Assets for Gini Vision iOS and Android SDKs
1
star
26

dropbox-java-sdk

Dropbox Java SDK with fixed POM
Java
1
star
27

giniVisionLibReactnativeExample

Java
1
star
28

gini-mobile-xamarin

Monorepo for Gini Xamarin Bindings
C#
1
star
29

cassandra

Gini's fork of the official Cassandra image. Gets automatically built weekly to keep up to date with the official, source one.
Shell
1
star
30

gini-pay-bank-sdk-android

Gini Pay for Bank SDK for Android
Kotlin
1
star
31

bank-api-library-ios

Release repo for GiniBankAPILibrary for iOS
Swift
1
star
32

bank-sdk-ios

Release repo for Gini Bank SDK for iOS
Swift
1
star
33

ginivision-android

GiniVision Android documentation
HTML
1
star
34

gini-ios

Library that eases the integration of Gini document extraction process in iOS
Swift
1
star
35

gini-demo-ios-swift

A demo application to show the integration and functionality of the Gini Vision Library and Gini SDK for iOS with Swift.
Swift
1
star
36

gini-mobile-android

Monorepo for Gini Android SDKs and Libraries
Kotlin
1
star
37

gini-sdk-android

Android SDK for the Gini API
Java
1
star