Skip to content

Commit 306edc7

Browse files
committed
Merge remote-tracking branch 'origin/master' into HEAD
2 parents 8249ab3 + 29c7b6f commit 306edc7

78 files changed

Lines changed: 4606 additions & 805 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/analysis-scorecard.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
steps:
2525
- name: Checkout repository
26-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2727
with:
2828
persist-credentials: false
2929

@@ -35,13 +35,13 @@ jobs:
3535
publish_results: true
3636

3737
- name: Upload results as artifact
38-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
38+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
3939
with:
4040
name: OpenSSF Scorecard results
4141
path: results.sarif
4242
retention-days: 5
4343

4444
- name: Upload results to GitHub Security tab
45-
uses: github/codeql-action/upload-sarif@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v3.29.5
45+
uses: github/codeql-action/upload-sarif@9e907b5e64f6b83e7804b09294d44122997950d6 # v3.29.5
4646
with:
4747
sarif_file: results.sarif

.github/workflows/artifacts.yaml

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,29 @@ jobs:
5151

5252
steps:
5353
- name: Checkout repository
54-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
54+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
55+
with:
56+
fetch-tags: true
5557

5658
- name: Set up QEMU
57-
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
59+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
5860

5961
- name: Set up Docker Buildx
60-
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
62+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
6163

6264
- name: Set up Syft
63-
uses: anchore/sbom-action/download-syft@f8bdd1d8ac5e901a77a92f111440fdb1b593736b # v0.20.6
65+
uses: anchore/sbom-action/download-syft@28d71544de8eaf1b958d335707167c5f783590ad # v0.22.2
6466

6567
- name: Install cosign
66-
uses: sigstore/cosign-installer@d7543c93d881b35a8faa02e8e3605f69b7a1ce62 # v3.10.0
68+
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
6769

6870
- name: Set image name
6971
id: image-name
7072
run: echo "value=ghcr.io/${{ github.repository }}" >> "$GITHUB_OUTPUT"
7173

7274
- name: Gather build metadata
7375
id: meta
74-
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
76+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
7577
with:
7678
images: |
7779
${{ steps.image-name.outputs.value }}
@@ -90,6 +92,12 @@ jobs:
9092
labels: |
9193
org.opencontainers.image.documentation=https://dexidp.io/docs/
9294
95+
# Multiple exporters are not supported yet
96+
# See https://github.com/moby/buildkit/pull/2760
97+
- name: Get version from git-version script
98+
id: version
99+
run: echo "value=$(bash ./scripts/git-version)" >> "$GITHUB_OUTPUT"
100+
93101
# Multiple exporters are not supported yet
94102
# See https://github.com/moby/buildkit/pull/2760
95103
- name: Determine build output
@@ -101,33 +109,34 @@ jobs:
101109
if_false: type=oci,dest=image.tar
102110

103111
- name: Login to GitHub Container Registry
104-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
112+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
105113
with:
106114
registry: ghcr.io
107115
username: ${{ github.actor }}
108116
password: ${{ github.token }}
109117
if: inputs.publish
110118

111119
- name: Login to Docker Hub
112-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
120+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
113121
with:
114122
username: ${{ secrets.DOCKER_USERNAME }}
115123
password: ${{ secrets.DOCKER_PASSWORD }}
116124
if: inputs.publish
117125

118126
- name: Build and push image
119127
id: build
120-
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
128+
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
121129
with:
122130
context: .
123131
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
124132
tags: ${{ steps.meta.outputs.tags }}
125133
build-args: |
126134
BASE_IMAGE=${{ matrix.variant }}
127-
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
135+
VERSION=${{ steps.version.outputs.value }}
128136
COMMIT_HASH=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
129137
BUILD_DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
130-
labels: ${{ steps.meta.outputs.labels }}
138+
labels: |
139+
${{ steps.meta.outputs.labels }}
131140
# cache-from: type=gha
132141
# cache-to: type=gha,mode=max
133142
outputs: ${{ steps.build-output.outputs.value }}
@@ -177,62 +186,73 @@ jobs:
177186

178187
# TODO: uncomment when the action is working for non ghcr.io pushes. GH Issue: https://github.com/actions/attest-build-provenance/issues/80
179188
# - name: Generate build provenance attestation
180-
# uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
189+
# uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0
181190
# with:
182191
# subject-name: dexidp/dex
183192
# subject-digest: ${{ steps.build.outputs.digest }}
184193
# push-to-registry: true
185194

186195
- name: Generate build provenance attestation
187-
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
196+
uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0
188197
with:
189198
subject-name: ghcr.io/${{ github.repository }}
190199
subject-digest: ${{ steps.build.outputs.digest }}
191200
push-to-registry: true
192201
if: inputs.publish
193202

203+
- name: Prepare image fs for scanning
204+
run: |
205+
docker load --input image.tar
206+
docker export $(docker create --rm ${{ steps.image-name.outputs.value }}@${{ steps.build.outputs.digest }}) -o docker-image.tar
207+
208+
mkdir -p docker-image
209+
tar -xf docker-image.tar -C docker-image
210+
194211
## Use cache for the trivy-db to avoid the TOOMANYREQUESTS error https://github.com/aquasecurity/trivy-action/pull/397
195212
## To avoid the trivy-db becoming outdated, we save the cache for one day
196213
- name: Get data
197214
id: date
198215
run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
199216

200217
- name: Restore trivy cache
201-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
218+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
202219
with:
203220
path: cache/db
204221
key: trivy-cache-${{ steps.date.outputs.date }}
205222
restore-keys: trivy-cache-
206223

207224
- name: Run Trivy vulnerability scanner
208-
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # 0.33.1
225+
uses: aquasecurity/trivy-action@c1824fd6edce30d7ab345a9989de00bbd46ef284 # 0.34.0
209226
with:
210-
input: image
227+
input: docker-image
211228
format: sarif
212229
output: trivy-results.sarif
213-
scan-type: "fs"
230+
scan-type: "rootfs"
214231
scan-ref: "."
215232
cache-dir: "./cache"
216233
# Disable skipping trivy cache for now
217-
# env:
218-
# TRIVY_SKIP_DB_UPDATE: true
219-
# TRIVY_SKIP_JAVA_DB_UPDATE: true
234+
env:
235+
TRIVY_SKIP_DB_UPDATE: true
236+
TRIVY_SKIP_JAVA_DB_UPDATE: true
220237

221238
## Trivy-db uses `0600` permissions.
222239
## But `action/cache` use `runner` user by default
223240
## So we need to change the permissions before caching the database.
224241
- name: change permissions for trivy.db
225242
run: sudo chmod 0644 ./cache/db/trivy.db
226243

244+
- name: Check Trivy sarif
245+
run: cat trivy-results.sarif
246+
227247
- name: Upload Trivy scan results as artifact
228-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
248+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
229249
with:
230250
name: "[${{ github.job }}] Trivy scan results"
231251
path: trivy-results.sarif
232252
retention-days: 5
233253
overwrite: true
234254

235255
- name: Upload Trivy scan results to GitHub Security tab
236-
uses: github/codeql-action/upload-sarif@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v3.29.5
256+
uses: github/codeql-action/upload-sarif@9e907b5e64f6b83e7804b09294d44122997950d6 # v3.29.5
237257
with:
238258
sarif_file: trivy-results.sarif

.github/workflows/ci.yaml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,30 @@ jobs:
6464
- 35357
6565
options: --health-cmd "curl --fail http://localhost:5000/v3" --health-interval 10s --health-timeout 5s --health-retries 5
6666

67+
vault:
68+
image: hashicorp/vault:1.21
69+
ports:
70+
- 8200
71+
env:
72+
VAULT_DEV_ROOT_TOKEN_ID: root-token
73+
VAULT_DEV_LISTEN_ADDRESS: "0.0.0.0:8200"
74+
options: --health-cmd "vault status -address=http://localhost:8200 || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5
75+
76+
openbao:
77+
image: quay.io/openbao/openbao:2.5
78+
ports:
79+
- 8210
80+
env:
81+
BAO_DEV_ROOT_TOKEN_ID: root-token
82+
BAO_DEV_LISTEN_ADDRESS: "0.0.0.0:8210"
83+
options: --health-cmd "bao status -address=http://localhost:8210 || exit 1" --health-interval 10s --health-timeout 5s --health-retries 5
84+
6785
steps:
6886
- name: Checkout repository
69-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
87+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7088

7189
- name: Set up Go
72-
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
90+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
7391
with:
7492
go-version: "1.25"
7593

@@ -86,7 +104,7 @@ jobs:
86104
run: docker compose -f docker-compose.test.yaml up -d
87105

88106
- name: Create kind cluster
89-
uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
107+
uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1.14.0
90108
with:
91109
version: "v0.17.0"
92110
node_image: "kindest/node:v1.25.3@sha256:cd248d1438192f7814fbca8fede13cfe5b9918746dfa12583976158a834fd5c5"
@@ -129,6 +147,11 @@ jobs:
129147
DEX_KEYSTONE_ADMIN_USER: demo
130148
DEX_KEYSTONE_ADMIN_PASS: DEMO_PASS
131149

150+
DEX_VAULT_ADDR: http://localhost:${{ job.services.vault.ports[8200] }}
151+
DEX_VAULT_TOKEN: root-token
152+
DEX_OPENBAO_ADDR: http://localhost:${{ job.services.openbao.ports[8210] }}
153+
DEX_OPENBAO_TOKEN: root-token
154+
132155
DEX_KUBERNETES_CONFIG_PATH: ~/.kube/config
133156

134157
lint:
@@ -137,10 +160,10 @@ jobs:
137160

138161
steps:
139162
- name: Checkout repository
140-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
163+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
141164

142165
- name: Set up Go
143-
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
166+
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
144167
with:
145168
go-version: "1.25"
146169

@@ -172,7 +195,7 @@ jobs:
172195

173196
steps:
174197
- name: Checkout repository
175-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
198+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
176199

177200
- name: Dependency Review
178-
uses: actions/dependency-review-action@40c09b7dc99638e5ddb0bfd91c1673effc064d8a # v4.8.1
201+
uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2

.github/workflows/trivydb-cache.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- cron: '0 0 * * *' # Run daily at midnight UTC
88
workflow_dispatch: # Allow manual triggering
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
update-trivy-db:
1215
runs-on: ubuntu-latest
@@ -33,7 +36,7 @@ jobs:
3336
rm javadb.tar.gz
3437
3538
- name: Cache DBs
36-
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
39+
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
3740
with:
3841
path: ${{ github.workspace }}/.cache/trivy
3942
key: cache-trivy-${{ steps.date.outputs.date }}

ADOPTERS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ This is a list of production adopters of Dex (in alphabetical order).
2323
- [LLMariner](https://llmariner.ai/) uses Dex for [user management](https://llmariner.ai/docs/features/user_management/).
2424
- [Pydio](https://pydio.com/) Pydio Cells is an open source sync & share platform written in Go. Cells is using Dex as an OIDC service for authentication and authorizations. Check out [Pydio Cells repository](https://github.com/pydio/cells) for more information and/or to contribute.
2525
- [sigstore](https://sigstore.dev) uses Dex for authentication in their public Fulcio instance, which is a certificate authority for code signing certificates bound to OIDC-based identities.
26+
- [Terrakube](https://docs.terrakube.io/) relies on Dex for [user authentication](https://docs.terrakube.io/getting-started/deployment/user-authentication-dex). Its Helm chart uses Dex as a dependency.

Dockerfile

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ARG BASE_IMAGE=alpine
22

3-
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.7.0@sha256:010d4b66aed389848b0694f91c7aaee9df59a6f20be7f5d12e53663a37bd14e2 AS xx
3+
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.9.0@sha256:c64defb9ed5a91eacb37f96ccc3d4cd72521c4bd18d5442905b95e2226b0e707 AS xx
44

5-
FROM --platform=$BUILDPLATFORM golang:1.25.3-alpine3.22@sha256:20ee0b674f987514ae3afb295b6a2a4e5fa11de8cc53a289343bbdab59b0df59 AS builder
5+
FROM --platform=$BUILDPLATFORM golang:1.26.0-alpine3.22@sha256:169d3991a4f795124a88b33c73549955a3d856e26e8504b5530c30bd245f9f1b AS builder
66

77
COPY --from=xx / /
88

@@ -35,27 +35,31 @@ RUN make release-binary
3535

3636
RUN xx-verify /go/bin/dex && xx-verify /go/bin/docker-entrypoint
3737

38-
FROM alpine:3.22.2@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412 AS stager
38+
FROM alpine:3.23.3@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659 AS stager
3939

4040
RUN mkdir -p /var/dex
4141
RUN mkdir -p /etc/dex
4242
COPY config.docker.yaml /etc/dex/
4343

44-
FROM alpine:3.22.2@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412 AS gomplate
44+
FROM alpine:3.23.3@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659 AS gomplate
4545

4646
ARG TARGETOS
4747
ARG TARGETARCH
4848
ARG TARGETVARIANT
4949

50-
ENV GOMPLATE_VERSION=v4.3.3
50+
ENV GOMPLATE_VERSION=v5.0.0
5151

5252
RUN wget -O /usr/local/bin/gomplate \
5353
"https://github.com/hairyhenderson/gomplate/releases/download/${GOMPLATE_VERSION}/gomplate_${TARGETOS:-linux}-${TARGETARCH:-amd64}${TARGETVARIANT}" \
5454
&& chmod +x /usr/local/bin/gomplate
5555

5656
# For Dependabot to detect base image versions
57-
FROM alpine:3.22.2@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412 AS alpine
58-
FROM gcr.io/distroless/static-debian12:nonroot@sha256:e8a4044e0b4ae4257efa45fc026c0bc30ad320d43bd4c1a7d5271bd241e386d0 AS distroless
57+
FROM alpine:3.23.3@sha256:25109184c71bdad752c8312a8623239686a9a2071e8825f20acb8f2198c3f659 AS alpine
58+
59+
FROM alpine AS user-setup
60+
RUN addgroup -g 1001 -S dex && adduser -u 1001 -S -G dex -D -H -s /sbin/nologin dex
61+
62+
FROM gcr.io/distroless/static-debian13:nonroot@sha256:01e550fdb7ab79ee7be5ff440a563a58f1fd000ad9e0c532e65c3d23f917f1c5 AS distroless
5963

6064
FROM $BASE_IMAGE
6165

@@ -66,6 +70,10 @@ FROM $BASE_IMAGE
6670
# See https://go.dev/src/crypto/x509/root_linux.go for Go root CA bundle locations.
6771
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
6872

73+
# Ensure the dex user/group exist before setting ownership or switching to them.
74+
COPY --from=user-setup /etc/passwd /etc/passwd
75+
COPY --from=user-setup /etc/group /etc/group
76+
6977
COPY --from=stager --chown=1001:1001 /var/dex /var/dex
7078
COPY --from=stager --chown=1001:1001 /etc/dex /etc/dex
7179

@@ -79,7 +87,7 @@ COPY --from=builder /usr/local/src/dex/web /srv/dex/web
7987

8088
COPY --from=gomplate /usr/local/bin/gomplate /usr/local/bin/gomplate
8189

82-
USER 1001:1001
90+
USER dex:dex
8391

8492
ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]
8593
CMD ["dex", "serve", "/etc/dex/config.docker.yaml"]

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ build: bin/dex ## Build Dex binaries.
3535

3636
examples: bin/grpc-client bin/example-app ## Build example app.
3737

38+
.PHONY: update-gomplate
39+
update-gomplate: ## Check and update gomplate version in Dockerfile.
40+
@./scripts/update-gomplate
41+
3842
.PHONY: release-binary
3943
release-binary: LD_FLAGS = "-w -X main.version=$(VERSION) -extldflags \"-static\""
4044
release-binary: ## Build release binaries (used to build a final container image).

api/v2/go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ module github.com/dexidp/dex/api/v2
33
go 1.24.0
44

55
require (
6-
google.golang.org/grpc v1.75.0
7-
google.golang.org/protobuf v1.36.8
6+
google.golang.org/grpc v1.79.1
7+
google.golang.org/protobuf v1.36.11
88
)
99

1010
require (
11-
golang.org/x/net v0.41.0 // indirect
12-
golang.org/x/sys v0.33.0 // indirect
13-
golang.org/x/text v0.26.0 // indirect
14-
google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
11+
golang.org/x/net v0.50.0 // indirect
12+
golang.org/x/sys v0.41.0 // indirect
13+
golang.org/x/text v0.34.0 // indirect
14+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260209200024-4cfbd4190f57 // indirect
1515
)

0 commit comments

Comments
 (0)