RHSecurityCompliance / contest

Content Testing for ComplianceAsCode/content
Other
4 stars 7 forks source link

Content Testing (contest)

This is a repository of publicly-available tests used for testing ComplianceAsCode/content on Red Hat Enterprise Linux.

Terminology

Parameters

Included test categories

See TESTS.md.

Waiving failed results

In this context, "to waive" means to label a failing result as known-bad, something we have seen before and expect to fail.

Read WAIVERS.md to see where/how you can set up rules to automatically waive failures.

Workarounds

(TODO: Find a better place for this?)

Virtual machines and logging in

The tests perform some hacks to allow login after hardening:

Using upstream/shipped content kickstarts

These have some unfortunate metadata, such as

which are removed by translate_ssg_kickstart() in virt.py.

Referencing library code

See https://rhsecuritycompliance.github.io/contest/ for online Sphinx version of the modules present in lib.

Debugging

(TODO: probably move to its own document?)

SSH into Anaconda

Anaconda-based remediation can be debugged on a virtual machine by issuing virsh domifaddr contest (where contest is the default VM name) to acquire an IP address of the guest (which gets assigned just before Anaconda launches) and doing ssh root@that-ip-addr from the host running the test itself (and hosting the VM).
There is no password for the Anaconda environment, so this will just log you in.

SSH into installed VMs

You can use a handy script in the home directory of the VM host's user.
Simply run:

./contest-sshvm [vm-name]

The script will find the first contest-installed VM if vm-name is not given, it will check whether the VM is running (as a result of you starting it earlier or CONTEST_LEAVE_GUEST_RUNNING=1) and if not, it will start it and wait for sshd to start responding. It will then ssh you into the VM, using pre-generated SSH keys (no passwords needed).

License

Unless specified otherwise, any content within this repository is distributed under the GNU GPLv3 license, see the COPYING.txt file for more.