Add_ssh_keys security


#1

In the documentation, it’s described how to add keys to the container to be able to have greater control. https://circleci.com/docs/2.0/configuration-reference/#add_ssh_keys
This adds the private keys configured in the UI to filesystem.

In our organization, anyone can push on feature branches. This makes it possible for them to add the following lines to the config.yml file and dump all the private keys which were configured.
add_ssh_keys
cat ~/.ssh/*

Is there a recommended flow or setup to avoid this?


#2

SSH keys can be added in the GUI, in which case they are encrypted at rest. Is this what you’re looking for?

https://circleci.com/docs/2.0/add-ssh-key/


#3

No.
Private keys added in the GUI can be printed to terminal by anyone who can trigger a build, by adding these lines to the yml file.

add_ssh_keys
cat ~/.ssh/*

That’s not what we want because the private keys need to stay secret. How can this be prevented?


#4

Thanks for the question - we don’t have a recommended way to work round this right now. The working assumption is that anyone with commit and push permissions can see details about the project build.

We plan to add ‘permissions’ to Contexts at some point but I don’t have an ETA right now: https://circleci.com/docs/2.0/contexts/

You may like to add this as a feature request for better visibility: https://circleci.com/ideas/


#5

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.