Skip to content

Commit a9245d6

Browse files
authored
Pass OIDC environment variables to proxy (#519)
This change passes the `ACTIONS_ID_TOKEN_REQUEST_TOKEN` and `ACTIONS_ID_TOKEN_REQUEST_URL` from GitHub Actions to the Dependabot proxy container. It's the first part of the feature to allow to proxy to use OIDC federated credentials for authentication to private registries. Eqivalent of github/dependabot-action#1544 References: - [Configuring OpenID Connect in cloud providers][1] - [OpenID Connect reference][2] [1]: https://docs.github.com/en/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-cloud-providers#requesting-the-jwt-using-environment-variables [2]: https://docs.github.com/en/actions/reference/security/oidc#methods-for-requesting-the-oidc-token
1 parent aec0a60 commit a9245d6

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

internal/infra/proxy.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"io"
8+
"log"
9+
"os"
10+
"path"
11+
"path/filepath"
12+
713
"github.com/docker/docker/api/types/container"
814
"github.com/docker/docker/api/types/mount"
915
"github.com/docker/docker/api/types/network"
1016
"github.com/docker/docker/client"
1117
"github.com/goware/prefixer"
1218
"github.com/moby/moby/pkg/namesgenerator"
1319
"github.com/moby/moby/pkg/stdcopy"
14-
"io"
15-
"log"
16-
"os"
17-
"path"
18-
"path/filepath"
1920
)
2021

2122
const proxyCertPath = "/usr/local/share/ca-certificates/custom-ca-cert.crt"
@@ -85,6 +86,8 @@ func NewProxy(ctx context.Context, cli *client.Client, params *RunParams, nets *
8586
"JOB_ID=" + jobID,
8687
"PROXY_CACHE=true",
8788
"LOG_RESPONSE_BODY_ON_AUTH_FAILURE=true",
89+
"ACTIONS_ID_TOKEN_REQUEST_TOKEN=" + os.Getenv("ACTIONS_ID_TOKEN_REQUEST_TOKEN"),
90+
"ACTIONS_ID_TOKEN_REQUEST_URL=" + os.Getenv("ACTIONS_ID_TOKEN_REQUEST_URL"),
8891
},
8992
Entrypoint: []string{
9093
"sh", "-c", "update-ca-certificates && /update-job-proxy",

0 commit comments

Comments
 (0)