Skip to content

Commit

Permalink
move checkov config to a common place
Browse files Browse the repository at this point in the history
  • Loading branch information
suhancz committed May 16, 2024
1 parent 5dada98 commit 70ffce2
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .github/linters/.checkov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
skip-check:
- CKV2_ANSIBLE_2 # HTTPS comes from a loop variable
- CKV2_ANSIBLE_3 # Block is used at many places only for the when condition and the tags
- CKV2_ANSIBLE_4 # The Remi repo doesn't provide GPG keys
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ENV container docker

WORKDIR /

# hadolint ignore=SC2154
RUN "(cd /lib/systemd/system/sysinit.target.wants/; for i in ; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done);"

RUN rm -rf /lib/systemd/system/multi-user.target.wants/ \
Expand Down
1 change: 0 additions & 1 deletion tasks/backups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@
- pdns
- wg_vpn
- name: Restore backups
# checkov:skip=CKV2_ANSIBLE_3: Block is only used for the when condition and the tags
tags: restore
when: mariadb_backup_path is defined or ldap_backup_path is defined or opendkim_backup_path is defined or opendmarc_backup_path is defined or vsftpd_backup_path is defined or ssl_backup_path is defined or kolab_backup_path is defined or imap_backup_path is defined or postfix_backup_path is defined or pdns_backup_path is defined or wg_vpn_backup_path is defined
block:
Expand Down
1 change: 0 additions & 1 deletion tasks/convert_user_to_ldif.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
changed_when: passwd_mig_content.rc == 0
failed_when: (passwd_mig_content.rc != 0) and (passwd_mig_content.stderr | length > 0)
- name: "Migrate already existing user {{ user_data_item.name }}"
# checkov:skip=CKV2_ANSIBLE_3: Block is used for the when condition only
when: passwd_mig_content.changed
block:
- name: Set passwd line
Expand Down
1 change: 0 additions & 1 deletion tasks/httpd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
- http
- https
- name: Set up SELinux rules
# checkov:skip=CKV2_ANSIBLE_3: Block is used for the when condition only
when: getenforce.stdout != 'Disabled'
block:
- name: Set SELinux booleans
Expand Down
1 change: 0 additions & 1 deletion tasks/imapsync.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- name: Sync old IMAP account to the current mailbox
# checkov:skip=CKV2_ANSIBLE_3: Block is only used for the when condition and the tags
no_log: yes
when: current_user.old_imap_mail is defined
tags: imapsync
Expand Down
1 change: 0 additions & 1 deletion tasks/kolab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@
state: restarted

- name: Enable domains
# checkov:skip=CKV2_ANSIBLE_3: Block is used for the tag only
tags: ldap
block:
# The editing domains in the Kolab API is not documented at the tome of this writing, so I go plain LDAP here
Expand Down
1 change: 0 additions & 1 deletion tasks/os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

- name: Enable IPv6
when: ansible_default_ipv6.address is not defined
# checkov:skip=CKV2_ANSIBLE_3: Block is only used for the when condition
block:
- name: Enable IPv6 via sysctl
ansible.posix.sysctl:
Expand Down
2 changes: 0 additions & 2 deletions tasks/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
backup: yes
create: yes
- name: Set up Remi repository
# checkov:skip=CKV2_ANSIBLE_4: The Remi repo doesn't provide GPG keys
ansible.builtin.dnf:
name: "https://rpms.remirepo.net/enterprise/remi-release-{{ ansible_distribution_major_version }}.rpm"
disable_gpg_check: yes
Expand Down Expand Up @@ -483,7 +482,6 @@
# remote_src: yes
# backup: yes
- name: Download as-is executables
# checkov:skip=CKV2_ANSIBLE_2: HTTPS comes from a loop variable
tags: imapsync
ansible.builtin.get_url:
url: "{{ item.url }}"
Expand Down
1 change: 0 additions & 1 deletion tasks/postfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@
backup: yes
notify: Restart postfix
- name: Set up HELO access whitelist
# checkov:skip=CKV2_ANSIBLE_3: Block is used for the when condition only
when: helo_access is defined
block:
- name: Create HELO access whitelist
Expand Down
1 change: 0 additions & 1 deletion tasks/poweradmin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
- name: Get latest PowerAdmin version
# checkov:skip=CKV2_ANSIBLE_3: Block is used for the when condition only
tags:
- dyndns
- poweradmin
Expand Down
1 change: 0 additions & 1 deletion tasks/read_wireguard_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
path: "{{ wg_config_file }}"
register: wg_config_file_info
- name: Read existing WireGuard config into variable
# checkov:skip=CKV2_ANSIBLE_3: Block is only used for the when condition
when: wg_config_file_info.stat.exists
block:
- name: Read WireGuard config file
Expand Down
1 change: 0 additions & 1 deletion tasks/webdav.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
state: mounted
fstype: fuse.bindfs
- name: Set up SELinux rules for WebDAV
# checkov:skip=CKV2_ANSIBLE_3: Block is only used for the when condition and the tags
tags: wireguard
when: getenforce.stdout != 'Disabled'
block:
Expand Down

0 comments on commit 70ffce2

Please sign in to comment.