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

Mount separated /tmp, /var/tmp partition with noexec, nodev, nosuid options #519

Closed
wants to merge 2 commits into from

Conversation

syuu1228
Copy link
Contributor

@syuu1228 syuu1228 commented Apr 22, 2024

Mount separated /tmp, /var/tmp partition with apply noexec, nodev, nosuid options.

For /tmp it will use tmpfs.
For /var/tmp, since it's difficult to add separated partition on machine-image,
it will add 1GB loopback image on /vartmpfile, just like /swapfile.
To setup the file, added scylla_var_tmp_setup which is modified version
of scylla_swap_setup.

This will apply following CIS compliance rules:

  • xccdf_org.ssgproject.content_rule_partition_for_tmp
  • xccdf_org.ssgproject.content_rule_mount_option_tmp_nodev
  • xccdf_org.ssgproject.content_rule_mount_option_tmp_noexec
  • xccdf_org.ssgproject.content_rule_mount_option_tmp_nosuid
  • xccdf_org.ssgproject.content_rule_mount_option_var_tmp_nodev
  • xccdf_org.ssgproject.content_rule_mount_option_var_tmp_noexec
  • xccdf_org.ssgproject.content_rule_mount_option_var_tmp_nosuid

Fixes scylladb/scylla-enterprise-machine-image#69
Related https://github.com/scylladb/scylla-pkg/issues/2953

@syuu1228
Copy link
Contributor Author

Note that why this PR does not use tmpfs for /var/tmp is, since applications may expected temporary files on /var/tmp should be preserved between reboots (reference: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard).

@syuu1228
Copy link
Contributor Author

And this is part of: https://github.com/scylladb/scylla-pkg/issues/2953
Since CIS compliance rules says /tmp and /var/tmp mount option should be noexec, nodev, nosuid.

Mount tmpfs for /tmp and apply noexec, nodev, nosuid options.

This will apply following CIS compliance rules:
- xccdf_org.ssgproject.content_rule_partition_for_tmp
- xccdf_org.ssgproject.content_rule_mount_option_tmp_nodev
- xccdf_org.ssgproject.content_rule_mount_option_tmp_noexec
- xccdf_org.ssgproject.content_rule_mount_option_tmp_nosuid

Fixes scylladb/scylla-enterprise-machine-image#69
Related scylladb/scylla-pkg#2953
Mount ext4 for /var/tmp and apply noexec, nodev, nosuid options.
Since it's difficult to add separated partition on machine-image, it
will add 1GB loopback image on /vartmpfile, just like /swapfile.
To setup the file, added scylla_var_tmp_setup which is modified version
of scylla_swap_setup.

This will apply following CIS compliance rules:
- xccdf_org.ssgproject.content_rule_mount_option_var_tmp_nodev
- xccdf_org.ssgproject.content_rule_mount_option_var_tmp_noexec
- xccdf_org.ssgproject.content_rule_mount_option_var_tmp_nosuid

Fixes scylladb/scylla-enterprise-machine-image#69
Related scylladb/scylla-pkg#2953
@syuu1228
Copy link
Contributor Author

BTW, the issue is opened at enterprise version, should we move this to enterprise? Or it's fine to merge OSS version?

@syuu1228
Copy link
Contributor Author

Need to move this to scylla-enterprise-machine-image, closing.

@syuu1228 syuu1228 closed this Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant