Skip to content

terraform TF022 treats the secret id of a secret manager data source as a credential #5080

Closed

Description

@lex00

Found with chant 0.124.95 while reading a clone of kubernetes/k8s.io at commit 2b3d9153 offline, for #5067.

TF022 (plaintext credential) fires on the secret argument of data "google_secret_manager_secret_version_access". That argument is the id of the secret to read, not a secret value.

data "google_secret_manager_secret_version_access" "x" {
  secret = "datadog_fastly_logs_streaming"
}

Example: infra/fastly/terraform/dl.k8s.io/data.tf:18. 21 findings in that repo, all of this shape, all at error severity.

The same applies to google_secret_manager_secret_version (data source), aws_secretsmanager_secret_version.secret_id and similar reference arguments.

Wanted: TF022 knows which arguments are references to a secret and skips them. A deny-by-name match on secret alone is too wide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:lintarea:terraformbugepic:estate-read

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions