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

CB-21583 CIS: Use tmpfs for /tmp #829

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

CB-21583 CIS: Use tmpfs for /tmp #829

wants to merge 1 commit into from

Conversation

Bajzathd
Copy link
Contributor

No description provided.

@Bajzathd Bajzathd requested a review from a team as a code owner June 12, 2023 09:31
@@ -558,6 +558,13 @@ dev_shm_noexec:
dev_shm_remount:
cmd.run:
- name: 'sudo mount -o remount,noexec,nodev,nosuid /dev/shm'
#1.1.2 Ensure /tmp is configured
Copy link
Contributor

Choose a reason for hiding this comment

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

@lajosrodek @lacikaaa I'd like to ask for your opinion here. Setting this up IS required for CIS compliance, however I'm a bit concerned about performance implications. By default the tmpfs can eat up as much as half of the available RAM, not considering swap, possibly forcing the OS to make some services to rely on swap. Do you consider this dangerous? If so, how would you reduce the chance for problems? I'm thinking about something like limiting tmpfs max size to only a few gigs, etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

we definitely should limit the size. The issue might be that we have to decide the size during image burning, while a wide range of instance types could be used. So I would check the smallest one which is used, and try to size it based on that. I don't think we can allow more than 2-3GB. The question is if it's enough

Copy link
Contributor

Choose a reason for hiding this comment

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

side note: it's your territory, but I'm not a fan of this single cis file. While it keeps everything cis related in one place, most of the settings would fit into already existing states. Eg I would think mount or storage (I don't know why the latter exists) be a better place for this, as I would expect all filesystem mount logic to be placed there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue might be that we have to decide the size during image burning

We could also move the sizing step to the user data script

I would check the smallest one which is used

I've found we support AWS c1.medium instance type which has 1,7GB memory and also c5.24xlarge with 192GB memory so a fixed value does not seem reasonable, maybe a fixed percentage lower than the default 50%?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lacikaaa we discussed with @TheTinkerDad that 30% would seem sufficient, do you agree?

Copy link
Contributor

Choose a reason for hiding this comment

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

we could try, as I think we don't have any data on prod memory usage ATM, but we might want to notify QE about this change

@Bajzathd Bajzathd marked this pull request as draft June 21, 2023 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants