Skip to content

Fix SCAP Delta Tailoring#13542

Merged
jan-cerny merged 2 commits into
ComplianceAsCode:masterfrom
Mab879:fix_scap_delta_taloring
Jun 6, 2025
Merged

Fix SCAP Delta Tailoring#13542
jan-cerny merged 2 commits into
ComplianceAsCode:masterfrom
Mab879:fix_scap_delta_taloring

Conversation

@Mab879
Copy link
Copy Markdown
Member

@Mab879 Mab879 commented Jun 5, 2025

Description:

Always use build root for delta tailoring.

Rationale:

So we can remove a downstream patch.

Review Hints:

Build -DSSG_BUILD_DISA_DELTA_FILES=ON and not in build. That should expose this bug on master.

@Mab879 Mab879 added this to the 0.1.78 milestone Jun 5, 2025
@Mab879 Mab879 added the Infrastructure Our content build system label Jun 5, 2025
@Mab879 Mab879 force-pushed the fix_scap_delta_taloring branch from f3277c8 to 8de774e Compare June 5, 2025 19:33
@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit 8de774e 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.9% (0.0% change).

View more on Code Climate.

@jan-cerny jan-cerny self-assigned this Jun 6, 2025
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.

On current master I run cmake -DSSG_BUILD_DISA_DELTA_FILES=ON -DSSG_PRODUCT_DEFAULT=OFF -DSSG_PRODUCT_RHEL8=ON .. && make and I experience the following traceback:

Traceback (most recent call last):
  File "/home/jcerny/work/git/scap-security-guide/utils/create_scap_delta_tailoring.py", line 274, in <module>
    main()
    ~~~~^^
  File "/home/jcerny/work/git/scap-security-guide/utils/create_scap_delta_tailoring.py", line 250, in main
    tailoring_root = create_tailoring(args)
  File "/home/jcerny/work/git/scap-security-guide/utils/create_scap_delta_tailoring.py", line 180, in create_tailoring
    profile_root = get_profile(args.product, args.profile)
  File "/home/jcerny/work/git/scap-security-guide/utils/create_scap_delta_tailoring.py", line 28, in get_profile
    ds_root = ET.parse(os.path.join(SSG_ROOT, 'build', 'ssg-{product}-ds.xml'
              ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                    .format(product=product))).getroot()
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/xml/etree/ElementTree.py", line 1204, in parse
    tree.parse(source, parser)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/xml/etree/ElementTree.py", line 558, in parse
    source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/home/jcerny/work/git/scap-security-guide/build/ssg-rhel8-ds.xml'

With this PR I don't experience the trace back any more. I successfully receive a tailoring file in rhel8/tailoring/rhel8_stig_delta_tailoring.xml.

@jan-cerny jan-cerny merged commit 741f7f8 into ComplianceAsCode:master Jun 6, 2025
132 of 133 checks passed
@Mab879 Mab879 deleted the fix_scap_delta_taloring branch June 6, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Infrastructure Our content build system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants