OSCAP(8) | System Administration Utilities | OSCAP(8) |
NAME¶
oscap - OpenSCAP command line tool
SYNOPSIS¶
oscap [general-options] module operation [operation-options-and-arguments]
DESCRIPTION¶
oscap is Security Content Automation Protocol (SCAP) toolkit based on OpenSCAP library. It provides various functions for different SCAP specifications (modules).
OpenSCAP tool claims to provide capabilities of Authenticated Configuration Scanner and Authenticated Vulnerability Scanner as defined by The National Institute of Standards and Technology.
GENERAL OPTIONS¶
- -V, --version
- Print supported SCAP specifications, location of schema files, schematron files, CPE files, probes and supported OVAL objects. Displays a list of inbuilt CPE names.
- -h, --help
- Help screen.
MODULES¶
COMMON OPTIONS FOR ALL MODULES¶
INFO OPERATIONS¶
- [options] any-scap-file.xml
For XCCDF or SCAP source data stream files, the info module prints out IDs of incorporated profiles, components, and data streams. These IDs can be used to specify the target for evaluation. Use options --profile, --xccdf-id (or --oval-id), and --datastream-id respectively.
--fetch-remote-resources
XCCDF OPERATIONS¶
oscap returns 0 if all rules pass. If there is an error during evaluation, the return code is 1. If there is at least one rule with either fail or unknown result, oscap finishes with return code 2.
Unless --skip-validation is used, the INPUT_FILE is validated using XSD schemas (depending on document type of INPUT_FILE) and rejected if invalid.
You may specify OVAL Definition files as the last parameter, XCCDF evaluation will then proceed only with those specified files. Otherwise, when oval-definitions-files parameter is missing, oscap tool will try to load all OVAL Definition files referenced from XCCDF automatically (search in the same path as XCCDF).
- --force
- Force resolving XCCDF document even if it is already marked as resolved.
- --skip-schematron
- Turn off Schematron-based validation. It is able to find more errors and inconsistencies but is much slower. Schematron is available only for XCCDF version 1.2.
- --profile ID
- Apply profile with given ID to the Benchmark before further processing takes place.
- Available submodules:
- guide [options] xccdf-file
- --output FILE
- Write the guide to this file instead of standard output.
- --hide-profile-info
- This option has no effect and is kept only for backward compatibility purposes.
- --benchmark-id ID
- Selects a component ref from any datastream that references a component with XCCDF Benchmark such that its @id attribute matches given string exactly.
- --xccdf-id ID
- Takes component ref with given ID from checklists. This allows one to select a particular XCCDF component even in cases where there are multiple XCCDFs in a single data stream. If none is given, the first component from the checklists element is used.
- --tailoring-file TAILORING_FILE
- Use given file for XCCDF tailoring. Select profile from tailoring file to apply using --profile. If both --tailoring-file and --tailoring-id are specified, --tailoring-file takes priority.
- --tailoring-id COMPONENT_REF_ID
- Use tailoring component in input source data stream for XCCDF tailoring. The tailoring component must be specified by its Ref-ID (value of component-ref/@id attribute in input source data stream). Select profile from tailoring component to apply using --profile. If both --tailoring-file and --tailoring-id are specified, --tailoring-file takes priority.
- --skip-signature-validation
- Do not validate digital signatures in digitally signed SCAP source data streams.
- --enforce-signature
- Process only digitally signed SCAP source data streams. Data streams without a signature would be rejected if this switch is used.
- --output FILE
- Write the report to this file instead of standard output.
- --result-id ID
- ID of the XCCDF TestResult from which the report will be generated.
- Result-oriented fixes are generated using result-id provided to select only the failing rules from results in xccdf-file, it skips all other rules.
- It isn't possible to generate result-oriented fixes for the kickstart fix type.
- Profile-oriented fixes are generated using all rules within the provided profile. If no result-id/profile are provided, (default) profile will be used to generate fixes.
- --fix-type TYPE
- Specify fix type. There are multiple programming languages in which the fix script can be generated. TYPE should be one of: bash, ansible, puppet, anaconda, ignition, kubernetes, blueprint, kickstart. Default is bash.
- --output FILE
- Write the report to this file instead of standard output.
- --result-id ID
- Fixes will be generated for failed rule-results of the specified TestResult.
- --xccdf-id ID
- Takes component ref with given ID from checklists. This allows one to select a particular XCCDF component even in cases where there are multiple XCCDFs in a single data stream. If none is given, the first component from the checklists element is used.
- --benchmark-id ID
- Selects a component ref from any data stream that references a component with XCCDF Benchmark such that its @id attribute matches given string exactly.
- --tailoring-file TAILORING_FILE
- Use given file for XCCDF tailoring. Select profile from tailoring file to apply using --profile. If both --tailoring-file and --tailoring-id are specified, --tailoring-file takes priority.
- --tailoring-id COMPONENT_REF_ID
- Use tailoring component in input source data stream for XCCDF tailoring. The tailoring component must be specified by its Ref-ID (value of component-ref/@id attribute in input source data stream). Select profile from tailoring component to apply using --profile. If both --tailoring-file and --tailoring-id are specified, --tailoring-file takes priority.
- --skip-signature-validation
- Do not validate digital signatures in digitally signed SCAP source data streams.
- --enforce-signature
- Process only digitally signed SCAP source data streams. Data streams without a signature would be rejected if this switch is used.
- --stylesheet FILE
- Specify an absolute path to a custom stylesheet to format the output.
- --output FILE
-
Write the document into file.
OVAL OPERATIONS¶
INPUT_FILE can be either OVAL Definition File or SCAP source data stream, it depends on used options.
Unless --skip-validation is used, the INPUT_FILE is validated using XSD schemas (depending on document type of INPUT_FILE) and rejected if invalid.
- --id DEFINITION-ID
- Evaluate ONLY specified OVAL Definition from OVAL Definition File.
- --variables FILE
- Provide external variables expected by OVAL Definition File.
- --directives FILE
- Use OVAL Directives content to specify desired results content.
- --without-syschar
- Don't provide system characteristics in result file.
- --results FILE
- Write OVAL Results into file.
- --report FILE
- Create human readable (HTML) report from OVAL Results.
- --datastream-id ID
- Uses a data stream with that particular ID from the given data stream collection. If not given the first data stream is used. Only applies if you give source data stream in place of an OVAL file.
- --oval-id ID
- Takes component ref with given ID from checks. This allows one to select a particular OVAL component even in cases where there are multiple OVALs in a single data stream.
- --skip-validation
- Do not validate input/output files.
- --fetch-remote-resources
- Allow download of remote components referenced from data stream.
- --local-files DIRECTORY
- Instead of downloading remote data stream components from the network, use data stream components stored locally as files in the given directory. In place of the remote data stream component OpenSCAP will attempt to use a file whose file name is equal to @name attribute of the uri element within the catalog element within the component-ref element in the data stream if such file exists.
- --id OBJECT-ID
- Collect system characteristics ONLY for specified OVAL Object.
- --variables FILE
- Provide external variables expected by OVAL Definitions.
- --syschar FILE
- Write OVAL System Characteristic into file.
- --skip-validation
- Do not validate input/output files.
- --variables FILE
- Provide external variables expected by OVAL Definitions.
- --directives FILE
- Use OVAL Directives content to specify desired results content.
- --skip-validation
- Do not validate input/output files.
- --definitions, --variables, --syschar, --results --directives
- Type of the OVAL document is automatically detected by default. If you want enforce certain document type, you can use one of these options.
- --skip-schematron
- Turn off Schematron-based validation. It is able to find more errors and inconsistencies but is much slower.
- --output FILE
- Write the report to this file instead of standard output.
CPE OPERATIONS¶
match name dictionary.xml
validate cpe-dict-file
DS OPERATIONS¶
REPORTING BUGS¶
Please report bugs using https://github.com/OpenSCAP/openscap/issues Make sure you include the full output of `oscap --v` in the bug report.
AUTHORS¶
Peter Vrabec <pvrabec@redhat.com> Šimon Lukašík Martin Preisler <mpreisle@redhat.com>
March 2021 | Red Hat |