Skip to content
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

Validate that containers run as non-root #9640

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

AleksandarSavchev
Copy link
Contributor

How to categorize this PR?

/area security quality
/kind enhancement

What this PR does / why we need it:
This PR enhances the securityContext of pods that already run as non-root with the runAsNonRoot field set to true. This will force the kubelet to validate that the containers in a pod are started with a non-root user.

This PR also modifies fluent-operator to run as nonroot user & group 65532 (id of nonroot user in distroless images ref). Aiming to adhere to the principles of least privilege and reduce potential attack surface.

Which issue(s) this PR fixes:
Fixes #7157

Special notes for your reviewer:

Release note:

Containers, configured to run as `non-root`, are now validated to start with `non-root` user by the `kubelet`.
The `fluent-operator` component now runs as `nonroot` user and group `65532`.

@gardener-prow gardener-prow bot added area/security Security related area/quality Output qualification (tests, checks, scans, automation in general, etc.) related labels Apr 23, 2024
@gardener-prow gardener-prow bot added kind/enhancement Enhancement, improvement, extension cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 23, 2024
@rfranzke
Copy link
Member

/lgtm

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2024
Copy link
Contributor

gardener-prow bot commented Apr 23, 2024

LGTM label has been added.

Git tree hash: 4fcdc376ac633feefd068cd324f2e4d0b7f70eb4

@oliver-goetz
Copy link
Member

Thanks 😄
/approve

Copy link
Contributor

gardener-prow bot commented Apr 24, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: oliver-goetz

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 24, 2024
Copy link
Contributor

gardener-prow bot commented Apr 24, 2024

@AleksandarSavchev: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-gardener-e2e-kind 545d98b link unknown /test pull-gardener-e2e-kind

Full PR test history. Your PR dashboard. Command help for this repository.
Please help us cut down on flakes by linking this test failure to an open flake report or filing a new flake report if you can't find an existing one. Also see our testing guideline for how to avoid and hunt flakes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@gardener-prow gardener-prow bot merged commit 1dfb183 into gardener:master Apr 24, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/quality Output qualification (tests, checks, scans, automation in general, etc.) related area/security Security related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate that containers run as non-root
3 participants