Skip to content

Commit

Permalink
feat: Assert no Malware - Create Binary Directory - Binary executable…
Browse files Browse the repository at this point in the history
… flag
  • Loading branch information
SamJUK committed Jul 9, 2024
1 parent bab0cc0 commit fda6665
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ecomscan_binary_source: https://ecomscan.com/downloads/linux-amd64/ecomscan
ecomscan_binary_directory: ~/bin
ecomscan_binary_path: ~/bin/ecomscan
ecomscan_key: trial
ecomscan_report_email: root@localhost.local
Expand Down
14 changes: 13 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
---
- name: Ensure users bin directory exists
ansible.builtin.file:
path: "{{ ecomscan_binary_directory }}"
state: directory
mode: '0755'

- name: Download the Ecomscan binary
ansible.builtin.get_url:
url: "{{ ecomscan_binary_source }}"
dest: "{{ ecomscan_binary_path }}"
mode: '0644'
mode: '0744'

- name: Perform Ecomscan
ansible.builtin.command:
Expand All @@ -21,3 +27,9 @@
- name: Summary
ansible.builtin.debug:
msg: "{{ scan.stdout_lines | select('match', '^>> Found:.*') | first }}"

- name: Assert No Malware
ansible.builtin.assert:
that: "'MALWARE' not in scan.stdout"
fail_msg: "❌ Malware found"
success_msg: "✅ No Malware Found"

0 comments on commit fda6665

Please sign in to comment.