Forum Discussion
REST API authorization in a cronjob, recommendation
I'd like to run an automatic script via cronjob to trigger REST API calls on a BIG-IQ (the script is located on the BIG-IQ itself).
What possibilities are available in regards to authorization, especially from a security point of view, meaning avoiding placing credentials in the script. Is there maybe an option to use mutual SSL as trust?
Right now doing manual testing I first create a token with basic credentials and then doing the REST-call with this token.
But having an automatic script, there is no posibility to enter the password, means it needs to be placed somewhere.
Any ideas would be very helpful.
Thank you!
Regards Stefan 🙂
- Stefan_KlotzCumulonimbus
Thanks Nikoolayy1 , sound promising. And from what I read so far this also works automatically with requests-function in python. But can I also put the credentials into variables to use it somewhere else other then in the Basic Authorization header? I'm asking, because the credentials need to be included in the json-body of the token-request and not as part of the Authorization header.
Regards Stefan 🙂
I have not done it in a json body but there seems to be examples on the Internet like:
Better check the security things for Linux curl as there are some ways like netrc files or using environmental variable for user:pass.
https://linuxhint.com/curl-username-password/
Outside of that make a new user with the correct role to limit what the script can do
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com