Skip to content

Fix "unknown predicate -L"#12305

Merged
jan-cerny merged 1 commit into
ComplianceAsCode:masterfrom
alanmcanonical:fix_owner
Aug 16, 2024
Merged

Fix "unknown predicate -L"#12305
jan-cerny merged 1 commit into
ComplianceAsCode:masterfrom
alanmcanonical:fix_owner

Conversation

@alanmcanonical
Copy link
Copy Markdown
Contributor

@alanmcanonical alanmcanonical commented Aug 15, 2024

Description:

  • Avoid potential conflict flag of -H and -L
  • Fix "unknown predicate -L"

Rationale:

  • When I test file_ownership_audit_configuration rule in stig profile on Ubuntu2204, error occurs:
Remediating rule 1/1: 'xccdf_org.ssgproject.content_rule_file_ownership_audit_configuration'
+ '[' '!' -f /.dockerenv ']'
+ '[' '!' -f /run/.containerenv ']'
+ grep -q installed
+ dpkg-query --show '--showformat=${db:Status-Status}\n' auditd
+ find /etc/audit/ -maxdepth 1 -L -type f '!' -uid 0 -regextype posix-extended -regex '^.*audit(\.rules|d\.conf)$' -exec chown -L 0 '{}' ';'
find: unknown predicate `-L'
+ find /etc/audit/rules.d/ -maxdepth 1 -L -type f '!' -uid 0 -regextype posix-extended -regex '^.*\.rules$' -exec chown -L 0 '{}' ';'
find: unknown predicate `-L'

ERROR - The remediation failed for rule 'xccdf_org.ssgproject.content_rule_file_ownership_audit_configuration'.
INFO - Script correct_owner.pass.sh using profile xccdf_org.ssgproject.content_profile_stig OK

According to the man find manual:
The five `real' options -H, -L, -P, -D and -O must appear before the first path name, if at all.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Aug 15, 2024

Hi @alanmcanonical. Thanks for your PR.

I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci Bot added the needs-ok-to-test Used by openshift-ci bot. label Aug 15, 2024
@github-actions
Copy link
Copy Markdown

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

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 15, 2024

🤖 A k8s content image for this PR is available at:
ghcr.io/complianceascode/k8scontent:12305
This image was built from commit: 36b57d1

Click here to see how to deploy it

If you alread have Compliance Operator deployed:
utils/build_ds_container.py -i ghcr.io/complianceascode/k8scontent:12305

Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and:
CONTENT_IMAGE=ghcr.io/complianceascode/k8scontent:12305 make deploy-local

Avoid potential conflict flag of -H and -L
@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit 36b57d1 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 59.4% (0.0% change).

View more on Code Climate.

@dodys dodys requested a review from Mab879 August 15, 2024 11:25
@Mab879 Mab879 added this to the 0.1.75 milestone Aug 15, 2024
@Mab879 Mab879 added the Bash Bash remediation update. label Aug 15, 2024
@jan-cerny jan-cerny self-assigned this Aug 16, 2024
Copy link
Copy Markdown
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.

LGTM

@jan-cerny jan-cerny merged commit 0a687f7 into ComplianceAsCode:master Aug 16, 2024
@alanmcanonical alanmcanonical changed the title Fix "unknown predicate `-L'" Fix "unknown predicate -L" Aug 26, 2024
@alanmcanonical alanmcanonical deleted the fix_owner branch April 24, 2025 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bash Bash remediation update. needs-ok-to-test Used by openshift-ci bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants