Skip to content

postgres: the tenant-visible Secret surface has no guard while postgres-rd selects the trust anchor by label #3701

Description

packages/system/postgres-rd/cozyrds/postgres.yaml:46 includes matchLabels: internal.cozystack.io/tenant-ca: "true" under spec.secrets.include, so a Secret carrying that label joins the tenant's readable set as soon as the lineage webhook can resolve its owner. Nothing in packages/apps/postgres/ pins what that surface may contain: there is no dashboard-resourcemap_test.yaml, and the dashboard Role granting <release>-credentials is asserted nowhere.

Two changes break it without turning a test red. A rule granting secrets with no resourceNames is unrestricted rather than narrow, so it adds no name for a name-by-name check to notice. And a second matchLabels entry on a label the operator stamps on its own Secrets reaches key-bearing ones while every name in the file stays correct.

qdrant pins both layers in cozystack/cozystack#3341, and both pins were confirmed by mutation rather than by reading: the ResourceDefinition against the rendered chart, because the template globs cozyrds/ and reading one file there misses a second, and the Role with its binding compared whole across value permutations instead of probed for known-bad names. The two files port to postgres almost verbatim; only the chart path and the expected Secret set differ. nats has the same gap.

This predates the qdrant work: the selector is on main, and the missing tests are missing there too.

Activity

  1. added
    kind/cleanupCategorizes issue or PR as related to cleanup of code, process, or technical debt
    area/testingIssues or PRs related to testing (e2e, bats, unit tests)
    area/databaseIssues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse)
    triage/acceptedIndicates an issue is ready to be actively worked on
    priority/backlogGeneral backlog priority. Lower than priority/important-longterm
    and removed
    triage/needs-triageIndicates an issue needs triage by a maintainer
    on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/databaseIssues or PRs related to managed databases (postgres, mariadb, redis, etcd, kafka, clickhouse)area/testingIssues or PRs related to testing (e2e, bats, unit tests)kind/cleanupCategorizes issue or PR as related to cleanup of code, process, or technical debtpriority/backlogGeneral backlog priority. Lower than priority/important-longtermtriage/acceptedIndicates an issue is ready to be actively worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions