Debian Codegraph @

utils/oscap-ssh.8

raw
1 .TH oscap-ssh "8" "January 2016" "Red Hat, Inc." "System Administration Utilities"
2 .SH NAME
3 oscap-ssh \- Tool for running oscap over SSH and collecting results.
4 .SH DESCRIPTION
5 oscap-ssh runs oscap tool on a remote system through SSH connection. The input files are
6 transferred to the target system and after the scan finishes result files are transferred
7 back. No temporary data remains on the remote machine.
8
9 The tool requires bash, ssh, scp and mktemp to perform OVAL and XCCDF evaluation of remote
10 machines. The remote machine also has to have oscap installed and in $PATH. This can be
11 accomplished by installing openscap-scanner.
12
13 Usage of the tool mimics usage and options of oscap(8) tool.
14
15 .SH USAGE
16 .SS Evaluation of XCCDF content
17 $ oscap-ssh user@host 22 xccdf eval [options] INPUT_CONTENT
18
19 Only source data streams are supported as INPUT_CONTENT!
20
21 Supported options are:
22 --profile
23 --tailoring-file
24 --tailoring-id
25 --cpe
26 --results
27 --results-arf
28 --report
29 --skip-validation
30 --fetch-remote-resources
31 --local-files
32 --progress
33 --datastream-id
34 --xccdf-id
35 --benchmark-id
36 --remediate
37
38 .SS Evaluation of OVAL content
39 $ oscap-ssh user@host 22 oval eval [options] INPUT_CONTENT
40
41 Supported options are:
42 --id
43 --variables
44 --directives
45 --results
46 --report
47 --skip-validation
48 --datastream-id
49 --oval-id
50
51 .SS Collection of OVAL System Characteristic
52 $ oscap-ssh user@host 22 oval collect [options] INPUT_CONTENT
53
54 Supported options are:
55 --id
56 --syschar
57 --variables
58 --skip-validation
59
60 Specific option for oscap-ssh (must be first argument):
61 --sudo
62
63 .SS Environment variables
64 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.
65 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.
66
67 .SS Using --local-files option
68 The oscap-ssh command supports the --local-files option, but it isn't possible to pass './' and '../' as an argument. Use a full directory path instead.
69
70 .SH EXAMPLE USAGE
71 .SS Simple XCCDF evaluation
72 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.
73 It also uses the SSH_ADDITIONAL_OPTIONS variable to configure ssh in such way that contents of the known_hosts file are ignored.
74
75 $ export SSH_ADDITIONAL_OPTIONS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
76 $ oscap-ssh [email protected] 22 xccdf eval --profile xccdf_org.ssgproject.content_profile_common --report report.html /usr/share/xml/scap/ssg/content/ssg-fedora-ds.xml
77
78 .SS XCCDF Evaluation with tailoring file
79 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.
80
81 $ oscap-ssh --sudo [email protected] 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
82
83 .SS Running remotely as root
84 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:
85 # allow oscap-user to run openscap scanner
86 Defaults!/usr/bin/oscap !requiretty
87 oscap-user ALL=(root) NOPASSWD: /usr/bin/oscap
88
89 .SH REPORTING BUGS
90 .nf
91 Please report bugs using https://github.com/OpenSCAP/openscap/issues
92
93 .SH AUTHORS
94 .nf
95 Martin Preisler <[email protected]>
96 Šimon Lukašík <[email protected]>
97 .fi