Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

oscapd-evaluate: support xccdf-id option #117

Merged
merged 2 commits into from
Oct 24, 2017

Conversation

matusmarhefka
Copy link
Member

@matusmarhefka matusmarhefka commented Oct 24, 2017

atomic scan / oscapd-evaluate now supports xccdf-id scanner argument
for configuration_compliance scan type. This way it is possible to select
any profile in datastream file using:

--scanner_args xccdf-id=XCCDF_ID,profile=PROFILE_ID

If xccdf-id is not specified, profile is selected from the first XCCDF
component found in a datastream file.

Fixes #116

@jan-cerny jan-cerny added this to the 0.1.9 milestone Oct 24, 2017
@jan-cerny jan-cerny self-assigned this Oct 24, 2017
args.profile = es.select_profile_by_suffix(args.profile)
args.profile = es.select_profile_by_suffix(
args.xccdf_id, args.profile
)
Copy link
Member

Choose a reason for hiding this comment

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

weird indentation

input_tree,
xccdf_id,
"http://scap.nist.gov/schema/scap/source/1.2",
"http://checklists.nist.gov/xccdf/1.2",
Copy link
Member

Choose a reason for hiding this comment

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

Why is this namespace second here and first in the previous call?

Copy link
Member Author

Choose a reason for hiding this comment

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

It should be the same! I will correct it.

…nent id

Changed functions (added xccdf_id argument):
* openscap_daemon/oscap_helpers.py:   get_profile_choices_for_input
* openscap_daemon/evaluation_spec.py: EvaluationSpec.select_profile_by_suffix
* atomic scan / oscapd-evaluate now supports xccdf-id scanner argument
  for configuration_compliance scan type. This way it is possible to select
  any profile in datastream file using:

  '--scanner_args xccdf-id=XCCDF_ID,profile=PROFILE_ID'

  If xccdf-id is not specified, profile is selected from the first XCCDF
  component found in a datastream file.
@matusmarhefka
Copy link
Member Author

matusmarhefka commented Oct 24, 2017

@jan-cerny Wrong indentation and swapped namespace arguments are fixed in the latest commit.

@jan-cerny
Copy link
Member

OK, thanks.

@jan-cerny jan-cerny merged commit 54c434b into OpenSCAP:master Oct 24, 2017
@matusmarhefka matusmarhefka deleted the scanner-args-xccdf-id branch November 1, 2017 10:37
@@ -455,7 +474,7 @@ def _get_result_id(results_path):
return test_result.attrib["id"]


def generate_fix_for_result(config, results_path, fix_type):
def generate_fix_for_result(config, results_path, fix_type, xccdf_id):
Copy link
Member

Choose a reason for hiding this comment

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

default xccdf_id to None

Copy link
Member Author

Choose a reason for hiding this comment

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

@mpreisler Good catch, I created PR #120

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants