Skip to content

fix: mark snapshot agent credentials as sensitive - #171

Open
jonasz-lasut wants to merge 1 commit into
upbound:mainfrom
jonasz-lasut:fix/snapshot-agent-sensitive-keys
Open

jonasz-lasut wants to merge 1 commit into
upbound:mainfrom
jonasz-lasut:fix/snapshot-agent-sensitive-keys

Conversation

@jonasz-lasut

@jonasz-lasut jonasz-lasut commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Description of your changes

SnapshotAgentConfig exposed the cloud storage credentials of vault_raft_snapshot_agent_config as plain strings, because the upstream Terraform schema does not mark them sensitive. This adds a resource configurator that sets Sensitive on aws_secret_access_key, aws_session_token, azure_account_key and google_service_account_key, and regenerates the resource.

The generated API now has awsSecretAccessKeySecretRef, awsSessionTokenSecretRef, azureAccountKeySecretRef and googleServiceAccountKeySecretRef in spec.forProvider and spec.initProvider, and the plain fields are gone from spec and status.atProvider.

This is an in-place change to v1alpha1: manifests that set the plain fields must move the value into a Secret and reference it. It's a security bugfix which justifies no api version update

Fixes #101

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Run make reviewable test; there is no e2e example for this resource.

The Terraform schema for vault_raft_snapshot_agent_config declares the
cloud storage credentials as plain strings, so the generated
SnapshotAgentConfig exposed aws_secret_access_key, aws_session_token,
azure_account_key and google_service_account_key as clear-text fields in
spec.forProvider and echoed them in status.atProvider.

Mark the four attributes sensitive in a resource configurator. The
generated API now carries awsSecretAccessKeySecretRef,
awsSessionTokenSecretRef, azureAccountKeySecretRef and
googleServiceAccountKeySecretRef in spec.forProvider and
spec.initProvider, drops the plain fields from spec and status, and the
values are read from Kubernetes Secrets at reconcile time.

This changes the v1alpha1 schema in place: manifests that set the plain
fields must move the value into a Secret and reference it. Storing
secrets in clear text in the spec is treated as a bug rather than a
supported API, so no new API version is introduced.

Fixes upbound#101
@jonasz-lasut
jonasz-lasut marked this pull request as ready for review September 10, 2026 12:17
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.

Allow referencing secret in SnapshotAgentConfig

1 participant