Skip to content

Secret data not redacted when rendering invalid Secret #16193

Closed
argoproj/gitops-engine
#551
@itmustbejj

Description

@itmustbejj

Describe the bug

When rendering an invalid Secret, ArgoCD will leak the sensitive stringData in both the error message and diff view.

To Reproduce

To reproduce, create a simple secret with arbitrary values, and then set a value as an integer instead of a string. You will get an error like this (with sensitive and identifying info omitted):

one or more objects failed to apply, reason: "" is invalid: patch: Invalid value: patch: Invalid value: "map[ ....]" cannot convert int64 to string.

Additionally, the resource and app diffs will show unredacted stringData, regardless of whether the original Secret used data or stringData.

Expected behavior

The secret's data should be redacted during a failed sync of an invalid resource in the same way that a successfully synced Secret resource has its data redacted in the Argo UI.

Screenshots
image
image

Version

$ argocd version
argocd: v2.8.6+113b538
  BuildDate: 2023-10-31T14:18:21Z
  GitCommit: 113b53859dbf01cee7f1abac255cb112ad30bd8b
  GitTreeState: clean
  GoVersion: go1.20.10
  Compiler: gc
  Platform: linux/amd64

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomponent:coreSyncing, diffing, cluster state cachetype:securitySomething is not secureversion:2.14Latest confirmed affected version is 2.14

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions