Skip to content

fix(redactors): move redactor storage from ConfigMaps to Secrets - #6033

Merged
xavpaice merged 2 commits into
mainfrom
sc-139291-move-redactor-specs-to-secrets
Aug 23, 2026
Merged

fix(redactors): move redactor storage from ConfigMaps to Secrets#6033
xavpaice merged 2 commits into
mainfrom
sc-139291-move-redactor-specs-to-secrets

Conversation

@xavpaice

@xavpaice xavpaice commented Aug 20, 2026

Copy link
Copy Markdown
Member

What this PR does / why we need it:

Moves all redactor storage from Kubernetes ConfigMaps to Secrets. The default clusterResources collector includes all ConfigMap data in support bundles in clear text, so redactor definitions that contain literal values (e.g., value-based redactors) were leaking sensitive data into support bundles. Storing redactors in Secrets removes them from that clear-text collection path and protects them with Kubernetes RBAC.

Specifically:

  • Bumps github.com/replicatedhq/troubleshoot to v0.133.0, which adds secret/... redactor URI support.
  • Moves the kotsadm-redact backend store from a ConfigMap to a Secret.
  • Moves the rendered redactor specs (kotsadm-redact-spec, kotsadm-<slug>-redact-spec, kotsadm-redact-default-spec) from ConfigMaps to Secrets.
  • Adds startup migrations to migrate the kotsadm-redact backend and delete legacy rendered redactor ConfigMaps.

Which issue(s) this PR fixes:

Fixes https://app.shortcut.com/replicated/story/139291/security-move-redactor-specs-from-configmaps-to-secrets

Does this PR require a test?

Existing tests were updated and new tests were added in:

  • pkg/redact/redact_test.go
  • pkg/redact/default_test.go
  • pkg/supportbundle/migrate_test.go

Does this PR require a release note?

New features:

NONE

Bug fixes:

Fixed a security issue where redactor specs and the `kotsadm-redact` backend ConfigMap were stored as ConfigMaps, causing literal redactor values to be collected in support bundles in clear text. Redactor storage has been moved to Kubernetes Secrets.

Improvements:

NONE

Does this PR require documentation?

NONE

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown

Reviews (1): Last reviewed commit: "fix(redactors): move rendered redactor s..." | Re-trigger Greptile

Comment thread pkg/redact/redact.go
@xavpaice xavpaice changed the title fix(redactors): move rendered redactor specs from ConfigMaps to Secrets fix(redactors): move redactor storage from ConfigMaps to Secrets Aug 20, 2026
@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown

Reviews (2): Last reviewed commit: "fix(redactors): move kotsadm-redact back..." | Re-trigger Greptile

@xavpaice

Copy link
Copy Markdown
Member Author

Before:

➜  kots git:(sc-139291-move-redactor-specs-to-secrets) ✗ k get configmap
NAME                                      DATA   AGE
kotsadm-application-metadata              1      46h
kotsadm-id                                1      46h
kotsadm-mattermost-moccasin-redact-spec   1      46h
kotsadm-redact                            0      46h
kotsadm-redact-default-spec               1      46h
kotsadm-redact-spec                       1      46h
kube-root-ca.crt                          1      6d23h
➜  kots git:(sc-139291-move-redactor-specs-to-secrets) ✗ k get secret   
NAME                                                         TYPE                DATA   AGE
kotsadm-mattermost-moccasin-supportbundle                    Opaque              1      46h
kotsadm-mattermost-moccasin-supportbundle-cluster-specific   Opaque              1      45h
kotsadm-mattermost-moccasin-supportbundle-default            Opaque              1      45h
kotsadm-mattermost-moccasin-supportbundle-vendor             Opaque              1      45h
kotsadm-minio                                                Opaque              2      46h
kotsadm-rqlite                                               Opaque              3      46h
kotsadm-sessions                                             Opaque              0      46h
kotsadm-tls                                                  kubernetes.io/tls   3      46h
test-redactor                                                Opaque              1      43h

After:

➜  kots git:(sc-139291-move-redactor-specs-to-secrets) ✗ k get secret   
NAME                                                         TYPE                DATA   AGE
kotsadm-mattermost-moccasin-supportbundle                    Opaque              1      46h
kotsadm-mattermost-moccasin-supportbundle-cluster-specific   Opaque              1      45h
kotsadm-mattermost-moccasin-supportbundle-default            Opaque              1      45h
kotsadm-mattermost-moccasin-supportbundle-vendor             Opaque              1      45h
kotsadm-minio                                                Opaque              2      46h
kotsadm-redact                                               Opaque              0      45s
kotsadm-rqlite                                               Opaque              3      46h
kotsadm-sessions                                             Opaque              0      46h
kotsadm-tls                                                  kubernetes.io/tls   3      46h
test-redactor                                                Opaque              1      43h
➜  kots git:(sc-139291-move-redactor-specs-to-secrets) ✗ k get configmap
NAME                           DATA   AGE
kotsadm-application-metadata   1      46h
kotsadm-id                     1      46h
kube-root-ca.crt               1      6d23h

@xavpaice

Copy link
Copy Markdown
Member Author

making this draft - not worth the risk, folks shouldn't be putting sensitive info in a redactor anyway

@xavpaice
xavpaice marked this pull request as draft August 21, 2026 00:51
@xavpaice
xavpaice marked this pull request as ready for review August 23, 2026 20:45
@greptile-apps

greptile-apps Bot commented Aug 23, 2026

Copy link
Copy Markdown

Reviews (3): Last reviewed commit: "fix(redactors): move kotsadm-redact back..." | Re-trigger Greptile

@xavpaice
xavpaice merged commit 72d05fa into main Aug 23, 2026
177 of 180 checks passed
@xavpaice
xavpaice deleted the sc-139291-move-redactor-specs-to-secrets branch August 23, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants