Code Monkey home page Code Monkey logo

Comments (8)

praveen-livspace avatar praveen-livspace commented on June 3, 2024 1

IMO, we should have a config to enable or disable deployment on PRs. We can keep it disabled by default. However, for private environments the risk is minimal.

from woodpecker.

qwerty287 avatar qwerty287 commented on June 3, 2024

We disabled PR deployments due to security concerns, because it would allow you to access deploy secrets even if you're not a repo admin.
To be honestly, I don't see a good way to prevent this except a new repo config with a warning that this can leak your secrets.
Do you have any idea?

from woodpecker.

anbraten avatar anbraten commented on June 3, 2024

Deploy uses secrets enabled for the deploy event. Clicking the deloy button can be done by every repo member (not by externals), right?

from woodpecker.

qwerty287 avatar qwerty287 commented on June 3, 2024

Clicking the deloy button can be done by every repo member (not by externals), right?

Yes. So you can access any secret if you have push perms but they should only be available with admin perms.

from woodpecker.

anbraten avatar anbraten commented on June 3, 2024

So you can access any secret if you have push perms

I might be wrong, but aren't just secrets with the deploy filter exposed to the compiler?

from woodpecker.

qwerty287 avatar qwerty287 commented on June 3, 2024

I might be wrong, but aren't just secrets with the deploy filter exposed to the compiler?

I'm not sure about this, but how is this important?

The workflow to get a secret that's only intended for deployments would be:

  1. Open a PR with a malicious woodpecker config (e.g. sending secret value to a remote server)
  2. Wait until the pipeline finished
  3. Click the "deploy" button
  4. The same pipeline will be executed with the deploy event and thus has access to all deploy secrets

from woodpecker.

anbraten avatar anbraten commented on June 3, 2024

Click the "deploy" button

As clicking the deploy button can only be done by a repo member.

Isn't it the same risk as this:

  • A member pushes to a branch
  • Wait until the pipeline finished
  • Click the "deploy" button
  • ...

from woodpecker.

qwerty287 avatar qwerty287 commented on June 3, 2024

Isn't it the same risk as this:

In general, yes, however, you can easily block that using branch protections. Blocking PRs is much harder and probably nobody will do it as it drastically reduces usability.

Maybe it's the best idea to be able to disable the deploy button completely, but if it's enabled allow all events? And add a warning similar to PR secrets?

from woodpecker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.