Skip to content

Instantly share code, notes, and snippets.

@oorryy
Last active June 24, 2019 22:20
Show Gist options
  • Save oorryy/2a473da57210732585895cd55df47a26 to your computer and use it in GitHub Desktop.
Save oorryy/2a473da57210732585895cd55df47a26 to your computer and use it in GitHub Desktop.
import os
import function_shield
import subprocess
function_shield.configure({
"policy": {
"read_write_tmp": "alert",
"create_child_process": "alert",
"outbound_connectivity": "alert",
"read_handler": "block"
},
"disable_analytics": False,
"token": os.environ['FUNCTION_SHIELD_TOKEN']
})
def hello(event, context):
print("started")
with open('/tmp/python-alert', 'w'):
pass
with open('/var/task/handler.py', 'r'):
pass
subprocess.Popen('touch /tmp/child-alert', shell=True)
os.system('curl google.com')
os.system('curl aws.amazonaws.com')
os.system('cat /var/task/handler.py')
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment