Chapter 3. Masking sensitive annotations in the Argo CD web UI
Prevent accidental exposure of sensitive information by masking annotation values in the Argo CD web UI. Configure which annotation keys to hide by adding them to the Argo CD custom resource (CR). This enhances security for sensitive data, such as tokens or API keys, stored in annotations on Secret resources.
OpenShift Container Platform automatically masks the openshift.io/token-secret.value annotation key by default. OpenShift Container Platform adds this annotation to secrets of type kubernetes.io/dockercfg, and it contains a service account token that requires protection. You can extend the default list with additional annotation keys as needed.
3.1. Prerequisites Copy linkLink copied to clipboard!
- You have created an Argo CD instance. For more information, see "Installing a user-defined Argo CD instance".
3.2. Enabling sensitive annotations masking in the Argo CD web UI Copy linkLink copied to clipboard!
Configure the Argo CD web UI to hide sensitive values in annotations on Secret resources by specifying the annotation keys to mask in the Argo CD custom resource (CR).
Procedure
- Log in to the OpenShift Container Platform web console.
-
In the Administrator perspective of the web console, click Operators
Installed Operators. - From the Project list, create or select the project where you want to install the user-defined Argo CD instance.
- From the installed Operators list, select Red Hat OpenShift GitOps, and then click the Argo CD tab.
To mask additional annotation keys beyond the default, complete the following steps:
Under the
.spec.extraConfigsection, set theresource.sensitive.mask.annotationskey to a comma-separated list that includes any additional keys you want to mask.NoteOpenShift Container Platform automatically masks
openshift.io/token-secret.valueby default. If you setresource.sensitive.mask.annotationsexplicitly inspec.extraConfig, your value replaces the default. To keep the default protection and add more keys, includeopenshift.io/token-secret.valuein your list.apiVersion: argoproj.io/v1beta1 kind: ArgoCD metadata: name: example spec: extraConfig: resource.sensitive.mask.annotations: openshift.io/token-secret.value, api-key, tokenwhere:
spec.extraConfig.resource.sensitive.mask.annotations-
Specifies a comma-separated list of annotation keys to mask in the Argo CD web UI, such as
openshift.io/token-secret.value,api-key, andtoken. OpenShift Container Platform automatically masksopenshift.io/token-secret.valueby default, so you do not need to specify it unless you add it alongside other keys.
ImportantEnsure that the annotation keys listed in
resource.sensitive.mask.annotationsare accurate and relevant to your use case. Wildcards are not supported. Specify each annotation key explicitly.
- Click Save.
To verify that the value in the Argo CD resource has been updated successfully, complete the following steps:
-
In the Administrator perspective of the web console, click Operators
Installed Operators. -
In the Project option, select the
Argo CDnamespace. - From the installed Operators list, select Red Hat OpenShift GitOps, and then click the Argo CD tab.
Verify that the Status field of the ArgoCD instance shows as Phase: Available.
Argo CD hides the values of the specified annotation keys in the Argo CD UI.
-
In the Administrator perspective of the web console, click Operators