Skip to content

Commit

Permalink
Exclude Fence register-user blueprint from CSRF check (#1580)
Browse files Browse the repository at this point in the history
  • Loading branch information
vpsx authored Apr 26, 2021
1 parent aa78400 commit fb77af1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions kube/services/revproxy/gen3.nginx.conf/fence-service.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ location /user/ {
proxy_pass $upstream;
}

location /user/register-user {
# Like /user/ but without CSRF check. Registration form submission is
# incompatible with revproxy-level cookie-to-header CSRF check.
# Fence enforces its own CSRF protection here so this is OK.
set $proxy_service "${fence_release_name}";
set $upstream http://${fence_release_name}-service$des_domain;
rewrite ^/user/(.*) /$1 break;
proxy_pass $upstream;
}

location /user/data/download {
if ($csrf_check !~ ^ok-\S.+$) {
return 403 "failed csrf check";
Expand Down

0 comments on commit fb77af1

Please sign in to comment.