Created
September 26, 2014 19:51
-
-
Save jondlm/3bcce92083e8bb183a8b to your computer and use it in GitHub Desktop.
ShellShock fix Ansible playbook for CentOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
gather_facts: false | |
sudo: true | |
tasks: | |
- name: check for shellshock bash vulnerability | |
shell: executable=/bin/bash env x='() { :;}; echo vulnerable' bash -c "echo this is a test" | |
register: test_vuln | |
- name: update bash from yum if vulnerable | |
yum: name=bash | |
state=latest | |
when: "'vulnerable' in test_vuln.stdout" | |
- name: Check again and fail if we are still vulnerable | |
shell: executable=/bin/bash env x='() { :;}; echo vulnerable' bash -c "echo this is a test" | |
when: "'vulnerable' in test_vuln.stdout" | |
register: test_vuln | |
failed_when: "'vulnerable' in test_vuln.stdout" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Borrowed heavily from https://github.com/edx/configuration/blob/master/playbooks/roles/security/tasks/security-ubuntu.yml