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

Remediate does not work if called separately from eval cmd #2138

Open
StevenYGui opened this issue Jul 18, 2024 · 1 comment
Open

Remediate does not work if called separately from eval cmd #2138

StevenYGui opened this issue Jul 18, 2024 · 1 comment

Comments

@StevenYGui
Copy link

StevenYGui commented Jul 18, 2024

Thanks!

Description of Problem:

if I type cmd as below, fail items can be fixed correctly.
# oscap xccdf eval --remediate --profile xccdf_org.ssgproject.content_profile_standard --results scan_results.xml ssg-xxx-ds.xml
image

but if I seperate it into 2 cmds as below, fix will fail.
# oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_standard --results scan_results.xml ssg-xxx-ds.xml
image

# oscap xccdf remediate scan_results.xml
image

So, what's the mistake in my cmd?

OpenSCAP Version:

1.3.9

Operating System & Version:

Steps to Reproduce:

Actual Results:

Expected Results:

Additional Information / Debugging Steps:

@jan-cerny jan-cerny changed the title it seems that remediate is not work if I call it seperated from eval cmd Remediate does not work if called separately from eval cmd Aug 2, 2024
@jan-cerny
Copy link
Member

I have investigated this issue. I have found that we have a bug related to CPE applicability of fixes. The remediation isn't performed because the fix is resolved as not applicable. Internally, it can't find any applicable fix. But, the XCCDF results file doesn't contain CPE definitions or CPE dictionaries, so it can't resolve the applicability.

Unfortunately, the oscap xccdf remediate module doesn't consume ARFs.

I'm not sure about how we can fix it. We can replace the call of _filter_fixes_by_applicability in src/XCCDF_POLICY/xccdf_policy_remediate.c in _find_suitable_fix by _get_fixes, which is a function that doesn't check CPE applicability. But this change would make the assertions in tests/API/XCCDF/applicability/test_remediate_fix_notapplicable.sh invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants