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

Beissea 85 pen test fixes #248

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open

Beissea 85 pen test fixes #248

wants to merge 7 commits into from

Conversation

xonde
Copy link
Collaborator

@xonde xonde commented Sep 14, 2023

No description provided.

@xonde xonde requested a review from davidm-m September 14, 2023 13:52
Copy link
Collaborator

@davidm-m davidm-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSP stuff look great, I just want to check that the change you've made to cookies is the right one.

Copy link
Collaborator

@davidm-m davidm-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely stuff 👍

@davidm-m
Copy link
Collaborator

Just realised: PLEASE DON'T ACTUALLY MERGE THIS!
Merging into main triggers a production deployment. We should be merging into dev first.

@xonde xonde changed the base branch from main to dev September 20, 2023 09:48
@xonde
Copy link
Collaborator Author

xonde commented Sep 20, 2023

Just to note, while this should technically work, The way it's set up on the new platform means we're always in a dev environment. So I think we should sort out BEISSEA-86 before we merge this. I'll ask Jeni if I can prioritise that after doing the data capture ticket

@davidm-m
Copy link
Collaborator

Just to note, while this should technically work, The way it's set up on the new platform means we're always in a dev environment.

Ha, I was just going to write an identical comment. Sounds good to me.

@xonde xonde force-pushed the BEISSEA-85-pen-test-fixes branch from b836cd3 to 05ad816 Compare September 20, 2023 09:54
Copy link
Collaborator

@davidm-m davidm-m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making the anti forgery cookie secure broke HER, so we'll need to make an additional change to avoid that. I've put more details in a comment.

Comment on lines 127 to 132
private void ConfigureAntiForgeryCookieOptions(AntiforgeryOptions options)
{
options.Cookie.Name = "Antiforgery";
options.Cookie.SecurePolicy = webHostEnvironment.IsDevelopment() ? CookieSecurePolicy.None : CookieSecurePolicy.Always;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out HER has this exact change and it's breaking the health check since the health check is apparently over HTTP, not HTTPS. We'll need to add in an exception to the health check endpoint that it doesn't use an anti forgery cookie.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, thanks for checking

This commit contains WIP code that should probably be removed. I have made a note on each section with a "TODO: BEISSEA-85"
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.

2 participants