feat: Add anonymous authentication support to Helm chart#8
Merged
Conversation
Port anonymous auth from docker-compose to Helm/K8s deployment. Closes #5. Changes: - Add anonymousAuth.enabled toggle in values.yaml (default: false) - Create opensearch-security-config Secret with config.yml, roles.yml, roles_mapping.yml — anonymous_auth_enabled templated from values - Update OpenSearch Dashboards config with anonymous_auth_enabled and conditional savedObjects.permission.enabled via global values + tpl - Sync init script with docker-compose version (ANONYMOUS_AUTH_ENABLED env var, conditional anonymous role in workspace allowedRoles) - Pass OPENSEARCH_ANONYMOUS_AUTH_ENABLED env var to init-dashboards Job - Wire up Terraform anonymous_auth variable to Helm release - Add 6 helm-unittest tests covering both enabled/disabled states - Document usage in chart README Usage: helm install obs-stack charts/observability-stack \ --set anonymousAuth.enabled=true \ --set global.anonymousAuth.enabled=true Kiro/claude on behalf of @kylehounslow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the existing anonymous authentication feature from docker-compose to the Helm chart so Kubernetes deployments can skip the OpenSearch Dashboards login page (useful for demos, workshops, shared dev environments).
Closes #5
Changes
values.yamlanonymousAuth.enabled(default:false),global.anonymousAuth.enabled,securityConfigreference, dashboards anon auth configtemplates/opensearch-security-config.yamlconfig.yml(templatedanonymous_auth_enabled),roles.yml,roles_mapping.ymltemplates/init-dashboards-job.yamlOPENSEARCH_ANONYMOUS_AUTH_ENABLEDenv varfiles/init-opensearch-dashboards.pyANONYMOUS_AUTH_ENABLEDenv var + conditional anonymous role in workspaceallowedRolestests/anonymous_auth_test.yamlREADME.mdterraform/aws/observability-stack.tfvar.anonymous_auth→ Helm releaseHow it works
OpenSearch security config — A custom Secret (
opensearch-security-config) contains the 3 security plugin files.config.ymlhasanonymous_auth_enabledtemplated from.Values.anonymousAuth.enabled. The anonymous role/mapping files are always included (harmless when disabled — the role exists but is never assigned).OpenSearch Dashboards config — Uses the subchart's
tpl()rendering to conditionally setopensearch_security.auth.anonymous_auth_enabledandsavedObjects.permission.enabledviaglobal.anonymousAuth.enabled.Init script — Reads
OPENSEARCH_ANONYMOUS_AUTH_ENABLEDenv var (passed from the Job template) and conditionally addsopendistro_security_anonymous_roleto workspaceallowedRoles.Terraform —
var.anonymous_auth(already defined but unwired) now sets bothanonymousAuth.enabledandglobal.anonymousAuth.enabledon the Helm release.Usage
Testing
helm lint— passes for both enabled/disabledhelm unittest— all 35 tests pass (7 suites, including 6 new anonymous auth tests)helm template— verified correct rendering for both states:anonymous_auth_enabled: false,savedObjects.permission.enabled: true, env var"false"anonymous_auth_enabled: true,savedObjects.permission.enabled: false, env var"true"Future improvement
The dual
--setrequirement is a UX friction point. Could be eliminated by moving the dashboards config into a custom umbrella chart ConfigMap template instead of relying on the subchart'stpl()rendering.Kiro/claude on behalf of @kylehounslow