feat(trivy): add Trivy integration with Kubernetes, including cron job and email reporting
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user