-
-
Save oorryy/2a473da57210732585895cd55df47a26 to your computer and use it in GitHub Desktop.
This file contains 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
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