This commit is contained in:
15
tasks/main.yml
Normal file
15
tasks/main.yml
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
# tasks file for verify
|
||||
|
||||
- name: Gather facts on listening ports
|
||||
become: yes
|
||||
community.general.listen_ports_facts:
|
||||
|
||||
- name: TCP denylist violation
|
||||
ansible.builtin.debug:
|
||||
msg: TCP port {{ item.port }} by pid {{ item.pid }} violates the denylist
|
||||
vars:
|
||||
tcp_listen_violations: "{{ ansible_facts.tcp_listen | selectattr('port', 'in', tcp_denylist) | list }}"
|
||||
tcp_denylist:
|
||||
- 111
|
||||
loop: "{{ tcp_listen_violations }}"
|
Reference in New Issue
Block a user