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

Fix the kube-bench 1.1.19 to enhance security #9937

Merged
merged 1 commit into from
Mar 29, 2023

Conversation

yankay
Copy link
Member

@yankay yankay commented Mar 28, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

Fix kube-bench check Fail 1.1.19
Ref to https://github.com/aquasecurity/kube-bench/blob/main/cfg/cis-1.24/master.yaml#L268

Which issue(s) this PR fixes:

Fixes #9933

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Fix kube-bench 1.1.19 to enhance security (Change Kubernetes Cert directory and file ownership is set to root:root)

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 28, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yankay

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 Mar 28, 2023
- "{{ kube_manifest_dir }}"
- "{{ kube_script_dir }}"
- "{{ kubelet_flexvolumes_plugins_dir }}"

- name: Create kubernetes cert directories
Copy link
Member

Choose a reason for hiding this comment

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

Hmm I think the "Create other directories" task just below also do that, maybe it should be created there?

Copy link
Contributor

Choose a reason for hiding this comment

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

That is a nice point.
We just need to move {{ kube_cert_dir }} into the existing Create other directories task.
It is better to rename the Create other directories task to Create other directories of root owner or something to clarify what is different from Create kubernetes directories task.

Copy link
Contributor

@oomichi oomichi left a comment

Choose a reason for hiding this comment

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

/cc @oomichi

- "{{ kube_manifest_dir }}"
- "{{ kube_script_dir }}"
- "{{ kubelet_flexvolumes_plugins_dir }}"

- name: Create kubernetes cert directories
Copy link
Contributor

Choose a reason for hiding this comment

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

That is a nice point.
We just need to move {{ kube_cert_dir }} into the existing Create other directories task.
It is better to rename the Create other directories task to Create other directories of root owner or something to clarify what is different from Create kubernetes directories task.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 29, 2023
@yankay
Copy link
Member Author

yankay commented Mar 29, 2023

Thanks @oomichi @MrFreezeex , it has been changed :-)

@oomichi
Copy link
Contributor

oomichi commented Mar 29, 2023

Thanks for updating.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 29, 2023
@k8s-ci-robot k8s-ci-robot merged commit 19856cf into kubernetes-sigs:master Mar 29, 2023
@floryut floryut added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 29, 2023
@yankay yankay mentioned this pull request May 15, 2023
pedro-peter pushed a commit to pedro-peter/kubespray that referenced this pull request May 8, 2024
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. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kube-bench some checks FAIL
5 participants