Blame utils/oscap-ssh.8

Packit 517ee8
.TH oscap-ssh "8" "January 2016" "Red Hat, Inc." "System Administration Utilities"
Packit 517ee8
.SH NAME
Packit 517ee8
oscap-ssh \- Tool for running oscap over SSH and collecting results.
Packit 517ee8
.SH DESCRIPTION
Packit 517ee8
oscap-ssh runs oscap tool on a remote system through SSH connection. The input files are
Packit 517ee8
transfered to the target system and after the scan finishes result files are transfered
Packit 517ee8
back. No temporary data remains on the remote machine.
Packit 517ee8
Packit 517ee8
The tool requires bash, ssh, scp and mktemp to perform OVAL and XCCDF evaluation of remote
Packit 517ee8
machines. The remote machine also has to have oscap installed and in $PATH. This can be
Packit 517ee8
accomplished by installing openscap-scanner.
Packit 517ee8
Packit 517ee8
Usage of the tool mimics usage and options of oscap(8) tool.
Packit 517ee8
Packit 517ee8
.SH USAGE
Packit 517ee8
.SS Evaluation of XCCDF content
Packit 517ee8
$ oscap-ssh user@host 22 xccdf eval [options] INPUT_CONTENT
Packit 517ee8
Packit Bot 61bab5
Only source data streams are supported as INPUT_CONTENT!
Packit 517ee8
Packit 517ee8
Supported options are:
Packit 517ee8
  --profile
Packit 517ee8
  --tailoring-file
Packit 517ee8
  --tailoring-id
Packit 517ee8
  --cpe
Packit 517ee8
  --results
Packit 517ee8
  --results-arf
Packit 517ee8
  --report
Packit 517ee8
  --skip-valid
Packit Bot 61bab5
  --skip-validation
Packit 517ee8
  --fetch-remote-resources
Packit 517ee8
  --progress
Packit 517ee8
  --datastream-id
Packit 517ee8
  --xccdf-id
Packit 517ee8
  --benchmark-id
Packit 517ee8
  --remediate
Packit 517ee8
Packit 517ee8
.SS Evaluation of OVAL content
Packit 517ee8
$ oscap-ssh user@host 22 oval eval [options] INPUT_CONTENT
Packit 517ee8
Packit 517ee8
Supported options are:
Packit 517ee8
  --id
Packit 517ee8
  --variables
Packit 517ee8
  --directives
Packit 517ee8
  --results
Packit 517ee8
  --report
Packit 517ee8
  --skip-valid
Packit Bot 61bab5
  --skip-validation
Packit 517ee8
  --datastream-id
Packit 517ee8
  --oval-id
Packit 517ee8
Packit 517ee8
.SS Collection of OVAL System Characteristic
Packit 517ee8
$ oscap-ssh user@host 22 oval collect [options] INPUT_CONTENT
Packit 517ee8
Packit 517ee8
Supported options are:
Packit 517ee8
  --id
Packit 517ee8
  --syschar
Packit 517ee8
  --variables
Packit 517ee8
  --skip-valid
Packit Bot 61bab5
  --skip-validation
Packit 517ee8
Packit 517ee8
Specific option for oscap-ssh (must be first argument):
Packit 517ee8
  --sudo
Packit 517ee8
Packit 517ee8
.SS Environment variables
Packit 517ee8
oscap-ssh checks out the SSH_ADDITIONAL_OPTIONS environment variable, and pastes its contents into the command-line of ssh to the location where options are expected.
Packit 517ee8
Supply the variable in form of a string that corresponds to a section of the ssh command-line and that consists of options you want to pass.
Packit 517ee8
Packit 517ee8
.SH EXAMPLE USAGE
Packit 517ee8
.SS Simple XCCDF evaluation
Packit 517ee8
The following command evaluates a remote Fedora machine as root. HTML report is written out as report.html on the local machine. Can be executed from any machine that has ssh, scp and bash. The local machine does not need to have openscap installed.
Packit 517ee8
It also uses the SSH_ADDITIONAL_OPTIONS variable to configure ssh in such way that contents of the known_hosts file are ignored.
Packit 517ee8
Packit 517ee8
$ export SSH_ADDITIONAL_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
Packit 517ee8
$ oscap-ssh root@192.168.1.13 22 xccdf eval --profile xccdf_org.ssgproject.content_profile_common --report report.html /usr/share/xml/scap/ssg/content/ssg-fedora-ds.xml
Packit 517ee8
Packit 517ee8
.SS XCCDF Evaluation with tailoring file
Packit 517ee8
The following command uses a tailoring file and also copies back ARF and XCCDF results. The tailoring file is automatically copied from local machine to remote.
Packit 517ee8
Packit 517ee8
$ oscap-ssh --sudo oscap-user@192.168.1.13 22 xccdf eval --profile xccdf_org.ssgproject.content_profile_common --report report.html --results results.xml --results-arf arf.xml --tailoring-file ssg-fedora-ds-tailoring.xml /usr/share/xml/scap/ssg/content/ssg-fedora-ds.xml
Packit 517ee8
Packit 517ee8
.SS Running remotely as root
Packit 517ee8
Note that the openscap scanner is best run by the 'root' user as in the first example above. To do this, the "PermitRootLogin" directive must be enabled in /etc/ssh/sshd_config, which is itself a security violation. A safer approach is to enable a non-privileged user ('oscap-user' in the second example above) to run only the oscap binary as root (with the '--sudo' flag) by updating the remote machine's 'sudoers' file or adding a file like /etc/sudoers.d/99-oscap-user:
Packit 517ee8
  # allow oscap-user to run openscap scanner
Packit 517ee8
  Defaults!/usr/bin/oscap !requiretty
Packit 517ee8
  oscap-user ALL=(root) NOPASSWD: /usr/bin/oscap
Packit 517ee8
Packit 517ee8
.SH REPORTING BUGS
Packit 517ee8
.nf
Packit 517ee8
Please report bugs using https://github.com/OpenSCAP/openscap/issues
Packit 517ee8
Packit 517ee8
.SH AUTHORS
Packit 517ee8
.nf
Packit 517ee8
Martin Preisler <mpreisle@redhat.com>
Packit 517ee8
Šimon Lukašík <slukasik@redhat.com>
Packit 517ee8
.fi