darkwizard242.trivy
Ansible角色: trivy
该角色用于在基于Debian和EL系统中安装(默认) trivy 包或卸载(如果作为变量传递)。Trivy是一个全面且易于使用的容器漏洞扫描器。
需求
无。
角色变量
可用变量如下所示(位于 defaults/main.yml
):
变量列表:
trivy_app: trivy
trivy_app_desired_state: present
trivy_debian_pre_reqs:
- apt-transport-https
- gnupg
trivy_debian_pre_reqs_desired_state: present
trivy_repo_debian_gpg_key: https://aquasecurity.github.io/trivy-repo/deb/public.key
trivy_repo_debian: "deb https://aquasecurity.github.io/trivy-repo/deb {{ ansible_lsb['codename'] }} main"
trivy_repo_debian_filename: "{{ trivy_app }}"
trivy_repo_debian_desired_state: present
trivy_repo_el: https://aquasecurity.github.io/trivy-repo/rpm/releases/$releasever/$basearch/
trivy_repo_el_name: trivy
trivy_repo_el_description: Trivy仓库
trivy_repo_el_gpgcheck: no
trivy_repo_el_enabled: yes
trivy_repo_el_filename: trivy
trivy_repo_el_desired_state: present
变量表:
变量 | 描述 |
---|---|
trivy_app | 要安装的trivy应用包的名称,即 trivy |
trivy_app_desired_state | trivy_app包的状态。是否安装、验证是否可用或卸载(即ansible apt模块值: present 、latest 或absent ) |
trivy_debian_pre_reqs | Trivy建议在Debian系列系统上安装这两个包,因此它们被视为先决条件。 |
trivy_debian_pre_reqs_desired_state | Debian系列系统上Trivy先决条件应用的期望状态。 |
trivy_repo_debian_gpg_key | Debian系列系统上所需的Trivy GPG密钥 |
trivy_repo_debian | Debian系列系统上Trivy的仓库URL。使用 ansible_lsb['codename'] 等事实。 |
trivy_repo_debian_filename | 将存储在 /etc/apt/sources.list.d/ 的仓库文件名称在Debian系列系统中。 |
trivy_repo_debian_desired_state | present 表示如果在Debian系列系统上仓库文件不存在,则创建该文件。另一个选项是absent (不推荐,因为它将阻止trivy包的安装)。 |
trivy_repo_el | EL系列系统上Trivy的仓库 baseurl 。 |
trivy_repo_el_name | EL系列系统上Trivy的仓库名称。 |
trivy_repo_el_description | 在EL系列仓库文件中为Trivy添加的描述。 |
trivy_repo_el_gpgcheck | 布尔值,指示是否在EL系列系统上对Trivy进行gpg检查。 |
trivy_repo_el_enabled | 布尔值,设置以在EL系列系统上启用Trivy仓库。 |
trivy_repo_el_filename | 将存储在 /yum/sources.list.d/trivy.repo 的仓库文件名称在EL系列系统中。 |
trivy_repo_el_desired_state | present 表示如果在EL系列系统上仓库文件不存在,则创建该文件。另一个选项是absent (不推荐,因为它将阻止trivy包的安装)。 |
依赖
无
示例剧本
对于ansible剧本中的角色的默认行为(即安装trivy包)。
- hosts: servers
roles:
- darkwizard242.trivy
对于ansible剧本中的角色行为的自定义(即安装最新版本的trivy)。
- hosts: servers
roles:
- darkwizard242.trivy
vars:
trivy_apps_desired_state: latest
对于ansible剧本中的角色行为的自定义(即卸载trivy包)。
- hosts: servers
roles:
- darkwizard242.trivy
vars:
trivy_apps_desired_state: absent
许可证
作者信息
该角色由 Ali Muhammad 创建。
关于项目
Installs/Uninstalls Trivy for vulnerability scanning of containers.
安装
ansible-galaxy install darkwizard242.trivy
许可证
mit
下载
5.3k
拥有者
Senior DevOps/CloudOps Engineer.
Dedicated to Automating everything I come across.
Love to work on and learn new technologies/tools everyday!