deps/openscap: pass an unset XCCDF operator to SCE scripts as equals #58335
🎯 Code Coverage (<a target='_blank' href='https://app.datadoghq.com/ci/code-coverage/github.com%2Fdatadog%2Fdatadog-agent/pull-requests/58335'>details</a>)<br>• <strong><span title="Percentage of modified executable lines covered by tests in this PR">Patch Coverage</span></strong>: 100.00%<br>• <strong><span title="Percentage of all executable lines covered by tests in the entire codebase">Overall Coverage</span></strong>: 63.36% <span title="Change in overall coverage compared to the base branch">(+0.00%)</span><br>
<sub>
This comment will be updated automatically if new data arrives. <br />
🔗 Commit SHA: 6db2f83 | <a href="https://docs.datadoghq.com/integrations/guide/source-code-integration/#pr-comments">Docs</a> | Give us <a href="https://dd.enterprise.slack.com/archives/C07E3U2QRMM">feedback</a>!
</sub>
Static quality checks
✅ Please find below the results from static quality gates
Comparison made with ancestor 7d257aa4ca49dcafb669d1770950b0cc208acf9c
📊 Static Quality Gates Dashboard
🔗 SQG Job
<details open>
<summary>Successful checks</summary>
Info
||Quality gate|Change|Size (prev → curr → max)|
|--|--|--|--|
|✅|agent_deb_amd64|+12.08 KiB (0.00% increase, -0.10% of buffer)|749.126 → 749.138 → 760.600|
|✅|agent_deb_amd64_fips|+12.08 KiB (0.00% increase, -0.10% of buffer)|681.771 → 681.783 → 693.640|
|✅|agent_msi|-2.0 KiB (0.00% reduction, +0.05% of buffer)|651.055 → 651.053 → 655.230|
|✅|agent_rpm_amd64|+12.08 KiB (0.00% increase, -0.10% of buffer)|749.110 → 749.121 → 760.580|
|✅|agent_rpm_amd64_fips|+12.08 KiB (0.00% increase, -0.10% of buffer)|681.755 → 681.767 → 693.620|
|✅|agent_rpm_arm64|+7.71 KiB (0.00% increase, -0.06% of buffer)|719.175 → 719.183 → 731.150|
|✅|agent_rpm_arm64_fips|+7.71 KiB (0.00% increase, -0.06% of buffer)|657.380 → 657.387 → 669.800|
|✅|agent_suse_amd64|+12.08 KiB (0.00% increase, -0.10% of buffer)|749.110 → 749.121 → 760.580|
|✅|agent_suse_amd64_fips|+12.08 KiB (0.00% increase, -0.10% of buffer)|681.755 → 681.767 → 693.620|
|✅|agent_suse_arm64|+7.71 KiB (0.00% increase, -0.06% of buffer)|719.175 → 719.183 → 731.150|
|✅|agent_suse_arm64_fips|+7.71 KiB (0.00% increase, -0.06% of buffer)|657.380 → 657.387 → 669.800|
|✅|docker_agent_amd64|+13.82 KiB (0.00% increase, -0.12% of buffer)|805.197 → 805.210 → 816.790|
|✅|docker_agent_arm64|+9.45 KiB (0.00% increase, -0.08% of buffer)|799.917 → 799.926 → 812.020|
|✅|docker_agent_jmx_amd64|+12.16 KiB (0.00% increase, -0.10% of buffer)|996.067 → 996.078 → 1007.660|
|✅|docker_agent_jmx_arm64|+7.79 KiB (0.00% increase, -0.06% of buffer)|979.566 → 979.574 → 991.670|
|✅|docker_dogstatsd_amd64|-6.02 KiB (0.01% reduction, +1.34% of buffer)|40.121 → 40.115 → 40.560|
|✅|docker_dogstatsd_arm64|-6.01 KiB (0.02% reduction, +1.16% of buffer)|38.136 → 38.130 → 38.640|
|✅|docker_cluster_agent_amd64|-3.08 KiB (0.00% reduction, +0.12% of buffer)|211.844 → 211.841 → 214.450|
|✅|docker_cluster_agent_arm64|-3.08 KiB (0.00% reduction, +0.12% of buffer)|224.797 → 224.794 → 227.410|
</details>
<details>
<summary>14 successful checks with minimal change (< 2 KiB)</summary>
||Quality gate|Current Size|
|--|--|--|
|✅|agent_heroku_amd64|311.550 MiB|
|✅|docker_cws_instrumentation_amd64|7.447 MiB|
|✅|docker_cws_instrumentation_arm64|6.877 MiB|
|✅|docker_host_profiler_amd64|309.032 MiB|
|✅|docker_host_profiler_arm64|320.146 MiB|
|✅|dogstatsd_deb_amd64|30.864 MiB|
|✅|dogstatsd_deb_arm64|28.806 MiB|
|✅|dogstatsd_rpm_amd64|30.864 MiB|
|✅|dogstatsd_suse_amd64|30.864 MiB|
|✅|iot_agent_deb_amd64|47.625 MiB|
|✅|iot_agent_deb_arm64|44.068 MiB|
|✅|iot_agent_deb_armhf|44.881 MiB|
|✅|iot_agent_rpm_amd64|47.625 MiB|
|✅|iot_agent_suse_amd64|47.624 MiB|
</details>
Approved these changes.
Files inventory check summary
File checks results against ancestor 7d257aa4:
Results for datadog-agent_7.86.0~devel.git.619.6db2f83.pipeline.146320181-1_amd64.deb:
Detected file changes:
<details><summary>
1 Changed files:
</summary>
opt/datadog-agent/embedded/lib/libopenscap_sce.so.33.1.4:
Size changed: +14.95% (8.08 KiB) (54.05 KiB -> 62.12 KiB)
</details>
Results for datadog-iot-agent_7.86.0~devel.git.619.6db2f83.pipeline.146320181-1_amd64.deb:
No change detected
Approved these changes.
lebauce
0intro
The SCE engine exports the operator of each XCCDF value a check reads,
and asserts on any operator outside its switch. An XCCDF Value element
without an operator attribute means equals, and ComplianceAsCode writes
no attribute for equals, but OpenSCAP reads the missing attribute as 0.
An SCE check that exports such a value aborts oscap-io, and the rules
evaluated after it in the same run get no result.
Pass 0 to the scripts as EQUALS, the XCCDF default.
With sysctl_net_ipv6_conf_all_forwarding reduced to its SCE check in
the CIS Ubuntu 24.04 data stream, oscap-exec aborted on
"sce_engine.c:628: sce_engine_eval_rule: Assertion `0' failed" and the
next rule got no result. With this change both rules report.
Also add OpenSCAP's test of the patch, test_sce_default_operator.sh,
which exports a value without an operator attribute and one with
operator="not equal" to an SCE script.