Skip to content

Ensure that there is only one customizations in blueprint remedations - #2444

Merged
jan-cerny merged 1 commit into
OpenSCAP:mainfrom
Mab879:fix_customizations_regression_main
Oct 9, 2026
Merged

jan-cerny merged 1 commit into
OpenSCAP:mainfrom
Mab879:fix_customizations_regression_main

Conversation

@Mab879

@Mab879 Mab879 commented Oct 8, 2026

Copy link
Copy Markdown
Member

Also ensure that [customizations] is before any sub sections as to better follow the TOML spec.

Before this commit if rule added a [customizations] section there would be two [customizations] section thus causing an error. An example of such a rule is enabling fips.

Assisted by: OpenCode using OpenAI models and Claude Code

Also ensure that `[customizations]` is before any sub sections as
to better follow the TOML spec.

Before this commit if rule added a `[customizations]` section there
would be two `[customizations]` section thus causing an error.
An example of such a rule is enabling fips.

Assisted by: OpenCode using OpenAI models and Claude Code
@Mab879 Mab879 added this to the 1.4.5 milestone Oct 8, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

@Mab879 Mab879 changed the title Ensure that there is only one customizations Ensure that there is only one customizations in blueprint remedations Oct 8, 2026

@jan-cerny jan-cerny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Using the XCCDF file tests/API/XCCDF/unittests/test_remediation_blueprint.xccdf.xml from this PR I have verified:

  • that the OpenSCAP from the current main branch generates an invalid TOML which has 2 [customizations] sections
  • that with this PR it's fixed so that OpenSCAP generates a TOML file containing only 1 [customizations] that contains both the static partitioning_mode = "raw" and content remediation fips=1.
###############################################################################
#
# Blueprint for No profile (default benchmark)
#
# Profile Description:
# Not available
#
# Benchmark ID:  xccdf_moc.elpmaxe.www_benchmark_test
# Benchmark Version:  1.0
# XCCDF Version:  1.2
#
# This file was generated by OpenSCAP 1.4.5 using:
# $ oscap xccdf generate fix --fix-type blueprint blueprint.xccdf.xml
#
# This Blueprint is generated from an OpenSCAP profile without preliminary evaluation.
# It attempts to fix every selected rule, even if the system is already compliant.
#
# How to apply this Blueprint:
# composer-cli blueprints push blueprint.toml
#
###############################################################################

name = "hardened_(null)"
description = "No profile (default benchmark)"
version = "1.0"

[customizations]
partitioning_mode = "raw"
fips=1

[customizations.openscap]
profile_id = ""
# If your hardening data stream is not part of the 'scap-security-guide' package
# provide the absolute path to it (from the root of the image filesystem).
# datastream = "/usr/share/xml/scap/ssg/content/ssg-xxxxx-ds.xml"

distro = rhel-80

[[packages]]
name = "aide"
version = "*"

[[customizations.filesystem]]
mountpoint = "/home"
size = 1

[[customizations.filesystem]]
mountpoint = "/tmp"
size = 2

[customizations.kernel]
append = "foo=bar audit=1"

[customizations.services]
enabled = ["sshd","usbguard"]
disabled = ["kdump"]
masked = ["evil"]

@jan-cerny jan-cerny self-assigned this Oct 9, 2026
@jan-cerny
jan-cerny merged commit 16ff31b into OpenSCAP:main Oct 9, 2026
19 of 21 checks passed
@Mab879
Mab879 deleted the fix_customizations_regression_main branch October 9, 2026 15:57
@Mab879 Mab879 mentioned this pull request Oct 9, 2026
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

Successfully merging this pull request may close these issues.

2 participants