Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/mintmaker/base/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- mintmaker-team.yaml
- mintmaker-schedule-calculator-manager.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: mintmaker-schedule-calculator-manager
namespace: mintmaker
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: mintmaker-schedule-calculator-manager-role
namespace: mintmaker
rules:
- apiGroups:
- ''
resources:
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- cronjobs
verbs:
- get
- list
- watch
Comment on lines +12 to +28
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Overbroad read permissions 🐞 Bug ⛨ Security

Role mintmaker-schedule-calculator-manager-role grants list/watch on all ConfigMaps and CronJobs in
the mintmaker namespace, which allows any pod using this ServiceAccount to read all ConfigMap data
and all CronJob specs in that namespace. This unnecessarily increases blast radius compared to
existing patterns in this repo that restrict ConfigMap access via resourceNames.
Agent Prompt
### Issue description
`mintmaker-schedule-calculator-manager-role` currently grants namespace-wide `list`/`watch` on `configmaps` and `cronjobs`, which allows reading *all* ConfigMaps and CronJobs in `mintmaker`.

### Issue Context
This repo already uses narrower RBAC patterns (e.g., `resourceNames` for ConfigMaps) to reduce blast radius.

### Fix Focus Areas
- Restrict permissions to specific resources (use `resourceNames` for ConfigMaps/CronJobs if the set is known) and/or drop `list`/`watch` if not strictly required.
- components/mintmaker/base/rbac/mintmaker-schedule-calculator-manager.yaml[12-28]
- (Example pattern) components/konflux-info/base/rbac.yaml[6-17]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: mintmaker-schedule-calculator-manager-rolebinding
namespace: mintmaker
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: mintmaker-schedule-calculator-manager-role
subjects:
- kind: ServiceAccount
name: mintmaker-schedule-calculator-manager
namespace: mintmaker
Loading