Questions on how I will store when a script was executed and for it to check if the script is authorized to access the database

What I want to achieve is to keep a database each time my script is executed.

I plan to use firebase to store this data. Any other suggestions would be greatly appreciated.

I’m also trying to have my script contact my database and it will send a key to the script that will allow it to be executed. i.e. the script will have a predetermined list of what the script is supposed to have in it and it will contact the database asking if it can execute, if the database says no, it will delete the script and log the failed attempt

I don’t really know how to get started, if anyone could point me towards some resources or instruct me on how to do it would be greatly appreciated. Thank you

Also to clarify, I’m putting it as a security precaution. “Well it’s not needed” in my eyes it is.