libertymutual / ssh-key-enforcer-stash

Layers additional controls over Bitbucket's SSH key features that enforce the stronger controls required in an enterprise environment.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scheduled Service for Bamboo Keys to Regenerate Keys

eddiewebb opened this issue · comments

Requires #7

Once keys are tracked the scheduled job should delete existing keys and then re-generate from bamboo's side.

This may need a plugin in bamboo. We can use the stash plugin in bamboo to get a list of all connected repos, but no way to edit/update them in bamboo unless we spoof a form submission to the editrpeository action. Even a plugin on the bamboo would need to override stash reposiroty to hit our service or somehow make a save call to the repostory action.

Now that bamboo saves keys to Repos we can:

  • Get BAMBOO keys older than MAXTIME
  • Save stashKeyID, and use to call BB API for /rest/keys/1.0/ssh/{ID}/repos
  • Save Bamboo project plan from ^^
  • Purge Key
  • Call bamboo (APIS?) to generate a new key for that build plan's configured repository

** can we get plan details at creation time and save as meta? **