Skip to content

Instantly share code, notes, and snippets.

@phips
Created October 22, 2014 21:00
Show Gist options
  • Save phips/3297e7910da78556e222 to your computer and use it in GitHub Desktop.
Save phips/3297e7910da78556e222 to your computer and use it in GitHub Desktop.
Quick Ansible check for Shellshock
---
- hosts: all
gather_facts: no
tasks:
- name: Check for Shellshock vulnerability
command: env x='() { :;}; echo vulnerable' bash -c "echo ok"
register: result
- name: Skip if not vulnerable
debug: msg="This host is vulnerable, patch bash"
when: '"vulnerable" in result.stdout'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment