IAM-backed ObjectStores generate wildcard Secret RBAC
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 64/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- aws, go, kubernetes
- Domain
- authorization, backend, security
Research direction
Start at the Role generation and AWS credential-reference collection paths, then compare them with the existing Azure default/managed identity handling. Verify the IAM-inheritance case and the explicit credential Secret case, and add or update tests so completion means no Secret rule for an empty collection and a scoped rule when Secret names are present.
Written by the indexing model from the issue text.
Description
Summary
When an ObjectStore uses AWS IAM role inheritance (inheritFromIAMRole: true) and does not reference any credential Secrets, the generated <cluster>-barman-cloud Role still contains a secrets rule with no resourceNames.
In Kubernetes RBAC, an omitted or empty resourceNames list does not restrict the rule to no objects; it allows the verbs on all resources of that type. As a result, an IAM-backed barman-cloud instance can get/list/watch every Secret in the namespace even though barman-cloud does not need any Secret for the AWS credential chain.
Why this matters
Deployments using IRSA, pod identity, or IMDS typically set inheritFromIAMRole: true so barman-cloud gets credentials from the pod environment. In that mode, barman-cloud returns before reading AWS credential Secret references, so the plugin should not grant Secret access unless a credential Secret is actually needed.
Expected behavior
If no credential Secret names are collected for the ObjectStores referenced by a cluster, the generated Role should not include a secrets rule. For AWS credentials with inheritFromIAMRole: true, AWS Secret references should be ignored the same way Azure default/managed identity credentials are ignored today.
Actual behavior
The Role includes a secrets rule with an empty resourceNames field, which grants access to all Secrets in the namespace.
Proposed fix
- Skip AWS credential Secret references when
inheritFromIAMRoleis true. - Omit the generated
secretsPolicyRule when the collected Secret name set is empty. - Keep the existing scoped
secretsrule when explicit credential Secret refs are present.
- Dominant language
- Go
- Stars
- 192
- Forks
- 75
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cloudnative-pg/plugin-barman-cloud
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
cloudnative-pg/plugin-barman-cloud#1104 · 4 reactions ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
cloudnative-pg/plugin-barman-cloud#1113 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 15/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
All issues in cloudnative-pg/plugin-barman-cloud
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug group: validation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
codecheckers/chekhov#51 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100