I have a Python script that interacts with the API. The script is launched from the PHP page. I wrote both scripts, so I can change the code anyway.
Python script requires username and password to interact with the API. My first wish is to pass them to Python as CLI arguments:
<?php
exec('python someScript.py AzureDiamond hunter2');
?>
However, everyone can see the credentials through ps:
$ ps | grep someScript
1000 23295 2.0 0.2 116852 9252 pts/0 S+ 15:47 0:00 python someScript.py AzureDiamond hunter2
The alternatives I am considering is writing the data to a text file or sqlite database and then deleting it. Are there any better ideas? The limitation with the sqlite approach is that this needs to be done in a fairly portable way (phpFox plugin), and most budget web hosts do not support the module sqlite3.