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

⚠️ (kustomize/v1,v2): applying restrictive SCC for all containers scaffolded by the tool (k8s versions < 1.19 does not work with) #2700

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented May 25, 2022

Description
(kustomize/v1,v2): applying restrictive SCC for all containers scaffolded by the tool

Note
If applied on clusters < 1.19 the error unknown field "seccompProfile" in io.k8s.api.core.v1.PodSecurityContext will be faced. Users still able to remove the seccompProfile if they need to provide patch releases for old versions

Motivation
Following good practices and ensuring containers are restrictive. (We want to ensure that all scaffold by default is restrictive independently if the cluster-admin enable or not for example SeccompDefault)

Heavily restricted policy, following current Pod hardening best practices."

More info: https://kubernetes.io/docs/concepts/security/pod-security-standards/#restricted

Nice to know: from 1.22 was introduced for the SeccompDefault feature in kubelet, which allows cluster admins also set it for all pods, see: https://kubernetes.io/docs/tutorials/security/seccomp/#enable-the-use-of-runtimedefault-as-the-default-seccomp-profile-for-all-workloads

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 25, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

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 25, 2022
@camilamacedo86 camilamacedo86 changed the title ✨ applying restrictive SCC for all containers scaffolded by the tool WIP: ✨ applying restrictive SCC for all containers scaffolded by the tool May 25, 2022
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 25, 2022
@camilamacedo86
Copy link
Member Author

/retest

@camilamacedo86 camilamacedo86 changed the title WIP: ✨ applying restrictive SCC for all containers scaffolded by the tool ⚠️ sparkles: applying restrictive SCC for all containers scaffolded by the tool (k8s versions < 1.19 does not work with) May 25, 2022
@k8s-ci-robot k8s-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 May 25, 2022
@camilamacedo86 camilamacedo86 changed the title ⚠️ sparkles: applying restrictive SCC for all containers scaffolded by the tool (k8s versions < 1.19 does not work with) ⚠️ (go/v3): applying restrictive SCC for all containers scaffolded by the tool (k8s versions < 1.19 does not work with) May 25, 2022
@camilamacedo86 camilamacedo86 force-pushed the containers-created-with-restrictive branch from 3821225 to 7f34aae Compare May 25, 2022 23:35
@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 26, 2022
@camilamacedo86
Copy link
Member Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 27, 2022
@FillZpp
Copy link

FillZpp commented May 28, 2022

/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 28, 2022
@k8s-ci-robot k8s-ci-robot merged commit 800fdee into kubernetes-sigs:master May 28, 2022
@camilamacedo86 camilamacedo86 deleted the containers-created-with-restrictive branch May 29, 2022 07:03
@camilamacedo86 camilamacedo86 changed the title ⚠️ (go/v3): applying restrictive SCC for all containers scaffolded by the tool (k8s versions < 1.19 does not work with) ⚠️ (kustomize/v1,v2): applying restrictive SCC for all containers scaffolded by the tool (k8s versions < 1.19 does not work with) May 29, 2022
camilamacedo86 pushed a commit to camilamacedo86/operator-sdk that referenced this pull request May 29, 2022
Signed-off-by: Camila Macedo <cmacedo@redhat.com>

