Skip to content

tmp.mount.j2 invalid options #525

Description

@I-am-MoS

Have you checked ReadtheDocs?: yes

Describe the Issue
From v3 to v4 the tmp.mount.j2 file switched from the format of:

Options=mode=1777,strictatime,{% if rhel8cis_rule_1_1_2_1_2 %}nodev,{% endif %}{% if rhel8cis_rule_1_1_2_1_3 %}nosuid,{% endif %}{% if rhel8cis_rule_1_1_2_1_4 %}noexec{% endif %}

to:

Options: "{{ mount_point_fs_and_options[mount_point]['options'] | unique | join(',') }}"

First issue was mount_point_fs_and_options is undefined, I found though prelim_mount_point_fs_and_options.
Second issue, this format results in the following in the unit file: Options: "rw,nosuid,nodev,seclabel" This is not proper syntax.

Expected Behavior
To proper set the tmp.mount unit file with : Options=mode=1777,strictatime,nodev,nosuid,noexec

Actual Behavior
Creates unit file with : Options: "rw,nosuid,nodev,seclabel"

I am unsure if the initial problem is missing something to create the variable and should not use prelim_ in the var, or just somehow this was fully overlooked as an issue (seems every CIS release the tmp.mount.j2 has issues with using the old variable numbers until and update comes out)

Possible Solution
Move back to the old format:

Options=mode=1777,strictatime,{% if rhel8cis_rule_1_1_2_1_2 %}nodev,{% endif %}{% if rhel8cis_rule_1_1_2_1_3 %}nosuid,{% endif %}{% if rhel8cis_rule_1_1_2_1_4 %}noexec{% endif %}

Even the newer RHEL10 codebase uses this format.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions