woodpecker-ci / woodpecker

Woodpecker is a simple, yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
4.07k stars 353 forks source link

[Important] Limit secret access to plugins only #1071

Closed 6543 closed 1 year ago

6543 commented 2 years ago

similar to the images filter for secrets, add a checkbox to only inject secret if step is exec as plugin.

this ensure only the intended entry-point do get the secrets to handle.

this does help if a plugin is not based from scratch image but do contain an shell that could be used.


bounty: 50$

anbraten commented 2 years ago

I don't see how this could protect secrets? You could just create a plugin (normal docker image) that leaks the secrets, couldn't you?

lafriks commented 2 years ago

this could be helpful in combination with trusted images ex. currently setting trusted image woodpeckerci/plugin-git you can still use:

image: woodpeckerci/plugin-git
commands:
  - echo ${SECRET}

adding such option would prevent that

6543 commented 2 years ago
image: woodpeckerci/plugin-git
commands:
  - echo ${SECRET} | base58

-> it's a trusted image -> secret is leaked (you just have to decode it again)

I dont like to go more into details what else you could do ... - but It's a open risk (if repo is not gated)!

6543 commented 1 year ago

bounty: 50$