Coder Social home page Coder Social logo

Comments (3)

sethvargo avatar sethvargo commented on July 20, 2024

The default behavior for Berglas auto (and berglas exec) is to look up the environment as set by the deploying user. Berglas queries the GCP API for Cloud Run and gets the list of envvars set on the service deployment. This protects against a threat where an attacker injects berglas references into environment variables.

I don't quite understand your point about Cloud Functions. Cloud Functions also need viewer permissions on themselves. If the GCF SA has no permissions, neither auto nor exec will work.

If you want to accept the risk of the environment being modified, you can use berglas exec --local which will parse all local vars and won't need viewer permissions. However, even then, the GCF SA would still need permissions to talk to GCS and KMS.

from berglas.

dinvlad avatar dinvlad commented on July 20, 2024

I see, thanks - we’re using Berglas with a Python app in Cloud Run, so have to apply berglas exec -- form (in fact, the main reason for our jump from GCF to Run was so that we could use Berglas with Python). That being said, I’ve only tried Berglas in Go locally (which works great), not in a GCF.

The main reason I’m asking is I wanted to avoid granting project-wide Run Viewer to each Run SA. However, I understand that the risk of env injection is also not to be overlooked.

from berglas.

sethvargo avatar sethvargo commented on July 20, 2024

Yea if you run berglas exec --local -- CMD then you won't need those viewer permissions.

from berglas.

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.