Skip to content

Commit 70ffce2

Browse files
committed
move checkov config to a common place
1 parent 5dada98 commit 70ffce2

File tree

13 files changed

+5
-12
lines changed

13 files changed

+5
-12
lines changed

.github/linters/.checkov.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
skip-check:
2+
- CKV2_ANSIBLE_2 # HTTPS comes from a loop variable
3+
- CKV2_ANSIBLE_3 # Block is used at many places only for the when condition and the tags
4+
- CKV2_ANSIBLE_4 # The Remi repo doesn't provide GPG keys

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ ENV container docker
77

88
WORKDIR /
99

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

1213
RUN rm -rf /lib/systemd/system/multi-user.target.wants/ \

tasks/backups.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
- pdns
113113
- wg_vpn
114114
- name: Restore backups
115-
# checkov:skip=CKV2_ANSIBLE_3: Block is only used for the when condition and the tags
116115
tags: restore
117116
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
118117
block:

tasks/convert_user_to_ldif.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
changed_when: passwd_mig_content.rc == 0
66
failed_when: (passwd_mig_content.rc != 0) and (passwd_mig_content.stderr | length > 0)
77
- name: "Migrate already existing user {{ user_data_item.name }}"
8-
# checkov:skip=CKV2_ANSIBLE_3: Block is used for the when condition only
98
when: passwd_mig_content.changed
109
block:
1110
- name: Set passwd line

tasks/httpd.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
- http
1414
- https
1515
- name: Set up SELinux rules
16-
# checkov:skip=CKV2_ANSIBLE_3: Block is used for the when condition only
1716
when: getenforce.stdout != 'Disabled'
1817
block:
1918
- name: Set SELinux booleans

tasks/imapsync.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
- name: Sync old IMAP account to the current mailbox
3-
# checkov:skip=CKV2_ANSIBLE_3: Block is only used for the when condition and the tags
43
no_log: yes
54
when: current_user.old_imap_mail is defined
65
tags: imapsync

tasks/kolab.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,6 @@
432432
state: restarted
433433

434434
- name: Enable domains
435-
# checkov:skip=CKV2_ANSIBLE_3: Block is used for the tag only
436435
tags: ldap
437436
block:
438437
# The editing domains in the Kolab API is not documented at the tome of this writing, so I go plain LDAP here

tasks/os.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
- name: Enable IPv6
2727
when: ansible_default_ipv6.address is not defined
28-
# checkov:skip=CKV2_ANSIBLE_3: Block is only used for the when condition
2928
block:
3029
- name: Enable IPv6 via sysctl
3130
ansible.posix.sysctl:

tasks/packages.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
backup: yes
3535
create: yes
3636
- name: Set up Remi repository
37-
# checkov:skip=CKV2_ANSIBLE_4: The Remi repo doesn't provide GPG keys
3837
ansible.builtin.dnf:
3938
name: "https://rpms.remirepo.net/enterprise/remi-release-{{ ansible_distribution_major_version }}.rpm"
4039
disable_gpg_check: yes
@@ -483,7 +482,6 @@
483482
# remote_src: yes
484483
# backup: yes
485484
- name: Download as-is executables
486-
# checkov:skip=CKV2_ANSIBLE_2: HTTPS comes from a loop variable
487485
tags: imapsync
488486
ansible.builtin.get_url:
489487
url: "{{ item.url }}"

tasks/postfix.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@
184184
backup: yes
185185
notify: Restart postfix
186186
- name: Set up HELO access whitelist
187-
# checkov:skip=CKV2_ANSIBLE_3: Block is used for the when condition only
188187
when: helo_access is defined
189188
block:
190189
- name: Create HELO access whitelist

tasks/poweradmin.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
- name: Get latest PowerAdmin version
3-
# checkov:skip=CKV2_ANSIBLE_3: Block is used for the when condition only
43
tags:
54
- dyndns
65
- poweradmin

tasks/read_wireguard_config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
path: "{{ wg_config_file }}"
55
register: wg_config_file_info
66
- name: Read existing WireGuard config into variable
7-
# checkov:skip=CKV2_ANSIBLE_3: Block is only used for the when condition
87
when: wg_config_file_info.stat.exists
98
block:
109
- name: Read WireGuard config file

tasks/webdav.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
state: mounted
8181
fstype: fuse.bindfs
8282
- name: Set up SELinux rules for WebDAV
83-
# checkov:skip=CKV2_ANSIBLE_3: Block is only used for the when condition and the tags
8483
tags: wireguard
8584
when: getenforce.stdout != 'Disabled'
8685
block:

0 commit comments

Comments
 (0)