external-ingress-auth-service

by Argelbargel

Helm chartv0.4.2App 0.4.2Verified publisher

Installs an instance of the External Ingress Authentication Service that provides external authentication for Kubernetes Ingress Controllers. It works perfect with NGINX ingress controller via [External Authentication](https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#external-authentication).

About this chart

external-ingress-auth-service

Installs an instance of the External Ingress Authentication Service that provides external authentication for Kubernetes Ingress Controllers. It works perfect with NGINX ingress controller via External Authentication.

Homepage: https://argelbargel.github.io/external-ingress-auth/

Source Code

Values

KeyTypeDefaultDescription
commonAnnotationsobject{}common annotations for all resources deployed by this chart
commonLabelsobject{}common labels for all resources deployed by this chart
config.authCacheTTLSecsint15
config.authentication.htpasswd.enabledbooltrueenable/disable htpasswd authentication backend
config.authentication.htpasswd.groups.enabledboolfalseenable to map users authenticated by the htpasswd-backend to groups.
config.authentication.htpasswd.groups.externalSecret.keystring"groups"key in the above secret containing the groups. Can be templated.
config.authentication.htpasswd.groups.externalSecret.namestring"{{ .Values.config.authentication.htpasswd.users.externalSecret.name }}"name of a Secret containing the group-mapping for htpassword-authentication-backend required, if groups are enabled. Can be templated
config.authentication.htpasswd.users.externalSecret.keystring".htpasswd"key in the above secret containing the users and their passwords. Can be templated.
config.authentication.htpasswd.users.externalSecret.namestring""name of a Secret containing the users and their passwords as generated by htpassword required, if htpasswd authentication is enabled. Can be templated
config.authentication.ldap.bindDnstring"cn={username},{{ .Values.config.authentication.ldap.searchBase }}"bind-Dn used to bind users for authentication If left empty, the bindDn is configured from the external secret below. Can be templated.
config.authentication.ldap.enabledboolfalseenable/disable ldap authentication backend
config.authentication.ldap.externalSecret.bindDnKeystring"LDAP_BIND_DN"key in the above secret containing the ldap-bind-dn Ignored if bindDn is set above. Can be templated.
config.authentication.ldap.externalSecret.managerDnKeystring"LDAP_MANAGER_DN"key in the above secret containing the dn of the user used to search group-memberships # Required. Can be templated.
config.authentication.ldap.externalSecret.managerPasswordKeystring"LDAP_MANAGER_PASSWORD"key in the above secret containing the password of the user used to search group-memberships # Required. Can be templated.
config.authentication.ldap.externalSecret.namestring""name of a Secret containing the credentials for the user used to search group-memberships with required, if ldap authentication is enabled. Can be templated
config.authentication.ldap.externalSecret.searchBaseKeystring"LDAP_SEARCH_BASE"key in the above secret containing the search-base for looking up groups-memberships Ignored if searchBase is set above. Can be templated.
config.authentication.ldap.externalSecret.searchFilterKeystring"LDAP_SEARCH_FILTER"key in the above secret containing the search-filter for looking up groups-memberships Ignored if searchFilter is set above. Can be templated.
config.authentication.ldap.externalSecret.serverUrlKeystring"LDAP_SERVER_URL"key in the above secret containing the ldap-server-url. Ignored if serverUrl is set above. Can be templated.
config.authentication.ldap.searchBasestring""base-DN to search users in when getting group-memberships If left empty, the searchBase is configured from the external secret below. Can be templated.
config.authentication.ldap.searchFilterstring"(sAMAccountName={username})"filter used when searching the user-object when getting group-memberships If left empty, the searchFilter is configured from the external secret below. Can be templated.
config.authentication.ldap.serverUrlstring""url to the ldap-server to authenticate users against. If left empty, the ldap-server is configured from the external secret below. Can be templated.
config.authorization.ingressRules.enabledboolfalse
config.authorization.ingressRules.secret.external.keystring"AUTHORIZATION_INGRESS_RULES_SECRET"key in the secret where the value for the ingress-secret is stored (can be templated)
config.authorization.ingressRules.secret.external.namestring""if set to a non-empty value, the secret validating authorization-rules from the ingress is injected from the given secret; otherwise a Secret is created with the value above (can be templated)
config.authorization.ingressRules.secret.valuestring"{{ randBytes 32 }}"
config.authorization.ruleslist[]authorization rules (see https://github.com/Argelbargel/external-ldap-auth/tree/main/charts/auth-service#authorization-rules)
config.bruteForceProtection.enabledbooltrueenable/disable brute-force-protection, blocking requests from ips after to many failed authentication requests
config.bruteForceProtection.expirationSecsint60determines the window within which failed authentication requests are counted and for how long the ip is blocked
config.bruteForceProtection.maxFailureCountint5determines how many failed authentication requests are allowed from one ip before requests get blocked
config.logging.formatstring"JSON"configures the log-format of the service.
config.logging.levelstring"WARN"configures the log-level of the service.
config.tls.enabledboolfalseenable/disable https/tls for the service
config.tls.externalSecret.certKeystring"tls.crt"name of the key in the above secret containing the certificate-data. Can be templated.
config.tls.externalSecret.keyKeystring"tls.key"name of the key in the above secret containing the certificate-key. Can be templated.
config.tls.externalSecret.namestring"{{ .Values.ingress.tls.secretName }}"name of a Secret containing the TLS-certificate and key Required if TLS is enabled. Can be templated.
deployment.annotationsobject{}additional annotations specific to the deployment resource
deployment.initContainerslist[]initContainers for the deployment; can be templated e.g to use helm-values
deployment.labelsobject{}additional labels specific to the deployment resource
deployment.replicasint1
deployment.resources.limits.memorystring"128Mi"
deployment.resources.requests.cpustring"50m"
deployment.resources.requests.memorystring"128Mi"
deployment.volumeMountslist[]additional volume mounts for the external-ldap-auth-container; can be templated e.g to use helm-values
deployment.volumeslist[]additional volumes for the deployment; can be templated e.g to use helm-values
image.pullPolicystring"IfNotPresent"
image.pullSecretslist[]image-pull-secrets; can be templated e.g to use helm-values
image.repostring"ghcr.io/argelbargel/external-ingress-auth"overrides the image-repo for the deployed container-image. Can be templated.
image.tagstring"{{ .Chart.AppVersion }}"overrides the image-tag for the deployed container-image. Can be templated.
ingress.annotationsobject{}additional annotations specific to the ingress resource
ingress.enabledboolfalsewhen true, generates an Ingress for the auth-service. As the auth-service should only be used by Ingresses, should NOT enable this in production in most use-cases.
ingress.hoststring""host-name for the ingress. Required if ingress is enabled. Can be templated.
ingress.labelsobject{}additional labels specific to the ingress resource
ingress.tls.enabledboolfalse
ingress.tls.secretNamestring""name of a Secret containing the certificate data. Required if tls enabled. Can be templated
service.annotationsobject{}additional annotations specific to the service resource
service.labelsobject{}additional labels specific to the service resource
service.typestring"ClusterIP"the service-type As the auth-service should only be used by Ingresses and not receive client-traffic directly, this should be kept at ClusterIP in most use-cases.
serviceMonitor.annotationsobject{}additional annotations specific to the service-monitor resource
serviceMonitor.enabledboolfalseenable a Service-Monitor monitoring the metrics exposed by the auth-service
serviceMonitor.labelsobject{}additional labels specific to the service-monitor resource

Authorization Rules

Configuring authorization rules for the service is much more readable when using this chart. Rules are configured below the key .config.rules:

config:
  rules:
  - hosts: [] # list of hosts for which the rule applies
    ranges: [] # list of ip-ranges for which the rule applies, e.g. 192.168.0.1/16
    methods: [] # list of methods for which the rule applies, e.g. GET
    paths: [] # list of paths for which the rule applies, e.g. GET
    public: false # whether access to the resource specified by the properties above is public (true) or restricted (false)
    # the properties below are ignored if public: true
    users: [] # list of users allowed access to the resource specified by the properties above
    groups: [] # list of groups allowed access to the resource specified by the properties above
    operators:
      groups: <AND or OR> # default: OR
      users-and-groups: <AND or OR> # default AND

License

  • Source code is licensed under MIT

Deploy external-ingress-auth-service with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has external-ingress-auth-service on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartexternal-ingress-auth-service is pinned at v0.4.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply