Skip to content

Add security context to helm chart #39205

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

Merged

Conversation

Sindvero
Copy link
Contributor

Add security context previously empty, to follow best security practice, for the following components:

  • Cilium agent container and init containers
  • Hubble Relay
  • hubble UI

The components have been running with the updated security contexts for 1+ year now without any issues and with OPA safeguard, in 100+ clusters.

Users can still disable those security contexts if wanted, but by default, I think it should be as contained as possible.

@Sindvero Sindvero requested review from a team as code owners April 28, 2025 12:38
@Sindvero Sindvero requested review from youngnick and squeed April 28, 2025 12:38
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Apr 28, 2025
@github-actions github-actions bot added the kind/community-contribution This was a contribution made by a community member. label Apr 28, 2025
@squeed
Copy link
Contributor

squeed commented Apr 30, 2025

Interesting! It seems reasonable, but this is definitely a deep-in-the-machine change. I'm tagging @cilium/sig-datapath for review, since they know the kernel implications of the RuntimeDefault seccomp profile better than I.

@squeed squeed requested review from a team and gentoo-root and removed request for a team April 30, 2025 16:17
@squeed
Copy link
Contributor

squeed commented Apr 30, 2025

Also, FYI, you need one more automatic update -- see the failed CI job for details.

@Sindvero Sindvero force-pushed the pr/add-default-security-context-cilium-helm branch from 18aa7b9 to 1d8919f Compare May 1, 2025 11:45
@Sindvero Sindvero requested review from a team as code owners May 1, 2025 11:45
@joestringer
Copy link
Member

As far as I understand the "GitHub Workflow Related Checks" issue is fixed by #39398 .

@joestringer joestringer force-pushed the pr/add-default-security-context-cilium-helm branch from 09d9fcd to 47d63d0 Compare May 7, 2025 21:35
@joestringer
Copy link
Member

/test

@joestringer
Copy link
Member

I clicked the "Update with rebase" button and triggered the tests. Let's see the results.

Copy link
Contributor

@youngnick youngnick left a comment

Choose a reason for hiding this comment

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

LGTM as long as we're confident that the CI covers the RuntimeDefault seccomp profile enough to make it the default.

@aanm aanm enabled auto-merge May 8, 2025 09:21
@aanm
Copy link
Member

aanm commented May 8, 2025

/test

…ners

Signed-off-by: Aurelien Benoist <aurelien.larcin@gmail.com>
auto-merge was automatically disabled May 9, 2025 20:46

Head branch was pushed to by a user without write access

@Sindvero Sindvero force-pushed the pr/add-default-security-context-cilium-helm branch from 47d63d0 to 3ef67c8 Compare May 9, 2025 20:46
@Sindvero
Copy link
Contributor Author

Sindvero commented May 9, 2025

I Just rebased to see if that fixes the test ci

@joestringer
Copy link
Member

@Sindvero were you able to triage the results? I'd like to make sure if possible we are looking at the results to see whether there are existing issues filed for them or if they are new to this PR. Otherwise we can end up trapped in a cycle of rebase/retrigger.

@joestringer
Copy link
Member

/test

@Sindvero
Copy link
Contributor Author

Sindvero commented May 9, 2025

@Sindvero were you able to triage the results? I'd like to make sure if possible we are looking at the results to see whether there are existing issues filed for them or if they are new to this PR. Otherwise we can end up trapped in a cycle of rebase/retrigger.

I didn't check the test.

@Sindvero
Copy link
Contributor Author

Looks like it passed the tests it wasn't passing previously. Thanks

@squeed squeed requested a review from aanm May 14, 2025 15:31
@squeed
Copy link
Contributor

squeed commented May 14, 2025

My biggest concern is that the default containerd seccomp profile somehow blocks a syscall we rely on. I ultimately think this is unlikely; it is configured to reject disallowed syscalls with a non-zero errno. Unless there is some seriously yolo code in Cilium, we should be noticing if a given syscall fails.

So this is probably safe to merge, especially since it would have lots of time to "soak" in CI.

@joestringer
Copy link
Member

We had a discussion about this during the Cilium community meeting. Some notes:

  • One of the concerns was that Cilium is not the same as most apps, so the syscalls that Cilium makes may differ from what the default profile may allow. This could represent some risk for Cilium being able to do what it needs to do. We can not directly influence the seccomp profile in use here (other than to revert back to unconfined).
  • The general sense that "if you can lock something down, you should" is a reasonable approach, though it does not take into account the threat model. (Not discussed, but the implication of this point is that this may not represent a real improvement to security)
  • There was a question about whether the CI test environments would highlight issues relating to the seccomp profile, and how those failures may bubble up so that we ensure we see any breakage this might introduce.
  • I got the sense that those present were open to rolling this out in an upcoming release and adjust the approach (opt-in vs opt-out for instance) based on the feedback we get from testing and users.

@aanm
Copy link
Member

aanm commented May 19, 2025

/ci-gke versions=all channel=stable

@aanm aanm added the dont-merge/waiting-for-review Requires further review before merging. label May 19, 2025
@aanm
Copy link
Member

aanm commented May 19, 2025

/ci-gke versions=all

@aanm
Copy link
Member

aanm commented May 19, 2025

/ci-gke channel=extended

@aanm aanm enabled auto-merge May 19, 2025 14:19
@aanm aanm removed the dont-merge/waiting-for-review Requires further review before merging. label May 19, 2025
@aanm aanm added this pull request to the merge queue May 19, 2025
@aanm
Copy link
Member

aanm commented May 19, 2025

/ci-gke versions=all channel=extended

Merged via the queue into cilium:main with commit 40aa39c May 19, 2025
68 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/community-contribution This was a contribution made by a community member. release-note/minor This PR changes functionality that users may find relevant to operating Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants