File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 5050 "PYTHON_RUNNER_TMPFS_MOUNT_SIZE_IN_BYTES" , "104857600"
5151)
5252DROPPED_CAPABILITIES = os .environ .get ('PYTHON_RUNNER_DROPPED_CAPABILITIES' , []).split (',' )
53+ NO_NEW_PRIVILEGES = os .environ .get ('PYTHON_RUNNER_NO_NEW_PRIVILEGES' , 'false' ).lower () == "true"
5354OTHER_OPTIONS = os .environ .get ("PYTHON_RUNNER_OTHER_OPTIONS" , "[]" )
5455try :
5556 OTHER_OPTIONS = ast .literal_eval (OTHER_OPTIONS )
@@ -311,6 +312,9 @@ def run_python(data):
311312 )
312313 if DROPPED_CAPABILITIES :
313314 command .extend (f'--cap-drop={ capability } ' for capability in DROPPED_CAPABILITIES )
315+ if NO_NEW_PRIVILEGES :
316+ # Prevent container from gaining additional privileges
317+ command .append ('--security-opt no-new-privileges' )
314318 # other options, these options are experimental, may cause failure to start script
315319 if OTHER_OPTIONS and isinstance (OTHER_OPTIONS , list ):
316320 for option in OTHER_OPTIONS :
You can’t perform that action at this time.
0 commit comments