forked from goauthentik/authentik
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(saml): forward SP RelayState in IdP-initiated flow (AWS WorkSpaces) [Buzzvil fork patch] #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6c591ab
fix(saml): IdP-initiated forwards SP RelayState (AWS WorkSpaces per-s…
dlddu 5b99271
fix(saml): pass query RelayState into IdP-initiated AuthNRequest
dlddu 97cf6ea
ci: overlay Dockerfile for patched authentik image (WorkSpaces SAML)
dlddu 9f33d83
ci: build patched image and push to authentik ECR (reusable build-ecr)
dlddu 0999017
ci: self-contained build (inline steps, drop reusable workflow + dock…
dlddu c75e814
ci: github-hosted runner + GHCR public push (drop self-hosted/ECR)
dlddu ec1c95a
ci: multi-arch build (amd64+arm64) for Karpenter node arch safety
dlddu 2fd1013
docs: Buzzvil fork 안내 — WorkSpaces SAML RelayState 패치 내용/빌드/제거 조건
dlddu 4b84314
ci: 태그(*-relaystate) 트리거 + 빌드 시 GitHub Release 생성
dlddu 8efa739
docs: 빌드/유지보수 섹션 태그(*-relaystate) 트리거 + 빌드시 Release 반영
dlddu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Buzzvil patched authentik image (overlay on the official server image). | ||
| # | ||
| # Replaces two SAML provider files so that IdP-initiated SSO forwards the | ||
| # SP-supplied RelayState (AWS WorkSpaces appends a per-session state code via | ||
| # ?RelayState= to the init URL) instead of only using the static | ||
| # default_relay_state. Without this, the WorkSpaces native client loops back to | ||
| # sign-in because euc-sso cannot bind the auth code to the client session. | ||
| # | ||
| # Patch source of truth: this repo's authentik/ tree (see PR #1). File paths below | ||
| # match the official image layout (/authentik/...). | ||
| FROM ghcr.io/goauthentik/server:2026.2.1 | ||
|
|
||
| COPY --chown=authentik:authentik authentik/providers/saml/processors/authn_request_parser.py /authentik/providers/saml/processors/authn_request_parser.py | ||
| COPY --chown=authentik:authentik authentik/providers/saml/views/sso.py /authentik/providers/saml/views/sso.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| name: build-patched-ghcr | ||
|
|
||
| # authentik 패치 이미지 빌드 + GitHub Release 를 함께 생성. | ||
| # | ||
| # 트리거: '<authentik version>-relaystate' 형태의 태그 push (예: 2026.2.1-relaystate). | ||
| # 태그명 = 이미지 태그 = release 태그 → 빌드와 release 가 항상 한 쌍으로 생성된다. | ||
| # | ||
| # 새 authentik 버전 릴리스 절차: | ||
| # 1) 새 브랜치(buzzvil/workspaces-relaystate-<ver>)에서 .buzzvil/Dockerfile 의 FROM 을 | ||
| # 그 버전으로 바꾸고 SAML 2 파일 패치를 재적용. | ||
| # 2) 그 커밋에 태그 '<ver>-relaystate' 를 push → 이 워크플로우가 이미지 빌드 + release 생성. | ||
| # 3) ops(buzz-k8s-resources) 의 global.image tag 를 갱신하고 WorkSpaces 로그인 재검증. | ||
| on: | ||
| push: | ||
| tags: | ||
| - '*-relaystate' | ||
| workflow_dispatch: | ||
| inputs: | ||
| image_tag: | ||
| description: "이미지 태그 (예: 2026.2.1-relaystate). 이미지만 rebuild (release 미생성)." | ||
| required: true | ||
|
|
||
| permissions: | ||
| contents: write # release 생성 | ||
| packages: write # GHCR push | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| IMAGE_TAG: ${{ github.event.inputs.image_tag || github.ref_name }} | ||
| steps: | ||
| - name: Checkout (patch files only) | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| sparse-checkout: | | ||
| .buzzvil | ||
| authentik/providers/saml/processors/authn_request_parser.py | ||
| authentik/providers/saml/views/sso.py | ||
| sparse-checkout-cone-mode: false | ||
|
|
||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Log in to GHCR | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: . | ||
| file: .buzzvil/Dockerfile | ||
| platforms: linux/amd64,linux/arm64 | ||
| push: true | ||
| tags: ghcr.io/buzzvil/authentik:${{ env.IMAGE_TAG }} | ||
|
|
||
| - name: Create GitHub Release | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| gh release create "${{ github.ref_name }}" \ | ||
| --repo "${{ github.repository }}" \ | ||
| --title "${{ github.ref_name }} — WorkSpaces SAML RelayState patch" \ | ||
| --notes "패치 이미지: \`ghcr.io/buzzvil/authentik:${{ github.ref_name }}\` (multi-arch amd64/arm64, public). 패치 내용·빌드·제거 조건은 저장소 README 참고." \ | ||
| --verify-tag \ | ||
| || echo "release for ${{ github.ref_name }} already exists — skipping" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
run:블록의 템플릿 보간이 셸 인젝션 위험(zizmor error) — env 변수 경유로 전달 권장.${{ github.ref_name }}와${{ github.repository }}가run:셸 스크립트에 직접 보간됩니다. 태그 push 권한이 있는 사용자만ref_name을 제어할 수 있어 공격 표면은 제한적이지만, 특수문자(백틱,$(),;등)가 포함된 태그명이 생성되면 셸 인젝션으로 이어질 수 있습니다. GitHub Actions 표준 완화책은 표현식을env:로 넘기고 셸에서는 환경변수로만 참조하는 것입니다.🛡️ 제안
- name: Create GitHub Release if: startsWith(github.ref, 'refs/tags/') env: GH_TOKEN: ${{ github.token }} + TAG_NAME: ${{ github.ref_name }} + REPO_NAME: ${{ github.repository }} run: | - gh release create "${{ github.ref_name }}" \ - --repo "${{ github.repository }}" \ - --title "${{ github.ref_name }} — WorkSpaces SAML RelayState patch" \ - --notes "패치 이미지: \`ghcr.io/buzzvil/authentik:${{ github.ref_name }}\` (multi-arch amd64/arm64, public). 패치 내용·빌드·제거 조건은 저장소 README 참고." \ + gh release create "$TAG_NAME" \ + --repo "$REPO_NAME" \ + --title "$TAG_NAME — WorkSpaces SAML RelayState patch" \ + --notes "패치 이미지: \`ghcr.io/buzzvil/authentik:$TAG_NAME\` (multi-arch amd64/arm64, public). 패치 내용·빌드·제거 조건은 저장소 README 참고." \ --verify-tag \ - || echo "release for ${{ github.ref_name }} already exists — skipping" + || echo "release for $TAG_NAME already exists — skipping"📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.26.1)
[error] 69-69: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 71-71: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 72-72: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
[error] 74-74: code injection via template expansion (template-injection): may expand into attacker-controllable code
(template-injection)
🤖 Prompt for AI Agents
Source: Linters/SAST tools