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

add new rule audit_rules_immutable_login_uids #10070

Merged

Conversation

vojtapolasek
Copy link
Collaborator

Description:

  • add new rule including OVAL, Bash, Ansible
  • add rule to RHEL8 STIG profile

Rationale:

Review Hints:

  • Review hints here. Replace this text. Don't use the italics format!

  • Use this optional section to give any relevant information which could help the reviewer to more quickly and assertively understand and test the changes.

  • Good examples are useful commands, if it is better to review all commits together or in a suggested sequence, any relevant discussion in other PRs or issues, etc.

@vojtapolasek vojtapolasek added New Rule Issues or pull requests related to new Rules. RHEL8 Red Hat Enterprise Linux 8 product related. STIG STIG Benchmark related. labels Jan 17, 2023
@vojtapolasek vojtapolasek added this to the 0.1.66 milestone Jan 17, 2023
@vojtapolasek vojtapolasek requested a review from a team as a code owner January 17, 2023 11:02
@github-actions
Copy link

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

@jan-cerny jan-cerny self-assigned this Jan 17, 2023
immutable_found=0
for f in /etc/audit/rules.d/*.rules; do
if grep -q '^\s*--loginuid-immutable\s*$' $f; then
immutable_found=1
Copy link
Collaborator

Choose a reason for hiding this comment

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

indentation

fi
else
immutable_found=0
for f in /etc/audit/rules.d/*.rules; do
Copy link
Collaborator

Choose a reason for hiding this comment

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

what if there is no .rules file in this directory?

else
immutable_found=0
for f in /etc/audit/rules.d/*.rules; do
if grep -q '^\s*--loginuid-immutable\s*$' $f; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

quote $f

fix indentation
replace file loop with something more robust, taking advice of Shellcheck
quoting the variable name
@vojtapolasek
Copy link
Collaborator Author

@jan-cerny feedback addressed in 2b8bf7e

@codeclimate
Copy link

codeclimate bot commented Jan 17, 2023

Code Climate has analyzed commit 2b8bf7e 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 49.7% (0.0% change).

View more on Code Climate.

Copy link
Collaborator

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

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

I have checked that the supplied test scenarios have passed in the Automatus CS8 job in CI.

@jan-cerny jan-cerny merged commit 0840355 into ComplianceAsCode:master Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Rule Issues or pull requests related to new Rules. RHEL8 Red Hat Enterprise Linux 8 product related. STIG STIG Benchmark related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants