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

introduce seccomp override empty #4212

Merged
merged 1 commit into from Oct 20, 2020

Conversation

haircommander
Copy link
Member

What type of PR is this?

/kind feature

/kind flake

What this PR does / why we need it:

right now, the CRI defaults to an unconfined profile when it's set to empty
However, it's possible admins want the behavior to default to the default profile instead.

add a knob to allow admins to override the empty behavior from unconfined to the default
Note, when set this technically makes CRI-O not CRI compliant, but for increased security, it's worth it.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Add option `seccomp_override_empty` to override an unspecified seccomp profile from being unconfined to being the runtime default. Note: setting this option makes CRI-O not fully CRI compliant, but does increase security. 

@openshift-ci-robot openshift-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Sep 18, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 18, 2020
@codecov
Copy link

codecov bot commented Sep 18, 2020

Codecov Report

Merging #4212 into master will decrease coverage by 0.05%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #4212      +/-   ##
==========================================
- Coverage   38.59%   38.53%   -0.06%     
==========================================
  Files         111      111              
  Lines        8893     8906      +13     
==========================================
  Hits         3432     3432              
- Misses       5077     5089      +12     
- Partials      384      385       +1     

@haircommander haircommander changed the title WIP: introduce seccomp override WIP: introduce seccomp override empty Sep 18, 2020
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 23, 2020
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 2, 2020
@haircommander haircommander changed the title WIP: introduce seccomp override empty introduce seccomp override empty Oct 2, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 2, 2020
@haircommander
Copy link
Member Author

dropped the WIP commits, added an integration test

@haircommander
Copy link
Member Author

/retest

@haircommander haircommander force-pushed the seccomp-override branch 2 times, most recently from b6c66ac to 3ad839b Compare October 2, 2020 18:58
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.

Do we have a chance to change the default in Kubernetes when graduating the CRI?

@haircommander
Copy link
Member Author

Do we have a chance to change the default in Kubernetes when graduating the CRI?

Possibly, when is seccomp going to be GA? possibly then as well. The issue is, unless either of those make 1.20 and also update the default, users won't get it for a while. If upstream k8s changes the default, we can go to that and drop this option. Until then, I think it's something admins should be given the choice for

Copy link
Collaborator

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

Perpaps something like this instead?

--seccomp-empty=[unconfined|default]

Changes the meaning of an empty seccomp profile. By default
(and according to CRI spec), empty profile means unconfined.
This option allows to treat an empty profile as default profile,
which might increase security.

Overall, though, it's too complicated (== semantically overloaded) either way (yours or mine).

@kolyshkin
Copy link
Collaborator

OK, one more alternative is boolean's --seccomp-treat-empty-as-default, which makes more sense for bool but it's still somewhat cumbersome.

@haircommander
Copy link
Member Author

what about --seccomp-use-default-when-empty still verbose but definitely a clear boolean value

@haircommander
Copy link
Member Author

Perpaps something like this instead?

--seccomp-empty=[unconfined|default]

Changes the meaning of an empty seccomp profile. By default
(and according to CRI spec), empty profile means unconfined.
This option allows to treat an empty profile as default profile,
which might increase security.

Overall, though, it's too complicated (== semantically overloaded) either way (yours or mine).

I like this verbiage, but it's pretty verbose for help text, I'll add it to the config text though

@haircommander haircommander force-pushed the seccomp-override branch 2 times, most recently from f8308ed to 4076033 Compare October 12, 2020 20:10
right now, the CRI defaults to an unconfined profile when it's set to empty.
However, it's possible admins want the behavior to default to the default profile instead.

Add a knob to allow admins to override the empty behavior from unconfined to the default.
Note, when set this technically makes CRI-O not CRI compliant, but for increased security, it's worth it.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
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

Copy link
Collaborator

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

The test case needs a revamp but AFAIK @wgahnagl is working on this one, so she can cover this, too.

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: haircommander, kolyshkin, mrunalp, 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:
  • OWNERS [haircommander,mrunalp,saschagrunert]

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

@mrunalp
Copy link
Member

mrunalp commented Oct 20, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 20, 2020
@openshift-merge-robot openshift-merge-robot merged commit 5a94528 into cri-o:master Oct 20, 2020
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants