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

Change seccomp default to 'docker/default' #39845

Closed
timstclair opened this issue Jan 13, 2017 · 31 comments · Fixed by #62662, #62671 or #62756
Closed

Change seccomp default to 'docker/default' #39845

timstclair opened this issue Jan 13, 2017 · 31 comments · Fixed by #62662, #62671 or #62756
Labels
area/security lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/node Categorizes an issue or PR as relevant to SIG Node.

Comments

@timstclair
Copy link

Seccomp is currently defaulted to unconfined on docker:

defaultSeccompOpt = []dockerOpt{{"seccomp", "unconfined", ""}}

I believe this is for historical reasons, from #21790. However, we now have the ability (albeit alpha) to control seccomp profiles, so we should change the default to the more secure docker/default option. This profile is carefully curated, and should provide enhanced security without breaking the majority of users. Unfortunately "the majority" is not "everybody", so changing this default would be a breaking change, and care needs to be taken when rolling it out.

This may also need to wait for seccomp to be promoted to beta.

@vishh @pmorie @kubernetes/sig-node-misc

@timstclair timstclair added area/security sig/node Categorizes an issue or PR as relevant to SIG Node. labels Jan 13, 2017
@jessfraz
Copy link
Contributor

fwiw when we launched it with docker i tested all the publically available dockerfiles on github and docker hub with it...

so it was not done without much testing, we also only had one issue iirc after the release which was a lot better than i expected.

@vishh
Copy link
Member

vishh commented Feb 14, 2017 via email

@jessfs
Copy link

jessfs commented Feb 14, 2017

Just want to add my +1 for making this the default.

@timstclair
Copy link
Author

We might have to develop some tooling to make it easy to consume this
feature in k8s. The current approach of storing profiles on node's root
partition is complicated.

Agreed, I consider this alpha-behavior. For both seccomp & apparmor I'd like to add the ability to consume a ConfigMap (or maybe a new resource) as a profile. However, I consider this tangential to the issue discussed here.

Adjusting the default is already supported through the PodSecurityPolicy, but we still need to put some thought into how we'd go about rolling this out.

@jessfraz
Copy link
Contributor

So there are a few ways I can imagine going about this, happy to open a proposal if you if agree with any:

  1. defaulting to docker/default
  2. forking the docker/default and maintaining our own default so we can edit easily in the future (i'm happy to do this since I wrote a lot of the docker default)
  3. (2) might require making our own "seccomp profile spec" and adding as an api somewhere (idk which group) if we don't want to rely on another runtime's.
  4. an option to set a different default maybe as a kubelet config option (also might require 3 unless we just default to another runtimes)

I am kinda in favor of 2, 3, and 4 so we have the most control.

@timstclair
Copy link
Author

2,3 sound good to me. I think we can do (2) before fully implementing (3), since it's technically still an "alpha" feature. I think we should use the OCI spec, but I don't know the details on it. (4) is essentially already implemented on the PodSecurityPolicy, via an annotation (should graduate to a field before seccomp support goes to beta): "seccomp.security.alpha.kubernetes.io/defaultProfileName" (see https://github.com/kubernetes/kubernetes/blob/master/pkg/security/podsecuritypolicy/seccomp/strategy.go)

@jessfraz
Copy link
Contributor

jessfraz commented May 22, 2017

(4) is essentially already implemented on the PodSecurityPolicy, via an annotation

makes sense

I think we should use the OCI spec, but I don't know the details on it

Should we use theirs as a base and make our own or vendor theirs (ie what happens if they change theirs)

@timstclair
Copy link
Author

Should we use theirs as a base and make our own or vendor theirs (ie what happens if they change theirs)

That's a question for @kubernetes/sig-api-machinery-misc, but my hunch is that we create our own copy (rather than vendoring), since I don't think we have any other examples of embedding a third party API in ours (unless it's opaque)

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label May 22, 2017
@jessfraz
Copy link
Contributor

jessfraz commented May 22, 2017 via email

@jessfraz
Copy link
Contributor

jessfraz commented May 24, 2017 via email

@DjangoPeng
Copy link
Contributor

@jessfraz So can we use the default profile to set seccomp as docker/default now?

@feiskyer
Copy link
Member

I think we should spec the seccomp format first, refer #39128. or else, other container runtimes couldn't know how to process docker/default.

@jessfraz
Copy link
Contributor

jessfraz commented May 25, 2017 via email

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 25, 2017
@justincormack
Copy link
Contributor

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 9, 2018
@dims
Copy link
Member

dims commented Jan 9, 2018

discussion on seccomp format is here : #52827

@liggitt
Copy link
Member

liggitt commented Jan 9, 2018

not sure a docker-specific seccomp name is good as a default

@tallclair tallclair removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Feb 23, 2018
@tallclair
Copy link
Member

/assign @wangzhen127

@k8s-ci-robot
Copy link
Contributor

@tallclair: GitHub didn't allow me to assign the following users: wangzhen127.

Note that only kubernetes members and repo collaborators can be assigned.

In response to this:

/assign @wangzhen127

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
Copy link
Contributor

@wangzhen127: you can't re-open an issue/PR unless you authored it or you are assigned to it.

In response to this:

/reopen

There is followup work.

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-github-robot pushed a commit that referenced this issue May 17, 2018
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use 'docker/default' as default seccomp profile for unprivileged PodSecurityPolicy

**What this PR does / why we need it**:
This PR sets the default seccomp profile for unprivileged PodSecurityPolicy to 'docker/default'. This PR is a followup of [#62662](#62662). We are using 'docker/default' instead of 'runtime/default' in addons in order to handle node version skew. When default seccomp profile is applied later, we can remove those annotations.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #39845

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
grayluck pushed a commit to grayluck/kubernetes that referenced this issue May 24, 2018
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use default seccomp profile for unprivileged addons

**What this PR does / why we need it**:
This PR sets the default seccomp profile of unprivileged addons to 'docker/default'. This PR is a followup of [kubernetes#62662](kubernetes#62662) and [kubernetes#62671](kubernetes#62671). We are using 'docker/default' instead of 'runtime/default' in addons in order to handle node version skew. When seccomp profile is applied automatically by default later, we can remove those annotations.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes#39845

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
k8s-github-robot pushed a commit that referenced this issue May 25, 2018
Automatic merge from submit-queue (batch tested with PRs 61963, 64279, 64130, 64125, 64049). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use default seccomp profile for DNS addons.

**What this PR does / why we need it**:
This PR sets the default seccomp profile of DNS addons to 'docker/default'. This PR is a followup of #62662. We are using 'docker/default' instead of 'runtime/default' in addons in order to handle node version skew. When seccomp profile is applied automatically by default later, we can remove those annotations.

This is PR is part of #39845.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
k8s-github-robot pushed a commit that referenced this issue May 30, 2018
Automatic merge from submit-queue (batch tested with PRs 64281, 62991). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use default seccomp profile for flutend-elasticsearch addons

**What this PR does / why we need it**:
This PR sets the default seccomp profile to 'docker/default' for:
- fluentd-es daemon set.
- kibana-logging deployment.

The elasticsearch-logging stateful set is still unconfined because it uses gce:podsecuritypolicy:privileged.

This PR is a followup of #62662. We are using 'docker/default' instead of 'runtime/default' in addons in order to handle node version skew. When seccomp profile is applied automatically by default later, we can remove those annotations.

This is PR is part of #39845.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
dims pushed a commit to dims/kubernetes that referenced this issue Jun 5, 2018
Automatic merge from submit-queue (batch tested with PRs 64276, 64094, 64719, 64766, 64750). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use default seccomp profile for GCE manifests

**What this PR does / why we need it**:
This PR sets the default seccomp profile of unprivileged addons to 'docker/default' for GCE manifests. This PR is a followup of kubernetes#62662. We are using 'docker/default' instead of 'runtime/default' in addons in order to handle node version skew. When seccomp profile is applied automatically by default later, we can remove those annotations.

This is PR is part of kubernetes#39845.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
@tallclair tallclair reopened this Jun 7, 2018
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 5, 2018
@RRAlex
Copy link

RRAlex commented Sep 18, 2018

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 18, 2018
@jesseendahl
Copy link

What's blocking this from happening at this point? cc @mayakacz @destijl

@dims
Copy link
Member

dims commented Sep 19, 2018

long-term-issue (note to self)

@tallclair
Copy link
Member

What's blocking this from happening at this point?

Generally, the fact that this a breaking change, and it's very hard to get breaking changes into Kubernetes these days, especially something that is hard to get visibility into.

Other issues are that this is still an "alpha" feature, but predates feature gates, so it's an alpha feature that's enabled in every cluster. Before changing the default, we probably need to promote the feature to GA, which includes:

  1. Migrating the annotation to a pod field
  2. Improving the profile management, so that profiles can be written as configmaps or k8s resources, and loaded by the node from there.
  3. Create Kubernetes standard profiles, which can eventually be made the default (can be a copy of the docker default)

And possibly:

  1. Create a tool for running seccomp in an "audit only" mode to capture any violations before potentially breaking workloads.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 18, 2018
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 17, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/security lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/node Categorizes an issue or PR as relevant to SIG Node.
Projects
None yet