Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openscap module #39423

Merged
merged 1 commit into from Feb 17, 2017
Merged

Openscap module #39423

merged 1 commit into from Feb 17, 2017

Conversation

dincamihai
Copy link
Contributor

@dincamihai dincamihai commented Feb 15, 2017

What does this PR do?

oscap command line tool wrapper module

What issues does this PR fix or reference?

It makes it possible to run oscap on the minions.
The module accepts a string of parameters that you would normally pass to oscap in command line.
(eg: salt-call --local openscap.xccdf "eval --profile Default /usr/share/openscap/scap-yast2sec-xccdf.xml")

Currently, the module can only run oscap xccdf eval.
It needs file_recv=True on the master because it uses cp.push_dir to push the generated files.

Examples of outputs:

  • salt-call --local openscap.xccdf "eval --profile Default /usr/share/openscap/scap-yast2sec-xccdf.xml"
    local:
        ----------
        error:
            None
        success:
            True
        upload_dir:
            /tmp/tmpBAhfx8
    
  • restricted to eval: salt-call --local openscap.xccdf "evaal --profile Default /usr/share/openscap/scap-yast2sec-xccdf.xml"
    local:
        ----------
        error:
            argument action: invalid choice: 'evaal' (choose from 'eval')
        success:
            False
        upload_dir:
            None
    
  • profile is required: salt-call --local openscap.xccdf "eval --profiles Default /usr/share/openscap/scap-yast2sec-xccdf.xml"
    local:
        ----------
        error:
            argument --profile is required
        success:
            False
        upload_dir:
            None
    
  • unknown params ignored: salt-call --local openscap.xccdf "eval --profile Default --unknown Param /usr/share/openscap/scap-yast2sec-xccdf.xml"
    local:
        ----------
        error:
            None
        success:
            True
        upload_dir:
            /tmp/tmp6pLJfN
    
  • missing file: salt-call --local openscap.xccdf "eval --profile Default /usr/share/openscap/missing.xml"
    local:
        ----------
        error:
            OpenSCAP Error: Unable to open file: '/usr/share/openscap/missing.xml' [oscapxml.c:575]
        success:
            False
        upload_dir:
            None
    

Tests written?

Yes

@dincamihai dincamihai changed the title [WIP] Openscap [WIP] Openscap module Feb 15, 2017
@dincamihai dincamihai force-pushed the openscap branch 6 times, most recently from a022f9f to 1078bf3 Compare February 16, 2017 16:26
@dincamihai dincamihai changed the title [WIP] Openscap module Openscap module Feb 16, 2017
@cachedout
Copy link
Contributor

@dincamihai Could you please resolve this lint errors? Thanks. https://jenkins.saltstack.com/job/PR/job/salt-pr-lint-n/8670/violations/

@dincamihai dincamihai force-pushed the openscap branch 4 times, most recently from 81dbcff to 95b6210 Compare February 17, 2017 07:06
@dincamihai
Copy link
Contributor Author

@cachedout fixed

@dincamihai dincamihai force-pushed the openscap branch 5 times, most recently from dd1889a to 2902178 Compare February 17, 2017 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants