Skip to content

Exit oscap-im if oscap fails #2222

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

Merged
merged 3 commits into from
Apr 16, 2025
Merged

Conversation

jan-cerny
Copy link
Member

This commit will cause that oscap-im will exit with exit code 1 if any of the called oscap calls will fail. This means that building hardened bootable container images will terminate if oscap crashes or doesn't work.

Resolves: https://issues.redhat.com/browse/OPENSCAP-5415

This commit will cause that oscap-im will exit with exit code 1 if any
of the called oscap calls will fail. This means that building hardened
bootable container images will terminate if oscap crashes or doesn't
work.

Resolves: https://issues.redhat.com/browse/OPENSCAP-5415
@jan-cerny jan-cerny added the Image Mode Bootable containers and Image Mode RHEL label Apr 15, 2025
Move the calls into `with` statement so that manual cleanup won't
be needed. Also, do not catch output of the bash remediation
to let the user watch the progress of the script.
@jan-cerny
Copy link
Member Author

I have changed the function pre_scan_fix according to the review

@jan-cerny jan-cerny added this to the 1.3.12 milestone Apr 15, 2025
We can remove it because the statements that use the temporary file
were moved inside the "with" block.
@matusmarhefka matusmarhefka self-assigned this Apr 16, 2025
@jan-cerny
Copy link
Member Author

I have removed delete=False

@matusmarhefka
Copy link
Member

I have tested the changes and it works as expected, thanks!

@matusmarhefka matusmarhefka merged commit e53df1e into OpenSCAP:maint-1.3 Apr 16, 2025
7 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Image Mode Bootable containers and Image Mode RHEL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants