-
Notifications
You must be signed in to change notification settings - Fork 299
OPNET-783: BGP-based VIP management: FRRConfiguration rendering, DaemonSet placement and static pod RBAC #3047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mkowalski
wants to merge
3
commits into
openshift:master
Choose a base branch
from
mkowalski:bgp-vip-management
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| # RBAC for the frr-k8s static pod on control plane nodes (BGP VIP management). | ||
| # The static pod has no ServiceAccount; its controller and frr-status | ||
| # containers authenticate with the node kubeconfig | ||
| # (/etc/kubernetes/kubeconfig), whose identity is the MCO node-bootstrapper | ||
| # ServiceAccount (verified live via oc auth whoami). Grant it read access to | ||
| # FRRConfigurations/FRRK8sConfigurations and write access to node state CRs, | ||
| # plus the namespace-scoped reads (secrets for BGP session passwords, pods) | ||
| # that 002-rbac.yaml grants the DaemonSet service account, so the | ||
| # controller's informer caches can sync. | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRole | ||
| metadata: | ||
| name: frr-k8s-static-pod | ||
| rules: | ||
| - apiGroups: | ||
| - frrk8s.metallb.io | ||
| resources: | ||
| - frrconfigurations | ||
| - frrk8sconfigurations | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - apiGroups: | ||
| - frrk8s.metallb.io | ||
| resources: | ||
| - frrnodestates | ||
| - bgpsessionstates | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - create | ||
| - update | ||
| - patch | ||
| - delete | ||
| - apiGroups: | ||
| - frrk8s.metallb.io | ||
| resources: | ||
| - frrnodestates/status | ||
| - bgpsessionstates/status | ||
| verbs: | ||
| - get | ||
| - update | ||
| - patch | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - nodes | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: ClusterRoleBinding | ||
| metadata: | ||
| name: frr-k8s-static-pod | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: ClusterRole | ||
| name: frr-k8s-static-pod | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: node-bootstrapper | ||
| namespace: openshift-machine-config-operator | ||
| --- | ||
| # Namespace-scoped reads mirroring the DaemonSet SA's Role in 002-rbac.yaml | ||
| # (read-only: the static pod controller watches Secrets for BGP session | ||
| # passwords and pods; it does not need the DaemonSet's secrets update grant). | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: frr-k8s-static-pod | ||
| namespace: openshift-frr-k8s | ||
| rules: | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - secrets | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| - apiGroups: | ||
| - "" | ||
| resources: | ||
| - pods | ||
| verbs: | ||
| - get | ||
| - list | ||
| - watch | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: frr-k8s-static-pod | ||
| namespace: openshift-frr-k8s | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: frr-k8s-static-pod | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: node-bootstrapper | ||
| namespace: openshift-machine-config-operator | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Broad, cluster-wide RBAC grant to a shared bootstrap ServiceAccount, applied unconditionally.
Two concerns:
AdditionalRoutingCapabilitiesprovider is enabled — not conditioned on BGP VIP management being active (confirmed byrender_test.go, where the object count is identical withbootstrapResult == nil). Clusters using FRR for unrelated BGP use cases get this grant even though the static pod it's meant for never runs.node-bootstrapperis a single ServiceAccount used across every node's bootstrap process; granting it cluster-widecreate/update/patch/deleteonfrrnodestates/bgpsessionstates(not scoped to a single node's own objects, since plain RBAC can't express that) means a compromised node's bootstrap credential could tamper with every other node's BGP/FRR state.As per path instructions, RBAC for Kubernetes manifests should follow "least privilege; no cluster-admin for workloads". Consider scoping the verbs down (e.g. dropping
delete) and/or gating this manifest on BGP VIP management being active.Also applies to: 55-66
🤖 Prompt for AI Agents
Source: Path instructions