How to restrict token use withint applications of specific IP address?

November 17, 2019 151 views
DigitalOcean API and CLI (doctl)

I am using digital ocean’s python api. I generated a token and successfully created a couple of droplets using snapshots.
In order to make the use of the token safer, is there a way to restrict the use of the token from specific ip addresses?
In other words,is it possible to add the ip addresses of the machines allowed to use the token?
Thanks in advance

1 Answer

Hello,

I don’t think that this is currently possible. You could share your idea here:

https://ideas.digitalocean.com/ideas/

What I could suggest in the meantime, is keeping your API key in a separate file, for example, use config.py and then add that config.py file to your gitignore so that the file only gets uploaded to your server.

Regards,
Bobby

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!