Repository navigation
Conversation
…roxy-init The proxy-init init container used privileged: true for iptables setup, but only NET_ADMIN and NET_RAW capabilities are actually needed. This matches the static AuthBridge deployment manifest and Istio's istio-init pattern. On OpenShift, privileged mode requires the privileged SCC which is overly broad. With capabilities, a narrower custom SCC can be used instead. Signed-off-by: Ladislav Smola <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Ladislav Smola <[email protected]>
The AuthBridge webhook injects a privileged init container for iptables traffic interception, which requires the full privileged SCC on OpenShift. This is overly broad — only NET_ADMIN and NET_RAW capabilities are needed. Changes: - Add kagenti-authbridge custom SCC allowing NET_ADMIN/NET_RAW + RunAsAny - Replace default-privileged-scc and agent-anyuid-scc RoleBindings with a single agent-authbridge-scc binding for all agent SAs - Add CI script to build webhook from custom kagenti-extensions branch - Add --extensions-ref option to /run-e2e comment trigger - Add extensions_ref input to workflow_dispatch Paired with rossoctl/cortex#234 which changes the webhook to use capabilities instead of privileged mode. To verify: /run-e2e --extensions-ref fix/proxy-init-drop-privileged Signed-off-by: Ladislav Smola <[email protected]> Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Ladislav Smola <[email protected]>
huang195
left a comment
There was a problem hiding this comment.
I have a local branch (feat/remove-privileged-init) that addresses the same problem but takes a more comprehensive approach. Here's how they compare:
Same core change: Both replace privileged: true with NET_ADMIN/NET_RAW capabilities on the proxy-init container.
Key differences:
| Aspect | This PR | My branch |
|---|---|---|
| Files changed | 2 (webhook Go code + README) | 7 files |
| Scope | Webhook code only | Webhook + init-iptables.sh + all static deployment manifests |
| iptables approach | Keeps existing REDIRECT logic |
Switches to DNAT $POD_IP — eliminates need for sysctl route_localnet=1 |
sysctl removal |
Not touched | Removes sysctl -w net.ipv4.conf.all.route_localnet=1 entirely |
POD_IP env var |
Not added | Adds via Downward API (status.podIP) |
| Static manifests | Not updated | Updates all 5 deployment YAMLs to match |
Potential issue with this PR: init-iptables.sh still calls sysctl -w net.ipv4.conf.all.route_localnet=1, which requires privileged mode to write to /proc/sys. After this PR drops privileged mode, that sysctl call will fail — which could break Istio ambient mesh coexistence.
My branch avoids this by replacing REDIRECT with DNAT to the pod's own IP (routable, non-loopback), so route_localnet=1 is no longer needed at all.
Would you like me to open a PR using my branch instead? Happy to do so if that would be helpful.
|
Opened #242 as a more comprehensive alternative that also addresses the |
|
Closing this in favor of #242 |
Summary
privileged: truewithcapabilities: [NET_ADMIN, NET_RAW]in the proxy-init init containerAuthBridge/k8s/authbridge-deployment.yaml:269-273) which already uses capabilitiesprivilegedSCCContext
On OpenShift (HyperShift CI), agent pods fail to start because the
anyuidSCC doesn't allowprivileged: truecontainers, and theprivilegedSCC isn't granted to dynamically-created agent service accounts. See rossoctl/rossoctl#933.With this change, a custom SCC allowing only
NET_ADMIN/NET_RAWcapabilities is sufficient.Test plan
🤖 Generated with Claude Code