Skip to content

Instantly share code, notes, and snippets.

@srgvg
Last active August 16, 2019 13:35
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save srgvg/4d441117e56c1b3f3836 to your computer and use it in GitHub Desktop.
Save srgvg/4d441117e56c1b3f3836 to your computer and use it in GitHub Desktop.
deb playbook to fix CVE-2014-6271 bash remote execution vulnerability
---
- hosts: all
gather_facts: false
name: CVE-2014-6271 bash vulnerability fix
tasks:
- name: check bash fix
command: env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
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 x='() { :;}; echo vulnerable' bash -c "echo this is a test"
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