https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • a

    Akarys

    04/20/2023, 10:49 AM
    What would be the best way to do that?
  • a

    Akarys

    04/20/2023, 10:49 AM
    The most naive way I can think is allow all the audit peeps have read access to the worker code and checking whether it matches
  • a

    Akarys

    04/20/2023, 10:50 AM
    But I don't know if that's doable with CF's pretty barebone access policies
  • h

    HardAtWork

    04/20/2023, 11:07 AM
    Give the team read-access to the repository?
  • a

    Akarys

    04/20/2023, 11:08 AM
    that doesn't prove someone from infra didn't inject code into the worker that's actually running
  • h

    HardAtWork

    04/20/2023, 11:11 AM
    Maybe have a service that runs the API call?
  • h

    HardAtWork

    04/20/2023, 11:12 AM
    If the deployment runs in Actions, you could probably just let them inspect the repo, since any steps taken to inject something into the script would also show up in the repo
  • g

    geg

    04/20/2023, 11:12 AM
    But now what if someone had a spy working for Cloudflare that did a switcharoo with the code behind the curtains
  • h

    HardAtWork

    04/20/2023, 11:13 AM
    And also because most Workers are very difficult to inspect once they are deployed, since they may be minified, include a D1 stub, have random patches of binary, etc
  • h

    HardAtWork

    04/20/2023, 11:13 AM
    So it might be more efficient to audit the pipeline and the source, rather than trying to audit the built output
  • a

    Akarys

    04/20/2023, 11:16 AM
    aren't worker builds reproducible?
  • h

    HardAtWork

    04/20/2023, 11:17 AM
    Not without the build pipeline
  • h

    HardAtWork

    04/20/2023, 11:17 AM
    You can probably guess at what dependencies were used
  • h

    HardAtWork

    04/20/2023, 11:17 AM
    But for stuff like WebAssembly, it would be very difficult to reverse without the source
  • a

    Akarys

    04/20/2023, 11:18 AM
    I am OK with having the worker use a specific type if it means it is reproducible/auditable
  • h

    HardAtWork

    04/20/2023, 11:19 AM
    I’m not sure what you mean, “a specific type”?
  • a

    Akarys

    04/20/2023, 11:23 AM
    I mean barebone JS vs webpack vs webassembly, etc..
  • h

    HardAtWork

    04/20/2023, 11:25 AM
    I mean, it’s not so much that. It is more that it is a lot easier to audit a Worker when it is split into multiple files, the function/variable names are intact, etc. Most build tools minify your script, since JS runtimes don’t actually care about the names of stuff, but that means it is much harder for a human to read
  • h

    HardAtWork

    04/20/2023, 11:25 AM
    And not using said build tools greatly reduces the amount of work you can do with a single Worker
  • a

    Akarys

    04/20/2023, 11:25 AM
    sorry if that wasn't clear but the code will be public
  • a

    Akarys

    04/20/2023, 11:26 AM
    my thought process was to have auditors build the worker locally and check whether it matches the (minified or not) code running on Cloudflare
  • h

    HardAtWork

    04/20/2023, 11:26 AM
    Oh, like that
  • h

    HardAtWork

    04/20/2023, 11:26 AM
    That should be fine
  • h

    HardAtWork

    04/20/2023, 11:27 AM
    Most build tools should be deterministic, as long as you don’t update them
  • h

    HardAtWork

    04/20/2023, 11:27 AM
    Though again, not 100% sure how that tracks to WebAssembly
  • s

    Skye

    04/20/2023, 11:34 AM
    The same code with the same versions of dependencies and bundler should always produce the same output
  • a

    Akarys

    04/20/2023, 12:36 PM
    can I give some team members the capacity to only read the worker code?
  • k

    kian

    04/20/2023, 12:47 PM
    Nada
  • k

    kian

    04/20/2023, 12:47 PM
    You can give them write access to all Workers or read access to all of the account
  • r

    Rushmead

    04/20/2023, 2:28 PM
    Is anyone aware of a way to grab the zero trust auth token from inside the worker behind it?
1...240524062407...2509Latest