- For Golang/Ansible/Helm language-based operators (go/v3, ansible/v1 and helm/v1): applying restrictive SCC for all containers scaffolded by the tool (`k8s versions < 1.19 will no longer work with`). ([More info](kubernetes-sigs/kubebuilder#2700))
- For Golang-based language (go/v2) fix the issue introduced by removing the GO111MODULE=on from Dockerfile. ([More info](kubernetes-sigs/kubebuilder#2678))
- For Golang/Ansible/Helm language-based operators (go/v3, ansible/v1 and helm/v1 language (go/v3), add a new comment with the option `leaderElectionReleaseOnCancel` ((More info)[kubernetes-sigs/kubebuilder#2596])

Only to get the changes from what we currently use in SDK from kubebuilder.

- Ensure that scaffolds begin to be performed with a restrive Security Context
- Be able to do specific follow up PR so we can discuss properly how we will consume the new additions on Kubebuilder
- Make eaiser the process to keep SDK updated, otherwise, it is hard to properly review if we wait to do a big PR with all.
- Ensure that SDK features can work with the latest changes performed in Kubebuilder

**Extra info**
You can check the latest changes on Kubebuilder by looking: kubernetes-sigs/kubebuilder@v3.4.1...master

Note that SDK users Kubebuilder as a LIB. So that all that is currently important is updated by default when we bump. However, all that was added to Kubebuilder but still not imported/used in SDK will not be added here. Therefore we can do follow up PRs to get the additions. Why? we have significant changes and additions for example adding the support for the phase 2 plugin, but if we try to do it all in the same PR it will be very hard to get properly reviewed.
camilamacedo86 pushed a commit to camilamacedo86/operator-sdk that referenced this pull request May 29, 2022
Signed-off-by: Camila Macedo <cmacedo@redhat.com>

- For Golang/Ansible/Helm language-based operators (go/v3, ansible/v1 and helm/v1): applying restrictive SCC for all containers scaffolded by the tool (`k8s versions < 1.19 will no longer work with`). ([More info](kubernetes-sigs/kubebuilder#2700))
- For Golang-based language (go/v2) fix the issue introduced by removing the GO111MODULE=on from Dockerfile. ([More info](kubernetes-sigs/kubebuilder#2678))
- For Golang/Ansible/Helm language-based operators (go/v3, ansible/v1 and helm/v1 language (go/v3), add a new comment with the option `leaderElectionReleaseOnCancel` ((More info)[kubernetes-sigs/kubebuilder#2596])

Only to get the changes from what we currently use in SDK from kubebuilder.

- Ensure that scaffolds begin to be performed with a restrive Security Context
- Be able to do specific follow up PR so we can discuss properly how we will consume the new additions on Kubebuilder
- Make eaiser the process to keep SDK updated, otherwise, it is hard to properly review if we wait to do a big PR with all.
- Ensure that SDK features can work with the latest changes performed in Kubebuilder

**Extra info**
You can check the latest changes on Kubebuilder by looking: kubernetes-sigs/kubebuilder@v3.4.1...master

Note that SDK users Kubebuilder as a LIB. So that all that is currently important is updated by default when we bump. However, all that was added to Kubebuilder but still not imported/used in SDK will not be added here. Therefore we can do follow up PRs to get the additions. Why? we have significant changes and additions for example adding the support for the phase 2 plugin, but if we try to do it all in the same PR it will be very hard to get properly reviewed.
camilamacedo86 pushed a commit to camilamacedo86/operator-sdk that referenced this pull request May 29, 2022
Signed-off-by: Camila Macedo <cmacedo@redhat.com>

- For Golang/Ansible/Helm language-based operators (go/v3, ansible/v1 and helm/v1): applying restrictive SCC for all containers scaffolded by the tool (`k8s versions < 1.19 will no longer work with`). ([More info](kubernetes-sigs/kubebuilder#2700))
- For Golang-based language (go/v2) fix the issue introduced by removing the GO111MODULE=on from Dockerfile. ([More info](kubernetes-sigs/kubebuilder#2678))
- For Golang/Ansible/Helm language-based operators (go/v3, ansible/v1 and helm/v1 language (go/v3), add a new comment with the option `leaderElectionReleaseOnCancel` ((More info)[kubernetes-sigs/kubebuilder#2596])

Only to get the changes from what we currently use in SDK from kubebuilder.

- Ensure that scaffolds begin to be performed with a restrive Security Context
- Be able to do specific follow up PR so we can discuss properly how we will consume the new additions on Kubebuilder
- Make eaiser the process to keep SDK updated, otherwise, it is hard to properly review if we wait to do a big PR with all.
- Ensure that SDK features can work with the latest changes performed in Kubebuilder

**Extra info**
You can check the latest changes on Kubebuilder by looking: kubernetes-sigs/kubebuilder@v3.4.1...master

Note that SDK users Kubebuilder as a LIB. So that all that is currently important is updated by default when we bump. However, all that was added to Kubebuilder but still not imported/used in SDK will not be added here. Therefore we can do follow up PRs to get the additions. Why? we have significant changes and additions for example adding the support for the phase 2 plugin, but if we try to do it all in the same PR it will be very hard to get properly reviewed.
camilamacedo86 pushed a commit to camilamacedo86/operator-sdk that referenced this pull request Jun 7, 2022
Signed-off-by: Camila Macedo <cmacedo@redhat.com>

- For Golang/Ansible/Helm language-based operators (go/v3, ansible/v1 and helm/v1): applying restrictive SCC for all containers scaffolded by the tool (`k8s versions < 1.19 will no longer work with`). ([More info](kubernetes-sigs/kubebuilder#2700))
- For Golang-based language (go/v2) fix the issue introduced by removing the GO111MODULE=on from Dockerfile. ([More info](kubernetes-sigs/kubebuilder#2678))
- For Golang/Ansible/Helm language-based operators (go/v3, ansible/v1 and helm/v1 language (go/v3), add a new comment with the option `leaderElectionReleaseOnCancel` ((More info)[kubernetes-sigs/kubebuilder#2596])

Only to get the changes from what we currently use in SDK from kubebuilder.

- Ensure that scaffolds begin to be performed with a restrive Security Context
- Be able to do specific follow up PR so we can discuss properly how we will consume the new additions on Kubebuilder
- Make eaiser the process to keep SDK updated, otherwise, it is hard to properly review if we wait to do a big PR with all.
- Ensure that SDK features can work with the latest changes performed in Kubebuilder

**Extra info**
You can check the latest changes on Kubebuilder by looking: kubernetes-sigs/kubebuilder@v3.4.1...master

Note that SDK users Kubebuilder as a LIB. So that all that is currently important is updated by default when we bump. However, all that was added to Kubebuilder but still not imported/used in SDK will not be added here. Therefore we can do follow up PRs to get the additions. Why? we have significant changes and additions for example adding the support for the phase 2 plugin, but if we try to do it all in the same PR it will be very hard to get properly reviewed.
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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants