Coder Social home page Coder Social logo

Comments (10)

varunsh-coder avatar varunsh-coder commented on June 26, 2024 3

Thanks for reporting, @sozercan! It looks like MCR decides at runtime what location to pull from.

Investigating this issue is in the backlog and we will get to it soon.

@h0x0er please investigate this next. Thanks!

from harden-runner.

varunsh-coder avatar varunsh-coder commented on June 26, 2024 1

@h0x0er is working on implementing this feature. We plan to release it in two week. I will share rc build to try out in a few days.

from harden-runner.

varunsh-coder avatar varunsh-coder commented on June 26, 2024 1

This feature is now available on the rc tag. Here are a couple of examples. Please try it out and let me know if you have any feedback or questions.

https://github.com/harden-runner-canary/secure-repo-1/blob/166fc181bd964106b97a7dfe5fb13c94b4f20d9d/.github/workflows/release.yml#L23

https://github.com/harden-runner-canary/nvm/blob/72beb77f654e5cdbfa5f259f36eec20f2ca95493/.github/workflows/lint.yml#L32

from harden-runner.

varunsh-coder avatar varunsh-coder commented on June 26, 2024

Hi @jauderho, can you please share a link to a workflow where you observed this? Thanks!

from harden-runner.

jauderho avatar jauderho commented on June 26, 2024

Interesting, harden-runner does not actually capture the subdomain in the harden-runner output: https://app.stepsecurity.io/github/jauderho/dockerfiles/actions/runs/3965278228

But this can be see in the GHA output: https://github.com/jauderho/dockerfiles/actions/runs/3965278228/jobs/6794861825#step:20:51

This is for a successful run where mcr.microsoft.com resolves to eastus.mcr.microsoft.com

from harden-runner.

jauderho avatar jauderho commented on June 26, 2024

This is for an unsuccessful run. I just enabled telemetry and set to block.

As you can see from the harden-runner output, only mcr.microsoft.com shows up in the recommended policy for allowed-endpoints but not eastus.data.mcr.microsoft.com.

from harden-runner.

sozercan avatar sozercan commented on June 26, 2024

seeing the same issue after changing egress policy to block while allowlisting mcr.microsoft.com

https://github.com/Azure/eraser/actions/runs/4028112467/jobs/6924673782#step:10:31

from harden-runner.

h0x0er avatar h0x0er commented on June 26, 2024

@varunsh-coder, I found that mcr.microsoft.com is used for content-discovery, whereas in order to download image blobs various region specific content-delivery endpoints are used.

The structure of content-delivery endpoints is <region>.data.mcr.microsoft.com. List of regions can be found here.

On executing the below command you will notice; a call to content-discovery endpoints redirects to region specific content-delivery endpoint.

curl https://mcr.microsoft.com/v2/dotnet/aspnet/blobs/sha256:ac9a37082c6dec16dd5bd45d54a08f2e479d37222f2732f5b464e9dd5d454f0a

Ref:

  1. https://github.com/microsoft/containerregistry/blob/main/client-firewall-rules.md
  2. https://github.com/microsoft/containerregistry/blob/main/docs/mcr-endpoints-guidance.md

from harden-runner.

varunsh-coder avatar varunsh-coder commented on June 26, 2024

I have updated the title to a more generic feature - Support wildcard domains.

from harden-runner.

varunsh-coder avatar varunsh-coder commented on June 26, 2024

This has been released in v2.4.0
https://docs.stepsecurity.io/harden-runner/how-tos/block-egress-traffic#support-for-wildcard-domains

from harden-runner.

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.