Go to main content

man pages section 8: System Administration Commands

Exit Print View

Updated: Wednesday, July 27, 2022

oscap-ssh (8)


oscap-ssh - Tool for running oscap over SSH and collecting results.


Please see following description for synopsis


System Administration Utilities                                   oscap-ssh(8)

       oscap-ssh - Tool for running oscap over SSH and collecting results.

       oscap-ssh  runs  oscap  tool on a remote system through SSH connection.
       The input files are transfered to the target system and after the  scan
       finishes result files are transfered back. No temporary data remains on
       the remote machine.

       The tool requires bash, ssh, scp and mktemp to perform OVAL  and  XCCDF
       evaluation  of  remote  machines.  The  remote machine also has to have
       oscap installed and in $PATH. This can be  accomplished  by  installing

       Usage of the tool mimics usage and options of oscap(8) tool.

   Evaluation of XCCDF content
       $ oscap-ssh user@host 22 xccdf eval [options] INPUT_CONTENT

       Only source datastreams are supported as INPUT_CONTENT!

       Supported options are:

   Evaluation of OVAL content
       $ oscap-ssh user@host 22 oval eval [options] INPUT_CONTENT

       Supported options are:

   Collection of OVAL System Characteristic
       $ oscap-ssh user@host 22 oval collect [options] INPUT_CONTENT

       Supported options are:

       Specific option for oscap-ssh (must be first argument):

   Environment variables
       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.  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.

   Simple XCCDF evaluation
       The  following  command evaluates a remote Fedora machine as root. HTML
       report is written out as report.html on the local machine. Can be  exe-
       cuted  from  any  machine that has ssh, scp and bash. The local machine
       does not need to have openscap installed.  It also uses  the  SSH_ADDI-
       TIONAL_OPTIONS  variable  to configure ssh in such way that contents of
       the known_hosts file are ignored.

       $ export SSH_ADDITIONAL_OPTIONS="-o StrictHostKeyChecking=no  -o  User-
       KnownHostsFile=/dev/null"  $  oscap-ssh root@ 22 xccdf eval
       --profile     xccdf_org.ssgproject.content_profile_common      --report
       report.html /usr/share/xml/scap/ssg/content/ssg-fedora-ds.xml

   XCCDF Evaluation with tailoring file
       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.

       $  oscap-ssh  --sudo  oscap-user@  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-

   Running remotely as root
       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 viola-
       tion. 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:
         # allow oscap-user to run openscap scanner
         Defaults!/usr/bin/oscap !requiretty
         oscap-user ALL=(root) NOPASSWD: /usr/bin/oscap

       Please report bugs using https://github.com/OpenSCAP/openscap/issues

       Martin Preisler <mpreisle@redhat.com>
       imon Lukak <slukasik@redhat.com>

       See attributes(7) for descriptions of the following attributes:

       |ATTRIBUTE TYPE |       ATTRIBUTE VALUE        |
       |Availability   | security/compliance/openscap |
       |Stability      | Uncommitted                  |

       Source  code  for open source software components in Oracle Solaris can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-

       This     software     was    built    from    source    available    at
       https://github.com/oracle/solaris-userland.   The  original   community
       source    was    downloaded   from    https://github.com/OpenSCAP/open-

       Further information about this software can be found on the open source
       community website at http://www.open-scap.org.

Red Hat, Inc.                    January 2016                     oscap-ssh(8)