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

feat: add a syscall allow list in the SPOD configuration #913

Merged
merged 12 commits into from
May 3, 2022

Conversation

ccojocar
Copy link
Contributor

@ccojocar ccojocar commented Apr 29, 2022

What type of PR is this?

What this PR does / why we need it:

Add a syscall allow list in the SPOD configuration. This is to allow an administrator to limit cluster-wide the syscalls which are allowed to be defined in the seccomp profiles.

Which issue(s) this PR fixes:

Fixes #897

Does this PR have test?

Yes

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Yes


Add a syscall allow list in the SPOD configuration

@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 29, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @ccojocar. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot requested review from cmurphy and pjbgf April 29, 2022 12:55
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Apr 29, 2022
@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2022

Codecov Report

Merging #913 (40b2d6b) into main (72a0786) will decrease coverage by 0.15%.
The diff coverage is 44.03%.

@@            Coverage Diff             @@
##             main     #913      +/-   ##
==========================================
- Coverage   50.64%   50.49%   -0.16%     
==========================================
  Files          42       42              
  Lines        4626     4735     +109     
==========================================
+ Hits         2343     2391      +48     
- Misses       2198     2259      +61     
  Partials       85       85              

@ccojocar
Copy link
Contributor Author

/test build

@k8s-ci-robot
Copy link
Contributor

@ccojocar: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test build

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.

@JAORMX
Copy link
Contributor

JAORMX commented May 2, 2022

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 2, 2022
@saschagrunert
Copy link
Member

@ccojocar may I ask you to give this one a rebase?

ccojocar added 10 commits May 3, 2022 09:22
…e list of syscalls allowed in seccomp profile

Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
…anged in SPOD

Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
…e profile is in use

Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
@ccojocar ccojocar force-pushed the seccomp-baseline branch from 11421df to 40b2d6b Compare May 3, 2022 07:23
@ccojocar
Copy link
Contributor Author

ccojocar commented May 3, 2022

@saschagrunert All tests passed after rebasing, please could you have a look? Thanks

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

Hm, the code changes look good from what I can see.

Can we add docs to the installation and usage guide to describe the feature? I'm curious how it behaves if we change the allowed syscalls for already deployed profiles (we cannot remove them when they're in usage).

test/tc_allowed_syscalls_test.go Outdated Show resolved Hide resolved
ccojocar added 2 commits May 3, 2022 10:25
Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
Signed-off-by: Cosmin Cojocar <gcojocar@adobe.com>
@ccojocar
Copy link
Contributor Author

ccojocar commented May 3, 2022

Thanks for review @saschagrunert! I added some documentation which explains how to use the allow syscalls list.

I'm curious how it behaves if we change the allowed syscalls for already deployed profiles (we cannot remove them when they're in usage).

There is an e2e test for this, namely testCaseAllowedSyscallsInUse which essentially removes some syscall from the spod config at runtime while one of the non compliant profile is in use. This will result in the operator removing the profile as soon as the pod referencing the profile terminates.

@ccojocar
Copy link
Contributor Author

ccojocar commented May 3, 2022

/test all

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

LGTM

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 3, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ccojocar, saschagrunert

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 3, 2022
@ccojocar
Copy link
Contributor Author

ccojocar commented May 3, 2022

/test all

1 similar comment
@ccojocar
Copy link
Contributor Author

ccojocar commented May 3, 2022

/test all

@k8s-ci-robot k8s-ci-robot merged commit cab2749 into kubernetes-sigs:main May 3, 2022
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforce cluster-wide a security baseline for seccomp profile installation
5 participants