How safe is running doctl inside a kubernetes container?

tl;dr: Is it safe to have a doctl access token in a secret inside kubernetes? What is a good alternative?

I have my domain with mrdomain, I can’t change the dns to use digital ocean’s because to keep using the email from mrdomain they need to manage the domain. I want to use the spaces with CDN and i’m using lets encrypt to generate SSL certs once every 2 months.

I’ve written a container to be run on a CronJob that:

  • Generates an SSL cert manually;
  • Uploads to the space;
  • Validates the cert;
  • Creates the cert on my account;
  • Assign the cert to the corresponding space;
  • Removes the old invalid cert

It works fine, but I need to run doctl compute certificate create, doctl compute cdn update and doctl compute certificate delete. Those 3 commands need a token with write permission.

If anyone get access to this token they will have unlimited access to wreak havoc on our account.

So my question is, is it safe to keep this under a kubernetes secret? Is there a better option?

Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer