Skip to content

Document best practice security headers option always with redirect (defense in depth) #23

@janwillemstegink

Description

@janwillemstegink

https://en.internet.nl/site/www.workingornot.org/3182705/#

Image

https://en.internet.nl/site/workingornot.org/3182706/

Image

.htaccess content:

SetEnv no-gzip 1
Header always set Strict-Transport-Security "max-age=63072000"
Header set X-Content-Type-Options nosniff
Header set X-Xss-Protection "1; mode=block"
Header set Referrer-Policy same-origin
Header set X-Frame-Options SAMEORIGIN
Header set Content-Security-Policy "default-src 'none'; base-uri 'none'; frame-src 'self'; connect-src 'self'; form-action 'self'; font-src 'self' data: https://fonts.googleapis.com https://fonts.gstatic.com; frame-ancestors 'self'; img-src 'self' data:; object-src 'none'; script-src 'self'; style-src 'unsafe-inline' 'self' data:; style-src-elem 'self' 'unsafe-inline' data: https://fonts.googleapis.com;"
Header set Permissions-Policy geolocation=()

Options +Indexes

<If "! (%{HTTP_HOST} =~ /^www.workingornot.org$/)">
Redirect 302 / https://www.workingornot.org/

ErrorDocument 404 /404.html

Redirect 302 /.well-known/security.txt https://janwillemstegink.nl/.well-known/security.txt

With escaping of dots visible in an image:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions