Skip to content

Commit cfa86e0

Browse files
committed
Merge remote-tracking branch 'stackgenhq/master'
2 parents 3dc67b2 + e80d6c8 commit cfa86e0

78 files changed

Lines changed: 4599 additions & 804 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: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,27 +53,29 @@ jobs:
5353

5454
steps:
5555
- name: Checkout repository
56-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
56+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57+
with:
58+
fetch-tags: true
5759

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

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

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

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

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

7476
- name: Gather build metadata
7577
id: meta
76-
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
78+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
7779
with:
7880
images: |
7981
${{ steps.image-name.outputs.value }}
@@ -103,32 +105,33 @@ jobs:
103105
# if_false: type=oci,dest=image.tar
104106

105107
- name: Login to GitHub Container Registry
106-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
108+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
107109
with:
108110
registry: ghcr.io
109111
username: ${{ github.actor }}
110112
password: ${{ github.token }}
111113

112114
- name: Login to Docker Hub
113-
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
115+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
114116
with:
115117
username: ${{ secrets.DOCKER_USERNAME }}
116118
password: ${{ secrets.DOCKER_PASSWORD }}
117119
if: inputs.publish
118120

119121
- name: Build and push image
120122
id: build
121-
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
123+
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
122124
with:
123125
context: .
124126
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
125127
tags: ${{ steps.meta.outputs.tags }}
126128
build-args: |
127129
BASE_IMAGE=${{ matrix.variant }}
128-
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
130+
VERSION=${{ steps.version.outputs.value }}
129131
COMMIT_HASH=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
130132
BUILD_DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
131-
labels: ${{ steps.meta.outputs.labels }}
133+
labels: |
134+
${{ steps.meta.outputs.labels }}
132135
# cache-from: type=gha
133136
# cache-to: type=gha,mode=max
134137
outputs: type=image,push=true
@@ -178,7 +181,7 @@ jobs:
178181

179182
# TODO: uncomment when the action is working for non ghcr.io pushes. GH Issue: https://github.com/actions/attest-build-provenance/issues/80
180183
# - name: Generate build provenance attestation
181-
# uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
184+
# uses: actions/attest-build-provenance@96278af6caaf10aea03fd8d33a09a777ca52d62f # v3.2.0
182185
# with:
183186
# subject-name: dexidp/dex
184187
# subject-digest: ${{ steps.build.outputs.digest }}
@@ -192,48 +195,59 @@ jobs:
192195
# push-to-registry: true
193196
# if: inputs.publish
194197

198+
- name: Prepare image fs for scanning
199+
run: |
200+
docker load --input image.tar
201+
docker export $(docker create --rm ${{ steps.image-name.outputs.value }}@${{ steps.build.outputs.digest }}) -o docker-image.tar
202+
203+
mkdir -p docker-image
204+
tar -xf docker-image.tar -C docker-image
205+
195206
## Use cache for the trivy-db to avoid the TOOMANYREQUESTS error https://github.com/aquasecurity/trivy-action/pull/397
196207
## To avoid the trivy-db becoming outdated, we save the cache for one day
197208
- name: Get data
198209
id: date
199210
run: echo "date=$(date +%Y-%m-%d)" >> $GITHUB_OUTPUT
200211

201212
- name: Restore trivy cache
202-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
213+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
203214
with:
204215
path: cache/db
205216
key: trivy-cache-${{ steps.date.outputs.date }}
206217
restore-keys: trivy-cache-
207218

208219
- name: Run Trivy vulnerability scanner
209-
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # 0.33.1
220+
uses: aquasecurity/trivy-action@c1824fd6edce30d7ab345a9989de00bbd46ef284 # 0.34.0
210221
with:
211-
input: image
222+
input: docker-image
212223
format: sarif
213224
output: trivy-results.sarif
214-
scan-type: "fs"
225+
scan-type: "rootfs"
215226
scan-ref: "."
216227
cache-dir: "./cache"
217228
# Disable skipping trivy cache for now
218-
# env:
219-
# TRIVY_SKIP_DB_UPDATE: true
220-
# TRIVY_SKIP_JAVA_DB_UPDATE: true
229+
env:
230+
TRIVY_SKIP_DB_UPDATE: true
231+
TRIVY_SKIP_JAVA_DB_UPDATE: true
221232

222233
## Trivy-db uses `0600` permissions.
223234
## But `action/cache` use `runner` user by default
224235
## So we need to change the permissions before caching the database.
225236
- name: change permissions for trivy.db
226237
run: sudo chmod 0644 ./cache/db/trivy.db
227238

239+
- name: Check Trivy sarif
240+
run: cat trivy-results.sarif
241+
228242
- name: Upload Trivy scan results as artifact
229-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
243+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
230244
with:
231245
name: "[${{ github.job }}] Trivy scan results"
232246
path: trivy-results.sarif
233247
retention-days: 5
234248
overwrite: true
235249

236250
- name: Upload Trivy scan results to GitHub Security tab
237-
uses: github/codeql-action/upload-sarif@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v3.29.5
251+
uses: github/codeql-action/upload-sarif@9e907b5e64f6b83e7804b09294d44122997950d6 # v3.29.5
238252
with:
239253
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)