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

Fix thin data streams with SCE #12503

Merged
merged 2 commits into from
Oct 16, 2024
Merged

Conversation

jan-cerny
Copy link
Collaborator

Description:

Fixes broken build of thin data streams when SCE is enabled.

Addressing:

$ ADDITIONAL_CMAKE_OPTIONS=-DSSG_SCE_ENABLED=ON ./build_product rhel9 --thin

...

Traceback (most recent call last):
  File "/home/jcerny/work/git/scap-security-guide/build-scripts/compose_ds.py", line 319, in <module>
    _compose_multiple_ds(args)
  File "/home/jcerny/work/git/scap-security-guide/build-scripts/compose_ds.py", line 303, in _compose_multiple_ds
    ds = compose_ds(
         ^^^^^^^^^^^
  File "/home/jcerny/work/git/scap-security-guide/build-scripts/compose_ds.py", line 263, in compose_ds
    embed_sce_checks_in_datastream(ds_collection, checklists, sce_check_files, refdir)
  File "/home/jcerny/work/git/scap-security-guide/build-scripts/compose_ds.py", line 41, in embed_sce_checks_in_datastream
    with open(path, 'rt', encoding='utf8') as fd:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/jcerny/work/git/scap-security-guide/build/rhel9/thin_ds_components/rhel9/checks/sce/apparmor_configured.sh'

Rationale:

Fixes a long standing bug in build system. This bug wasn't noticed but it would block us from enabling SCE by default. Therefore this PR blocks #12488.

Review Hints:

Run this before and after this change.

ADDITIONAL_CMAKE_OPTIONS=-DSSG_SCE_ENABLED=ON ./build_product rhel9 --thin
  1. Verify that the ssg-build-rhel9-ds.xml contains the extended-component elements.
  2. Verify that the thin data streams for rules that now contain SCE contain the extended-component element, eg. build/thin_ds/ssg-rhel9-ds_service_abrtd_disabled.xml.

Fixes broken build of thin data streams when SCE is enabled.

Addressing:

$ ADDITIONAL_CMAKE_OPTIONS=-DSSG_SCE_ENABLED=ON ./build_product rhel9 --thin
...
Traceback (most recent call last):
  File "/home/jcerny/work/git/scap-security-guide/build-scripts/compose_ds.py", line 319, in <module>
    _compose_multiple_ds(args)
  File "/home/jcerny/work/git/scap-security-guide/build-scripts/compose_ds.py", line 303, in _compose_multiple_ds
    ds = compose_ds(
         ^^^^^^^^^^^
  File "/home/jcerny/work/git/scap-security-guide/build-scripts/compose_ds.py", line 263, in compose_ds
    embed_sce_checks_in_datastream(ds_collection, checklists, sce_check_files, refdir)
  File "/home/jcerny/work/git/scap-security-guide/build-scripts/compose_ds.py", line 41, in embed_sce_checks_in_datastream
    with open(path, 'rt', encoding='utf8') as fd:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/jcerny/work/git/scap-security-guide/build/rhel9/thin_ds_components/rhel9/checks/sce/apparmor_configured.sh'
@jan-cerny jan-cerny added Infrastructure Our content build system Image Mode Bootable containers and Image Mode RHEL labels Oct 16, 2024
Copy link

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

Fedora Environment
Open in Gitpod

Oracle Linux 8 Environment
Open in Gitpod

Copy link

codeclimate bot commented Oct 16, 2024

Code Climate has analyzed commit f70ee66 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 61.0% (0.0% change).

View more on Code Climate.

@Mab879 Mab879 self-assigned this Oct 16, 2024
@Mab879 Mab879 added this to the 0.1.75 milestone Oct 16, 2024
Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

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

Waving the automatus test as it isn't related to this PR.

Thanks!

@Mab879 Mab879 merged commit 5ae631c into ComplianceAsCode:master Oct 16, 2024
103 of 104 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 Infrastructure Our content build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants