I have below python script which just run the external shell script. script.sh is a simple shell script which performs some operations. But anyone can write some malicious code inside the script to delete some file or making some random network call, etc.
import os
def main():
os.system("sh script.sh")
So, I am finding some way to run the this kind of script in a isolated environment from my python code which block the script to accessing the file from the host system (sandbox). Is there any way to achieve this in python?
Thank in advance.