Skip to content

Conversation

@jan-cerny
Copy link
Collaborator

The value of dod_short selector in variable login_banner_text contains single quotes but the bash remediation uses single quotes for the variable which conflicts with the single quote inside the value and leads to incomplete bash remediation. To change single quotes to double quotes for the variable, we need to use a different construction than using the bash_instantiate_variables Jinja macro.

The commit also adds a test scenario that covers this situation.

Resolves: https://issues.redhat.com/browse/OPENSCAP-5403

The value of `dod_short` selector in variable login_banner_text
contains single quotes but the bash remediation uses single
quotes for the variable which conflicts with the single quote
inside the value and leads to incomplete bash remediation.
To change single quotes to double quotes for the variable,
we need to use a different construction than using the
bash_instantiate_variables Jinja macro.

The commit also adds a test scenario that covers this situation.

Resolves: https://issues.redhat.com/browse/OPENSCAP-5403
@jan-cerny jan-cerny added this to the 0.1.78 milestone Jul 17, 2025
@jan-cerny jan-cerny requested a review from matusmarhefka as a code owner July 17, 2025 08:06
@jan-cerny jan-cerny added the Bash Bash remediation update. label Jul 17, 2025
@vojtapolasek vojtapolasek self-assigned this Jul 17, 2025
Copy link
Collaborator

@vojtapolasek vojtapolasek left a comment

Choose a reason for hiding this comment

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

I verified the fix with local Automatus tests.

@vojtapolasek vojtapolasek merged commit d8a5162 into ComplianceAsCode:master Jul 18, 2025
123 of 127 checks passed
jan-cerny added a commit to jan-cerny/scap-security-guide that referenced this pull request Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bash Bash remediation update.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants