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 CIS hardening rke2-cis-sysctl.conf path #206

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

jLemmings
Copy link
Contributor

Description

The CIS hardening currently expects the file to be at /usr/local/share/rke2/rke2-cis-sysctl.conf but if /usr/local is not writeable it will be at /opt/rke2/share/rke2/rke2-cis-sysctl.conf. This PR simply adds a check if the directory is writeable and adjusts the path accordingly.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Small minor change not affecting the Ansible Role code (GitHub Actions Workflow, Documentation etc.)

How Has This Been Tested?

Tested locally using molecule and RKE2 v1.27.12+rke2r1

tasks/cis.yml Outdated
@@ -15,7 +15,7 @@

- name: Copy systemctl config file for kernel hardening
ansible.builtin.copy:
src: /usr/local/share/rke2/rke2-cis-sysctl.conf
src: "{{ '/usr/local/share/rke2/rke2-cis-sysctl.conf' if usr_local.stat.writeable == True else '/opt/rke2/share/rke2/rke2-cis-sysctl.conf' }}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

please remove trailing white space from the end of the line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed trailing whitespace

@MonolithProjects MonolithProjects self-assigned this Apr 5, 2024
Copy link
Collaborator

@MonolithProjects MonolithProjects left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks

@MonolithProjects MonolithProjects merged commit 232adc3 into lablabs:main Apr 11, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants