← Back to Pull requests

Scope down container permissions further to reduce attack surface #3130

Open
ConnorJC3 opened this pull request with 186 lines diff across 11 files
View on GitHub
ConnorJC3 ConnorJC3 commented on Nov 17, 2026 19:31 UTC
Author

What type of PR is this?

<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
-->

/kind cleanup

What is this PR about? / Why do we need it?

Scope down permissions and reduce attack surface further as part of our investigation into https://github.com/aws/containers-roadmap/issues/2713

  • Add eks.amazonaws.com/skip-containers annotation for non-driver containers. This prevents pod identity and IRSA from injecting credentials into those containers (docs ref)

  • Set several mounts where we only connect to an existing socket as read-only

  • Drop linux capabilities in the containers that don't need them

  • Add seccompProfile which was missing on some sidecars

  • Don't render/deploy the snapshotter RBAC when the snapshotter sidecar is not enabled

  • Remove unused probeDirVolume (this was used for the exec-based node-driver-registrar probe we replaced with a gRPC based solution many releases ago). This is technically a super minor breaking change, it removes a parameter that was effectively a no-op.
  • How was this change tested?

    Manually ran all relevant E2E tests, including those our CI doesn't normally run (e.g. windows hostprocess, older windows server versions).

    Does this PR introduce a user-facing change?


    <!--
    If no, just write "NONE" in the release-note block below.
    If yes, enter your extended release note in the block below.
    -->
    ``release-note
    IMPORTANT - for release owner - need to add "must read" section (copy it from previous changelog entries) and include some wording like below (this part should be in the Helm-only changelog):

    Helm parameter node.probeDirVolume has been removed. If you were customizing this parameter, remove it from your configuration before installing or upgrading.

    node.probeDirVolume enabled customizing the emptyDir volume used for the previous exec-based node-driver-registrar probe. The exec-based probe is no longer used, and the parameter has been an effective no-op for several driver releases.

    Scope down container permissions and reduce attack surface.
    ``

    Diff: 186 lines (+142 / -44) across 11 files Reviewer: ElijahQuinones Review duration: 23850m
    All Vouch review confidence checks passed
    Residual risk 0.07 = Change Risk (0.72) × (1 − Review Confidence (0.91)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.72 · 186 lines diff across 11 files
    0.72
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.89 · 5 substantive comment(s)
    0.89
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    90%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.313
    Sensitive Paths sensitive_paths
    0.072
    Real PR Conversation Timeline
    9 items
    kubernetes-prow[bot] kubernetes-prow[bot] commented on Nov 17, 2026 19:31 UTC
    Bot

    [APPROVALNOTIFIER] This PR is NOT APPROVED

    This pull-request has been approved by:
    Once this PR has been reviewed and has the lgtm label, please assign mdzraf for approval. For more information see the Code Review Process.

    The full list of commands accepted by this bot can be found here.

    <details open>
    Needs approval from an approver in each of these files:

  • OWNERS
  • Approvers can indicate their approval by writing /approve in a comment
    Approvers can cancel approval by writing /approve cancel in a comment
    </details>
    <!-- META={"approvers":["mdzraf"]} -->

    ConnorJC3 ConnorJC3 commented on Nov 17, 2026 19:32 UTC
    Author

    /hold

    ConnorJC3 ConnorJC3 commented on Dec 02, 2026 18:47 UTC
    Author

    /unhold

    torredil torredil commented on code on Dec 02, 2026 19:28 UTC
    Code Review
    charts/aws-ebs-csi-driver/templates/controller.yaml:1
    @@ -32,15 +32,13 @@ spec:
             {{- if .Values.controller.podLabels }}
             {{- toYaml .Values.controller.podLabels | nindent 8 }}
             {{- end }}
    -      {{- if .Values.controller.podAnnotations }}
           annotations:
    -        {{- $annotations := dict }}
    +        {{- $annotations := dict "eks.amazonaws.com/skip-containers" "csi-provisioner,csi-attacher,csi-snapshotter,csi-resizer,volumemodifier,csi-external-health-monitor-controller,liveness-probe" }}

    Thoughts on adding a helm-template test that renders with all sidecars enabled and fails if any container other than ebs-plugin and metadata-labeler is missing from the annotation? this would prevent a future sidecar silently getting IRSA/Pod Identity credentials if it doesnt need it.

    torredil torredil commented on Dec 02, 2026 19:36 UTC
    Reviewer

    /lgtm

    ElijahQuinones ElijahQuinones approved these changes on Dec 02, 2026 19:41 UTC
    Approved Reviewer

    /lgtm +1 to eddies comment on helm-template test

    ConnorJC3 ConnorJC3 commented on code on Dec 02, 2026 19:42 UTC
    Code Review
    charts/aws-ebs-csi-driver/templates/controller.yaml:1
    @@ -32,15 +32,13 @@ spec:
             {{- if .Values.controller.podLabels }}
             {{- toYaml .Values.controller.podLabels | nindent 8 }}
             {{- end }}
    -      {{- if .Values.controller.podAnnotations }}
           annotations:
    -        {{- $annotations := dict }}
    +        {{- $annotations := dict "eks.amazonaws.com/skip-containers" "csi-provisioner,csi-attacher,csi-snapshotter,csi-resizer,volumemodifier,csi-external-health-monitor-controller,liveness-probe" }}

    Not a bad idea, I'll add in rev2

    torredil torredil commented on Dec 03, 2026 16:21 UTC
    Contributor

    /test pull-aws-ebs-csi-driver-test-e2e-external-windows-hostprocess

    Assignees
    ConnorJC3 ConnorJC3
    Labels
    risk: low confidence: 90.8% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 72.1% (HIGH) · Higher = larger blast radius
    72.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 90.8% · Lower = rushed or shallow review
    90.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 6.7% · Safe to merge
    6.7%