sudo oscap xccdf eval --oval-results --profile cis --results-arf /tmp/arf.xml --report /tmp/report.html /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
oscap xccdf generate fix --fix-type ansible --result-id "" /tmp/arf.xml > playbook.yml
<!doctype html> | |
<title>LondonIAC meetup - Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
### Install the required packages: | |
sudo yum install openscap-scanner scap-security-guide | |
### Can we run a report? | |
sudo oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_ospp --report /tmp/report.html /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml | |
first scan gives “notapplicable” | |
### Now do this… | |
sudo cp /usr/share/openscap/cpe/openscap-cpe-dict.xml /usr/share/openscap/cpe/openscap-cpe-dict.xml.dist |
sudo oscap xccdf eval --oval-results --profile cis --results-arf /tmp/arf.xml --report /tmp/report.html /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
oscap xccdf generate fix --fix-type ansible --result-id "" /tmp/arf.xml > playbook.yml
Subscribe to our YouTube channel here: https://www.youtube.com/c/LondonIAC/videos | |
### What you need: | |
1) A Jenkins server with SSH/pem key access to a webserver | |
(Follow this to build install Jenkins: https://youtu.be/-GyAraXQVWM) | |
2) A Github account | |
(The code I'm using today https://github.com/dmccuk/webapp1) | |
3) A webserver to display the results. | |
(that Jenkins can SSH to) |
Ansible – Ad-hoc commands | |
The ability to use ad-hoc commands in Ansible without the need for playbooks is a very powerful tool. In the old days of | |
Linux and Unix administration (and even today!), the Admins would use a golden host or jump server with SSH keys and be | |
able to hop around their environments running remote command and colleting data. Ad-hoc commands in Ansible gives us this | |
same ability, but with a much more powerful tool at our fingertips. | |
--- | |
Website: https://www.londoniac.co.uk/ | |
Meetup: https://www.meetup.com/londoniac |
Linux containers, in short, contain applications in a way that keep them isolated from the host system that they run on. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and ship it all out as one package. And they are designed to make it easier to provide a consistent experience as developers and system administrators move code from development environments into production in a fast and replicable way.
I'll walk through the install in the video. Here's the link: https://docs.docker.com/engine/install/ubuntu/
Follow this tutorial on YouTube here: https://youtu.be/ejLQ5danlIY
Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services that facilitates both declarative configuration and automation.
Source: https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/
I’ve had a few requests for this demo as It seems like a lot of people are having issues setting up the new version of AWX. Before v18, (v17) you could simply install AWX on a server with enough resources. Now, the preferred way to install AWX is via the AWX-operator. So you need a Kubernetes or OpenShift cluster. For this demo, I’m using Minikube.
Subscribe To Me On YouTube: https://bit.ly/lon_sub
(if you get any errors, check the bottom of this page for the fix)
I’m using minikube because it’s a single node cluster and it keeps the price down. I did try this on a t2.medium, but there just weren’t enough resources to get it working.
-- Ansible testing using Assert | |
When we run Ansible to manage server configurations, we assume (if there is no red errors) that it worked. But if you are developing ansible modules for your systems, and want to take the DevOps approach and work on CICD pipelines, you need to have some tests in there to prove that what you asked ansible to do has actually worked. | |
One of the best ways to do this within ansible, is to use the Assert module. It asserts that a given expression is true. When you combine this with the output of a command that’s registered to a variable, there is almost no limit to what you can test. | |
I’m going to use the TDD (Test driven development) method where we create the tests before we start writing any ansible code to manage our systems. I expect the tests to fail. Then we’ll write ansible to pass the tests. That’s it. | |
This demo will cover the following: | |
• Create some tests using the command and assert modules. |
This is a walk through of this github repo: https://github.com/kurokobo/awx-on-k3s
Subscribe To Me On YouTube: https://bit.ly/lon_sub
Thanks to @kurokobo for making these steps. Check his github on the link above. If this video helped you get the AWX-operator working, please give the video a like and subscribe to my channel. I appreciate it!
Links: Rancher: https://rancher.com/docs/k3s/latest/en/