| 1 | # OpenSCAP |
| 2 | |
| 3 | [](https://github.com/OpenSCAP/openscap/actions/workflows/build.yml) |
| 4 | [](https://gitter.im/OpenSCAP/openscap?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
| 5 | |
| 6 | Open Source Security Compliance Solution |
| 7 | |
| 8 | ## About |
| 9 | |
| 10 | The `oscap` program is a command line tool that allows users to load, scan, |
| 11 | validate, edit, and export SCAP documents. |
| 12 | |
| 13 | * Homepage of the project: [www.open-scap.org](http://www.open-scap.org) |
| 14 | * User Manual: [OpenSCAP User Manual](docs/manual/manual.adoc) |
| 15 | * Compilation, testing and debugging: [OpenSCAP Developer Manual](docs/developer/developer.adoc) |
| 16 | * For new contributors: [How to contribute](docs/contribute/contribute.adoc) |
| 17 | |
| 18 | ## Contributing |
| 19 | |
| 20 | We welcome all contributions to the OpenSCAP project. |
| 21 | If you would like to contribute, either by fixing existing issues or adding new features, please check out our [contribution guide](docs/contribute/contribute.adoc) to get started. |
| 22 | If you would like to discuss anything, ask questions, or if you need additional help getting started, you can either send a message to our libera.chat IRC channel, **#openscap**, or to our [mailing list](https://www.redhat.com/mailman/listinfo/open-scap-list). |
| 23 | |
| 24 | ## Microsoft Windows Support |
| 25 | |
| 26 | The Microsoft Windows support [is officially void](docs/windows.md) as of Febuary 1, 2022. |
| 27 | |
| 28 | ## Use cases |
| 29 | |
| 30 | ### SCAP Content Validation |
| 31 | |
| 32 | * The following example shows how to validate a given source data stream; all components within the data stream are validated (XCCDF, OVAL, OCIL, CPE, and possibly other components): |
| 33 | ``` |
| 34 | oscap ds sds-validate scap-ds.xml |
| 35 | ``` |
| 36 | |
| 37 | |
| 38 | ### Scanning |
| 39 | |
| 40 | * To evaluate all definitions within the given OVAL Definition file, run the following command: |
| 41 | ``` |
| 42 | oscap oval eval --results oval-results.xml scap-oval.xml |
| 43 | ``` |
| 44 | *where scap-oval.xml is the OVAL Definition file and oval-results.xml is the OVAL Result file.* |
| 45 | |
| 46 | * To evaluate all definitions from the OVAL component that are part of a particular data stream within a SCAP data stream collection, run the following command: |
| 47 | ``` |
| 48 | oscap oval eval --datastream-id ds.xml --oval-id xccdf.xml --results oval-results.xml scap-ds.xml |
| 49 | ``` |
| 50 | *where ds.xml is the given data stream, xccdf.xml is an XCCDF file specifying the OVAL component, oval-results.xml is the OVAL Result file, and scap-ds.xml is a file representing the SCAP data stream collection.* |
| 51 | |
| 52 | * To evaluate a specific profile in an XCCDF file run this command: |
| 53 | ``` |
| 54 | oscap xccdf eval --profile Desktop --results xccdf-results.xml --cpe cpe-dictionary.xml scap-xccdf.xml |
| 55 | ``` |
| 56 | *where scap-xccdf.xml is the XCCDF document, Desktop is the selected profile from the XCCDF document, xccdf-results.xml is a file storing the scan results, and cpe-dictionary.xml is the CPE dictionary.* |
| 57 | |
| 58 | * To evaluate a specific XCCDF benchmark that is part of a data stream within a SCAP data stream collection run the following command: |
| 59 | ``` |
| 60 | oscap xccdf eval --datastream-id ds.xml --xccdf-id xccdf.xml --results xccdf-results.xml scap-ds.xml |
| 61 | ``` |
| 62 | *where scap-ds.xml is a file representing the SCAP data stream collection, ds.xml is the particular data stream, xccdf.xml is ID of the component-ref pointing to the desired XCCDF document, and xccdf-results.xml is a file containing the scan results.* |
| 63 | |
| 64 | |
| 65 | ### Document generation |
| 66 | |
| 67 | * without XCCDF rules |
| 68 | ``` |
| 69 | oscap xccdf generate guide XCCDF-FILE > XCCDF-GUIDE-FILE |
| 70 | ``` |
| 71 | |
| 72 | * with XCCDF rules |
| 73 | ``` |
| 74 | oscap xccdf generate guide --profile PROFILE XCCDF-FILE > XCCDF-GUIDE-FILE |
| 75 | ``` |
| 76 | |
| 77 | * generate report from scanning |
| 78 | ``` |
| 79 | oscap xccdf generate report XCCDF-RESULT-FILE > XCCDF-REPORT-FILE |
| 80 | ``` |