Skip to content

Commit

Permalink
corrected loop issue to loop through all CVE
Browse files Browse the repository at this point in the history
  • Loading branch information
adworjan committed Nov 16, 2023
1 parent a4100f0 commit 7a55ded
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .ansible-sign/sha256sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ a8a29037770b73ab1e0ad0f05ae721e6430d7cc732dabbe22320840483fa8080 alertmanager.y
b30ff084240d998e18bedf88c056f3b438205fef6bfe22d7e1cd663d83ad191b nodeexporter_stop.yml
8f9129583653af0ef47a35e953bd3a2f8ac996c734f0a84f7418cfebae933bd9 passwd_restore.yml
6a584e1238c230b215f1231a8875aadcac9465af36b54d3bd23e4eb2677acb59 roles/insights_cve/defaults/main.yml
e37413361b0cd14779a47a1f125c918a79b08e71db2b071b234d0171463dc756 roles/insights_cve/tasks/main.yml
05f3b3a208f01a754c5ef96b423a2578ec90aebdd48daf394d51f091f1c7e5e3 roles/insights_cve/tasks/main.yml
1c9a1e26a6953f074315201347d5e1a3070170425b60b8ee0ee1a96de1443107 roles/insights_cve/tasks/remediation.yml
0bf80df4832bf561f376710842e657ac6224d2f84d60b8f1d6abd888f6df3479 roles/insights_cve/templates/pb_generator_body.j2
10831b191942119573948bc7eb9779879207c25a8deb6bc7d1e1153bfdfec3f6 roles/servicenow_ticket/defaults/main.yml
Expand Down
22 changes: 11 additions & 11 deletions .ansible-sign/sha256sum.txt.sig
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
-----BEGIN PGP SIGNATURE-----

iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmUpeRgACgkQTiIiIXrU
DNH5AAv/eM+B8/xweDrul6iRPP4k+j4ur6cGBm5tSXkqSPnUR42waxL7e43cXeQ1
asPbAykM8nusDi8MOqm7RR484E4EB3MfOa4RFkFGsQBMcTCCdxMdwiChAWkTAr5b
Pcz/O2Qk57bM5RCNATL6LueXpWwKZcvRDzAd1sfw2hgvNSgOp2tu9PLLCngTjQrg
WAwz/sIES8PswqEev95+jZbffk3/3sqgnZ+33fzCg6+vzJGZ74CV5Gn+5npxqTNW
umqDTZMrnXpGXBW4bnx9jIYlGxzkbG77GGAribphtvCuPDMZspaK7zDTkWFf3QVj
4CXeNhpHap1Au7qtgV0bp51HWDc8SfN1JZdGyZvE8LxClt7Csf33FmFhTKP/rk2s
tgCsZmR5msTzILTrlOoOIrPOfayBPhvt+Ua2Qjy7XTa4H7bezdMPOTZfcSOnzu1/
RYoPax5pgZ8TAbas2Uj8kMMCpKmH9p3irSKD0ZuWOaZeUtgPe8AfTmq6xcPNshyp
qOKRXJ0t
=LKjL
iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmVWZ40ACgkQTiIiIXrU
DNERWwv/cx3jSzqSXYGgV0/VrnAiQtcVItPHuezd+qVXlmY0wRKmwiUm1lnfmjuO
KLJAZKCpibkJuMZDLZS7op8OkHKKRZ3plTymPMnJfWpui6XUYJLm2YdpzQU7pFNE
X6QCIcNoU6DYsIjd3gY6XFTSOgPezgdKKbN1mysum7ByIjGbJ1zIPzLa2g/HM+mJ
hLvuaQDtoTvJEoQo0kWq1XZVBpEzpSUCqNSsgkMB6N80VzmKUXD0wOQG8PjZPbtM
h17s75mowerDfcn+iNqogcYWSR1RyHPHdDbjfGdGTkQJx4aqiv0EWCmOpcSsH4nS
jFa1JhQba1Kl2DkAd8RCYkljYEfwdsXhEnHF+f/V9ZmE6h3v2G+fBt3YUXLz9nwj
NXdQNqi3R29+GtzZlnNAFBYH4RwjBOghuxgEAky1NE/2hiLZ5ZY39hqQOZU4LeIG
X3lkgpqAXpneh6vpe8twPVB5FAQsVh2LU+TH8i8yiXTAPOB38YLY5jgSbICyAhsM
3uSFKaTb
=rj+r
-----END PGP SIGNATURE-----
7 changes: 3 additions & 4 deletions roles/insights_cve/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
block:
- name: Print out the total number of security CVEs with severity >= 3 for host "{{ insights_adv_target_host }}"
ansible.builtin.debug:
msg: "Detected {{ cve_list | length }} security CVEs with severity >= 3 out of {{ hosts_with_cve }} for host {{ insights_adv_target_host }}"
loop: "{{ cve_list }}"
msg: "Detected {{ cve_list | length }} security CVEs with severity >= 3 for host {{ insights_adv_target_host }}"
delegate_to: localhost

- name: Send notification message via Mattermost on CVE Issue

Check failure on line 68 in roles/insights_cve/tasks/main.yml

View workflow job for this annotation

GitHub Actions / build

syntax-check[specific]

couldn't resolve module/action 'community.general.mattermost'. This often indicates a misspelling, missing collection, or incorrect module path.
Expand Down Expand Up @@ -100,7 +99,7 @@
body_format: json
body: "{{ lookup('ansible.builtin.template', 'templates/pb_generator_body.j2') }}"
register: pbs_per_host
loop: "{{ cve_list | first | split }}"
loop: "{{ cve_list }}"
delegate_to: localhost

- name: Launch a project update from Red Hat Insights
Expand All @@ -112,7 +111,7 @@

- name: Perform remediation tasks using AAP
ansible.builtin.include_tasks: remediation.yml
loop: "{{ cve_list | first | split }}"
loop: "{{ cve_list }}"
loop_control:
index_var: my_idx

Expand Down

0 comments on commit 7a55ded

Please sign in to comment.