-
Notifications
You must be signed in to change notification settings - Fork 0
/
check.yml
38 lines (32 loc) · 805 Bytes
/
check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
- name: 'Test for CVE-2015-0235 (GHOST) vulnerability'
hosts: all
sudo: True
tasks:
- name: check for gcc
stat:
path: /usr/bin/gcc
register: gcc
failed_when: not gcc.stat.exists
- name: copy over GHOST.c
copy:
dest: /tmp/GHOST.c
src: files/GHOST.c
owner: root
group: root
mode: 0644
- name: compile GHOST
command: gcc /tmp/GHOST.c -o /tmp/GHOST
- name: run GHOST vulnerability checker
command: /tmp/GHOST
register: GHOST
- name: cleanup GHOST files
file:
name: /tmp/{{ item }}
state: absent
with_items:
- GHOST.c
- GHOST
- debug:
msg: "This machine is {{ GHOST.stdout }}."
failed_when: "GHOST.stdout == 'vulnerable'"