I want to confirm that my thoughts are correct as this is about security matter.
We have web based application which is using db2 database. db2 runs under the
Now we want users of the web application to be able to restore db2 backup images into a database that we call playschool. Using this playschool they "play around" and make no harm to the production database. To do so PHP script
db2restore needs to be executed via PHP function
Is it secure enough to make sure that no one can misuse and run db2 commands as PHP user if:
we add this line to
php ALL=(db2inst1) NOPASSWD: /opt/eduserver/bin/db2restore
and then run inside PHP
db2restorescript this command
exec('sudo -u db2inst1 /opt/eduserver/bin/db2restore');
- that not all end users will have access to run db2restore via web interface, only admin group where they 'should' know what they are doing.
- no end user had access to command line of the server.
- db2restore is not accessible via web server