Authentication operator (auth-controller)

About the service

ParameterDescription
GUI nameAuthentication Management Module
System name chartshturval-auth
Componentauth-controller
Cluster AssignmentCoordination of User and AuthOidcClient objects, verification of local users via validating webhook, preparation of data for OIDC clients.
CriticalYes
Public repository— (component of the Shturval platform)
Namespaceshturval-backend

auth-controller is included in the Helm chart shturval-auth. This chart also expands authn-server, session-manager and ldap-cache.

Contents

  1. Review
  2. Architecture
  3. Installation/deployment
  4. Diagnostics
  5. Lifecycle
  6. [Operator parameters](#6-operator parameters)
  7. CRD/API reference

1. Review

Purpose: automatic consistency of integration objects with the authorization subsystem: registered client records AuthOidcClient with updating of status conditions and associated Secret, as well as the object model of local users User with bcrypt severity through the validating webhook during Create/Update.

Features

ContourIntended use
UserReconcilerPresent in the reconcile assembly; changing User does not lead to automatic editing of spec/status by the operator.
AuthOidcClientReconcilerCreation and renegotiation of an OIDC client with a provider, observability through status fields.
Validating webhookChecking the correctness of spec.passwordHash from User.
Tracking provider changesResubmitting related CRs to the negotiation queue.

Initiation scripts

What’s going onWho initiatesObserved effect
Negotiation AuthOidcClientKubernetes plane or provider eventUpdate status, if necessary Secret.
Change UserKubernetes PlaneThe password is checked by a webhook during create/update.
Call validating webhookKubernetes API ServerReject invalid bcrypt values.
Tests of survivability and readinesskubeletHTTP /healthz, /readyz on managed addresses.

Limitations and implications

LimitConsequence for the administrator
UserReconciler without modifying logicRely on webhook and related services; don’t expect User autocorrection in reconcile.
spec.providerType only accepts the value shturvalThe field specifies the connection between the client and the built-in implementation of the authorization provider.
AUTHN_ISSUER must point to a working issuerCheck the value when transferring the stand to production.
Webhook depends on TLS stuff and ServiceAfter certificate changes, check the availability of admission.

Place in the chain of command

CR AuthOidcClient becomes the data source for application authn-server: watcher authn-server retrieves OAuth/OIDC client configuration from negotiated resources. User is limited by the password policy via webhook before the credentials are used in login-flow.

Key Features

CharacteristicsDescription
API groupauth.shturval.tech, version v1beta1
CR typesUser, AuthOidcClient
CR AreaNamespaced
Leader election ID953fa84f.shturval.tech
Operator testsHealth address :8081 on control flags
WebhookBy default, the port is 9443, the certificate directory is specified by the flags
Process isolationBinary /manager in container

2. Architecture

ComponentKindScopeDescription
UserCustomResourceDefinition + instancesNamespacebcrypt hash of user and group.
AuthOidcClientCustomResourceDefinition + instancesNamespaceRegistered OAuth clients.
auth-controllerDeploymentNamespaceOperator control logic.
Secretcore/v1NamespaceConfidential information related to the client after approval.

The exact names of worker resources, labels and the number of replicas are determined by the chart templates shturval-auth.

3. Installation / deployment

The operator is supplied as part of the Helm chart shturval-auth. Chart creates Deployment auth-controller, RBAC, webhook Service and related TLS stuff. The namespace is specified by the platform release.

Any parameter changes must be done via ShturvalServicePatch (SSP) over the relevant platform SSC, without manually changing the generated manifests.

4. Diagnostics

kubectl get deploy,pods -n "${NAMESPACE}"
kubectl logs -n "${NAMESPACE}" deploy/auth-controller -c manager --tail=200
kubectl get authoidcclients.auth.shturval.tech -n "${NAMESPACE}" -o wide
kubectl get users.auth.shturval.tech -n "${NAMESPACE}" -o wide
kubectl get validatingwebhookconfiguration
EventPossible reasonAction
ConditionCreateClient = False longissuer, TLS or client account with provider unavailableCheck AUTHN_ISSUER, network connectivity to authn-server and associated Secret.
Webhook not availableCertificate, Service or CA bundle errorRestore API server connectivity to webhook Service.
User rejected on creationbcrypt hash failed validating webhookUse the correct bcrypt hash format.

5. Life cycle

User

StageBehavior
Create/UpdateWebhook checks bcrypt; the object is saved upon successful validation.
Reconcile operatorCompletes without observable spec/status changes.
DeleteStandard Kubernetes deletion policies are used.

AuthOidcClient

StageBehavior
Starting approvalUntil the final state, Ready=false is set, then a reconciliation with the provider manager is performed.
RepeatOn errors, reconcile returns a controller-runtime error.
Link SecretSecret becomes a bound object by CR.
RemovalCheck the remaining resources with the provider after removing the CR.

6. Operator parameters

Process flags

FlagDefaultDescription
--metrics-bind-address0Process metrics address.
--health-probe-bind-address:8081Vitality tests.
--leader-electfalseLeader election.
--metrics-securetrueSecure metrics.
--enable-http2falseHTTP/2.
--root-ca-configmap-volume-path/root-ca/ca-bundle.pemRoot CA mount point for outbound TLS checks.
--webhook-port9443webhook port.
--webhook-cert-dir/tmp/k8s-webhook-server/serving-certs/Catalog of TLS webhook materials.
--debugfalseDetailed log recording via zap.

Environment Variables

VariableDescription
AUTHN_ISSUERIssuer of the internal authorization provider.
ENABLE_WEBHOOKSWhen false blocks webhook registration.
LOG_LEVELLog recording level.

7. CRD/API reference

Group: auth.shturval.tech, version: v1beta1, scope CR: Namespaced.

User

Field specTypeRequiredDescription
passwordHashstringYesbcrypt hash of the user’s password.
groups[]stringNoLocal user groups.

AuthOidcClient

Field specTypeRequiredDescription
clientSecretRefSecretReferenceNoSecret with client ID and client secret OAuth.
providerTypestring enum (shturval)YesClient management class.
Status fieldDescription
clientInfoIssuer URL, CA, claims mapping groups and username.
clientHashmd5 of observed client configuration data for change detection.
clientSecretRefObserved position of the secretion.
conditionsSequence of coordination phases.
ConditionTrueFalse reasons
ConditionInitClientManagerThe provider manager has been successfully built.Configuration error.
ConditionCreateClientThe client exists or has been created.Error writing configuration to provider.
ConditionValidateClientStatusThe client’s external state is synchronous with the platform’s expectations.Status validation error.