Categorygithub.com/SimonStiil/kube-auth-proxy
repositorypackage
0.0.0-20250130153141-ff2d26773714
Repository: https://github.com/simonstiil/kube-auth-proxy.git
Documentation: pkg.go.dev

# README

Authentication proxy for Kubernetes

This has been a project for learning a lot more about Reverse Proxy and Kubernernetes certificate based authentication.
An Authentication proxy where:

  • A user logs in through Basic Auth.
  • Is authenticated with LDAP
  • Creates and Manages mTLS Certificates inside Kubernetes Cluster
  • Proxying the request to the cluster and returning the reply

Download

Docker image can be fetched from ghcr.io simonstiil/kube-auth-proxy
Can be build with go build .
Will also be available as a release in releases in the future

Configuration

Is done in config.yaml following the structure
Example can be seen in config.yaml ldap password is set with LDAP_BIND_PASSWORD

Configuration Structure

OptionDescriptionDefault
Proxy.HostHost to bind to
Proxy.PortPort to bind to8080
Proxy.TLS.CertificateCertificate to use for Proxy TLS
Proxy.TLS.KeyKey for Certificate to use for Proxy TLS
LDAP.URLURL for the LDAP Server
LDAP.GroupGroup that allows kubernetes authentication
LDAP.BaseDNBase DN for searches
LDAP.BindDNUser DN with LDAP Consumer rights
LDAP.SearchUserFilterFilter for finding users in group(&(uid=%s)(memberOf=%s))
LDAP.SearchGroupFilterFilter for finding group DN(&(cn=%s)(objectClass=posixGroup))
Kubernetes.KubernetesPath to kubeconfig file
Kubernetes.Hosthost and port to access kubernetes apikubernetes.default
Kubernetes.NamespaceNamespace to use for certificate secrets (Should exist)kube-auth-proxy

LDAP password is set in ENV with LDAP_BIND_PASSWORD

Deplyment Example

See yaml files in deployment

Gotchas

The logged in user will only have the rights that are given to that user. Example of a GlobalRole and GlobalRolebinding in examples