feat(trivy): add Trivy integration with Kubernetes, including cron job and email reporting

This commit is contained in:
2025-05-10 18:16:08 +02:00
parent 5d2f50feb9
commit bbc4fef0e8
9 changed files with 363 additions and 4 deletions
+28
View File
@@ -0,0 +1,28 @@
---
- name: Trivy Playbook (K8s)
hosts: trivy
gather_facts: true
# Specific tasks for this playbook
tasks:
- name: Set required facts
ansible.builtin.set_fact:
trivy_home: "{{ persistent_data | default('/var/lib') }}/trivy"
trivy_user_id: 1000
trivy_group_id: 1000
tags: always
- name: Create required trivy data folder
become: true
ansible.builtin.file:
state: directory
path: "{{ item }}"
mode: "0750"
owner: "{{ trivy_user_id }}"
group: "{{ trivy_group_id }}"
with_items:
- "{{ trivy_home }}"
- "{{ trivy_home }}/cache"
tags:
- tasks
- tasks::folders