-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add redirects to central security.txt #236
Conversation
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.
Thanks for contributing 🙌
Just need to validate this locally
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.
Hey @OllieJC did you check this locally? I'm seeing that this isn't redirecting properly locally - whereas it does when you are deploying to GH pages.
Thinking about it the _config.yml
is a Jekyll file, not a Middleman file, so could be that's why it's working on your site? But that can't be right, as some of the site has built successfully from Middleman code 🤔
I'm currently looking at attempting to use |
Hey @OllieJC, as per alphagov/tech-docs-gem#256 (comment) I've managed to get this working through pure Middleman redirects - are you happy if I amend your branch with the changes? Again, thanks for raising this 🙌 |
Hi @jamietanna, sure give it a go! I have a feeling it might not work when deployed to GitHub Pages because it is very basic hosting that doesn't allow mime type changes etc. bundle exec middleman build
cd build/
python3 -m http.server ..and navigating to http://localhost:8000 |
Although, I think Middleman just creates those same HTML pages, right? If so, yeah it should work! I'll try it in my branch and recommit :) |
Thanks! Yeah I think I've narrowed it down to needing the below to cover both cases: # required for local
page "/security.txt", content_type: 'text/html'
redirect 'security.txt', to: 'https://security-redirect.example.com/.well-known/security.txt'
# required for hosting
redirect 'security.txt.html', to: 'https://security-redirect.example.com/.well-known/security.txt' |
So those redirect "security.txt/index.html", to: "https://security-redirect.example.com/.well-known/security.txt"
redirect ".well-known/security.txt/index.html", to: "https://security-redirect.example.com/.well-known/security.txt" Which works locally and on gh-pages :) Edit: changed |
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.
Thanks for contributing, and sorry it was a bit all over the place 😁
Just double checked and it's all working 🙌 |
As per guidance on the gds-way about security.txt and vulnerability disclosure, this PR adds a couple of HTML files (and a
_config.yml
file enabling the.well-known
directory) that redirect to the Cabinet Office centralsecurity.txt
: https://github.com/alphagov/security.txtYou can see the redirects in action on GitHub Pages in my fork here:
Here's a testing site about
security.txt
files on GitHub Pages too: https://gh-pages-securitytxt.github.io/