SSG Test Suite: Fix (all) profile execution when running test suite in rule mode#4792
Merged
matejak merged 5 commits intoComplianceAsCode:masterfrom Sep 5, 2019
Merged
Conversation
11b87ec to
b4dbfde
Compare
matejak
requested changes
Sep 4, 2019
Member
matejak
left a comment
There was a problem hiding this comment.
This PR aims to make virtual profiles working with the test suite and fixes an oscap-ssh error that has not yet propagated.
I propose some modifications that would simplify the behavior and implementation.
When overriding the profile metadata from test scenarios with the (all) profile, dependending the version of OpenSCAP it may fail to run because of some bash syntax error.
b4dbfde to
8bd3d7e
Compare
The fix for oscap-ssh is already in Fedora 30 and is going to be backported to 29 soon.
When generating remediation from arf and the arf file has only on TestResult, it doesn't matter if you provide a value for result-id and for (all) profile it was breaking the bash command with bad syntax.
matejak
requested changes
Sep 4, 2019
Member
matejak
left a comment
There was a problem hiding this comment.
Unfortunately, the generate_fixes_remotely method generates a command string out of command components without any additional processing. However, individual components may need protection from shell interpretation.
Therefore something like
command_components = command_base + command_options + command_operands
command_string = ' '.join(["'%s'" % c for c in command_components])
may work.
matejak
approved these changes
Sep 5, 2019
Member
|
Great, I can confirm that it works also on the system with quoting fixed in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description: