Skip to content

Add new rule file_permissions_sudo#11584

Merged
jan-cerny merged 1 commit into
ComplianceAsCode:masterfrom
Mab879:update_r38
Feb 22, 2024
Merged

Add new rule file_permissions_sudo#11584
jan-cerny merged 1 commit into
ComplianceAsCode:masterfrom
Mab879:update_r38

Conversation

@Mab879
Copy link
Copy Markdown
Member

@Mab879 Mab879 commented Feb 13, 2024

Description:

Add new rule file_permissions_sudo

Rationale:

To cover ANSSI R38

@Mab879 Mab879 added New Rule Issues or pull requests related to new Rules. ANSSI ANSSI Benchmark related. labels Feb 13, 2024
@Mab879 Mab879 added this to the 0.1.73 milestone Feb 13, 2024
@github-actions
Copy link
Copy Markdown

Start a new ephemeral environment with changes proposed in this pull request:

rhel8 (from CTF) Environment (using Fedora as testing environment)
Open in Gitpod

Fedora Testing Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@Mab879
Copy link
Copy Markdown
Member Author

Mab879 commented Feb 13, 2024

/packit retest-failed

@jan-cerny jan-cerny self-assigned this Feb 14, 2024
@jan-cerny
Copy link
Copy Markdown
Collaborator

/packit retest-failed

Comment thread linux_os/guide/system/software/sudo/file_permissions_sudo/rule.yml
@jan-cerny
Copy link
Copy Markdown
Collaborator

@Mab879 Testing farm fail is legit, it fail in the rule file_permissions_sudo in the ANSSI profile. The actual permissions are of /usr/bin/sudo are 4111.

@Mab879
Copy link
Copy Markdown
Member Author

Mab879 commented Feb 15, 2024

/packit retest-failed

@Mab879
Copy link
Copy Markdown
Member Author

Mab879 commented Feb 15, 2024

@Mab879 Testing farm fail is legit, it fail in the rule file_permissions_sudo in the ANSSI profile. The actual permissions are of /usr/bin/sudo are 4111.

So I misread the permissions in ANSSI, they are looking for 4110, but that might not be possible.

name: "file_permissions"
vars:
filepath: "/usr/bin/sudo"
filemode: '4110'
Copy link
Copy Markdown
Collaborator

@jan-cerny jan-cerny Feb 16, 2024

Choose a reason for hiding this comment

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

CI still fails so we will probably need to change it to 4111.

The HTML report from the testing farm https://artifacts.dev.testing-farm.io/ae6aeb0b-5999-4a1d-ad23-2291c000eb50/work-ansible-anssivlxuhmw6/tests/fmf-plans/ansible-anssi/execute/data/guest/default-0/Sanity/ansible-machine-hardening/anssi_bp28_high-1/data/anssi_bp28_high.html indicates that 4111 .

On my machine:

jcerny@fedora:~$ stat -c %a /usr/bin/sudo
4111

But I haven't investigated it further.

title: 'Ensure That the sudo Binary Has the Correct Permissions'

description: |-
{{{ describe_file_permissions("/usr/bin/sudo", "4750") | indent(4) }}}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the value of the permissions will have to be the same as in the template section

@Mab879
Copy link
Copy Markdown
Member Author

Mab879 commented Feb 16, 2024

Moving to 4111 as 4110 doesn't seem possible.

@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit 257bf01 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 58.3% (0.0% change).

View more on Code Climate.

@jan-cerny
Copy link
Copy Markdown
Collaborator

/packit retest-failed

2 similar comments
@jan-cerny
Copy link
Copy Markdown
Collaborator

/packit retest-failed

@jan-cerny
Copy link
Copy Markdown
Collaborator

/packit retest-failed

@jan-cerny
Copy link
Copy Markdown
Collaborator

/packit retest- failed

@jan-cerny
Copy link
Copy Markdown
Collaborator

/packit retest-failed

5 similar comments
@jan-cerny
Copy link
Copy Markdown
Collaborator

/packit retest-failed

@jan-cerny
Copy link
Copy Markdown
Collaborator

/packit retest-failed

@jan-cerny
Copy link
Copy Markdown
Collaborator

/packit retest-failed

@jan-cerny
Copy link
Copy Markdown
Collaborator

/packit retest-failed

@jan-cerny
Copy link
Copy Markdown
Collaborator

/packit retest-failed

@jan-cerny jan-cerny merged commit 570eeb7 into ComplianceAsCode:master Feb 22, 2024
@Mab879 Mab879 deleted the update_r38 branch February 22, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ANSSI ANSSI Benchmark related. New Rule Issues or pull requests related to new Rules.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants