ComplianceAsCode / content

Security automation content in SCAP, Bash, Ansible, and other formats
https://complianceascode.readthedocs.io/en/latest/
Other
2.2k stars 696 forks source link

[BugFix] Substitue the refenced remediation functions only one (via one <xccdf:sub idref=> element) #1293

Closed iankko closed 1 year ago

iankko commented 8 years ago

Change https://github.com/OpenSCAP/scap-security-guide/pull/1270 implemented remediation functions as direct part of the resulting benchmarks.

In the current implementation, each time a known remediation function call is encountered while parsing the body / text / implementation of the remediation script itself, each such function call is substituted with corresponding XCCDF <sub idref="function_function_name" /> element.

Since some remediation scripts are calling the same function multiple times, this results in the state where multiple <sub idref> elements are included in the benchmark. The function call to sub idref translation functionality should be enhanced to substitute each function only with one corresponding < sub idref > element (even when the same function is called multiple times).

Depends on:

matejak commented 5 years ago

The issue is still valid. The best solution seems to be to refactor shared remediations to use Jinja2.

jan-cerny commented 1 year ago

This issue is no longer valid because we no longer have shared remediation functions.