Created
February 14, 2019 00:48
-
-
Save cmattoon/6ff83978ee7cdb24610383b1fadcaf70 to your computer and use it in GitHub Desktop.
CVE-2019-5736 - Apply patch with Fabric
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
#!/usr/bin/env python | |
import os | |
from fabric import Connection | |
# kubectl get nodes | grep ip | cut -d'-' -f2,3,4,5 | cut -d'.' -f1 | sed 's/-/./g' | xargs echo | sed s'/ /",\"/g' | |
def getConnection(host): | |
return Connection(host=host, | |
user='admin', | |
connect_kwargs={ | |
'key_filename': '/Users/cmattoon/keys/k8s-admin-key' | |
}) | |
for host in hosts: | |
conn = getConnection(host) | |
conn.sudo('cp $(which docker-runc){,.$(date -I)}') | |
conn.run('curl -sL https://github.com/rancher/runc-cve/releases/download/CVE-2019-5736-build2/runc-v17.03.2-amd64 > /tmp/runc') | |
conn.sudo('chmod +x /tmp/runc') | |
conn.sudo('mv /tmp/runc $(which docker-runc)') | |
conn.run('docker-runc -v') | |
conn.sudo('docker info') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment