Skip to content
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

root: rework CSRF middleware to set secure flag #11753

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Conversation

BeryJu
Copy link
Member

@BeryJu BeryJu commented Oct 21, 2024

Details

Remove the custom CSRF subclass which sets the Secure flag dynamically, as when the SECURE flag is set statically it is still handled correctly for http/local

closes #11760


Checklist

  • Local tests pass (ak test authentik/)
  • The code has been formatted (make lint-fix)

If an API change has been made

  • The API schema has been updated (make gen-build)

If changes to the frontend have been made

  • The code has been formatted (make web)

If applicable

  • The documentation has been updated
  • The documentation has been formatted (make website)

@BeryJu BeryJu requested a review from a team as a code owner October 21, 2024 12:07
Copy link

netlify bot commented Oct 21, 2024

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 99d6996
🔍 Latest deploy log https://app.netlify.com/sites/authentik-docs/deploys/6718d9295b87b10008d90eb8
😎 Deploy Preview https://deploy-preview-11753--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 21, 2024

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 99d6996
🔍 Latest deploy log https://app.netlify.com/sites/authentik-storybook/deploys/6718d9290609020008c8b25a
😎 Deploy Preview https://deploy-preview-11753--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.68%. Comparing base (d3d96b7) to head (99d6996).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
authentik/root/middleware.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11753      +/-   ##
==========================================
- Coverage   92.69%   92.68%   -0.01%     
==========================================
  Files         745      745              
  Lines       37005    37003       -2     
==========================================
- Hits        34300    34297       -3     
- Misses       2705     2706       +1     
Flag Coverage Δ
e2e 49.29% <0.00%> (-0.01%) ⬇️
integration 25.00% <0.00%> (+<0.01%) ⬆️
unit 90.23% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BeryJu BeryJu changed the title root: remove custom CSRF middleware root: rework CSRF middleware to set secure flag Oct 23, 2024
Copy link
Contributor

github-actions bot commented Oct 23, 2024

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-99d6996dce4dc9e09f39161a5472883ffcac9413
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

For arm64, use these values:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-99d6996dce4dc9e09f39161a5472883ffcac9413-arm64
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-99d6996dce4dc9e09f39161a5472883ffcac9413

For arm64, use these values:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-99d6996dce4dc9e09f39161a5472883ffcac9413-arm64

Afterwards, run the upgrade commands from the latest release notes.

@BeryJu BeryJu merged commit d3ebfca into main Oct 23, 2024
64 of 65 checks passed
@BeryJu BeryJu deleted the root/remove-custom-csrf branch October 23, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Insecure CSRF Cookie
1 participant