Add ROXAGENT role execution, to provide Client side for RHACS VM Scanning - #159
Add ROXAGENT role execution, to provide Client side for RHACS VM Scanning#159sluetze wants to merge 4 commits into
Conversation
Install virtctl for KubeVirt SSH port-forwarding, add the sluetze.roxagent Galaxy role and containers.podman collection to the execution environment. Assisted-by: Auto via Cursor Co-authored-by: Cursor <cursoragent@cursor.com>
Use the sluetze.roxagent Galaxy role with virtctl SSH for KubeVirt VMs on pod networking, supporting AAP job templates and manual ansible-playbook runs. Assisted-by: Auto via Cursor Co-authored-by: Cursor <cursoragent@cursor.com>
Register batch and ad-hoc job templates, KubeVirt inventory source with label filtering, registry credential type, and a secrets example for local runs. Assisted-by: Auto via Cursor Co-authored-by: Cursor <cursoragent@cursor.com>
Expose PODMAN_IMAGE_REGISTRY_* for local playbook runs and gitignore the generated context/Containerfile from execution environment builds. Assisted-by: Auto via Cursor Co-authored-by: Cursor <cursoragent@cursor.com>
|
Everything was tested with my own AAP in development. |
|
@sluetze What's the reason for the "Podman Image Registry" credentials? |
Ah this are the registry credentials. Placed into the RHEL VM's to access all the tools/images. |
|
Overall looks fine for me. If you like you can also store all the playbooks in your own repo and configure at aap.coe.muc.redhat.com in your organisation. Mean's you don't have to wait for pull request review and so on |
the RHACS Roxagent image is: https://catalog.redhat.com/en/software/containers/advanced-cluster-security/rhacs-main-rhel9/69fe13d88a36e845594f1989 even though there is "unauthenticated pull" this results in: so we need to go through registry.redhat.io and this is only possible authenticated. As we need to pull the image (and configure authentication) on every host, I decided to store the secret in Ansible centrally and then distribute it in the playbook to all the hosts. |
Together with stormshift/clusters#37, this provides an automation to deploy roxagent on VMs that are labeled with stormshift.coe.muc.redhat.com/roxagent: 'true'
IMPORTANT
currently there are multiple defaults defined for the security-aap, an AAP instance that I used for development. I can modify them if wanted to default to the ISAR AAP, which should be the goal.
This Role also requires a credential to be defined with access to VMs to fill the inventory
Summary
Adds automation to install RHACS roxagent on RHEL VMs running on OpenShift Virtualization (KubeVirt), using the external Galaxy role
sluetze.roxagent(v0.1.0).virtctlfor SSH port-forwarding to pod-network VMs, addssluetze.roxagentandcontainers.podmanconfigure-roxagent.yaml— playbook for batch and ad-hoc roxagent installs via virtctl SSHconfigure-roxagent-job-template.yaml— provisions AAP resources: organization, KubeVirt inventory source (label-filtered), batch + ad-hoc job templates, Podman Image Registry credential typecfg/secrets.yml.example— documents required AAP controller and credential settings for local runsPODMAN_IMAGE_REGISTRY_*env vars for registry auth during local testingJob-Templates
Two AAP job templates cover the two deployment paths:
ISAR-vm-inventory(KubeVirt source, labelstormshift.coe.muc.redhat.com/roxagent=true)Roxagent-adhocplaceholderroxagent-triggerwatcher or manual launchSSH to VMs on pod networking uses
virtctl sshport-forwarding (configured by the role'sset-kubevirt-connection.ymlpre-task). Registry credentials are injected via a custom AAP credential type Podman Image Registry that setsPODMAN_IMAGE_REGISTRY_*environment variables.Testing / Implementation
execution-environment.ymland verifyvirtctlandsluetze.roxagentrole are presentcfg/secrets.yml.example→cfg/secrets.yml, fill in AAP credentials for ISAR AAPansible-navigator run configure-roxagent-job-template.yaml -e @cfg/secrets.ymlagainst SAR AAPrhsm-cloud-initsecret and roxagent label)roxagent_kubevirt_namespace,roxagent_kubevirt_vm_name,roxagent_ansible_user)--limiton a subset of inventory hosts