Skip to content

Instantly share code, notes, and snippets.

@dz0ny
Forked from srgvg/util-bash-vuln-upgrade.yml
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dz0ny/fb910f0205591855461f to your computer and use it in GitHub Desktop.
Save dz0ny/fb910f0205591855461f to your computer and use it in GitHub Desktop.
---
- hosts: all
gather_facts: false
name: CVE-2014-6271 bash vulnerability fix
tasks:
- name: check bash fix
command: env ls='() { echo vulnerable; }' bash -c ls
register: command_result
changed_when: False
failed_when: False
- name: update apt cache and upgrade bash
apt: update_cache=yes name=bash state=latest cache_valid_time=7200
when: "'error' not in command_result.stderr"
register: apt_update
- name: fix libs
command: /sbin/ldconfig
when: apt_update|changed
- name: check bash fix
command: env ls='() { echo vulnerable; }' bash -c ls
register: command_result
failed_when: "'error' not in command_result.stderr"
changed_when: False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment