Skip to content
This repository was archived by the owner on Aug 21, 2022. It is now read-only.

Commit 1d950fc

Browse files
committed
chore(release): 1.0.0 [skip ci]
# 1.0.0 (2020-08-22) ### Bug Fixes * add load-config.yml task ([03cfc3b](03cfc3b)) * add vendor files ([7b6d324](7b6d324)) * nginx conf template path ([f0be945](f0be945)) ### Features * add .gitmodules ([1aa86b0](1aa86b0)) * add galaxy.yml ([6bd5bcd](6bd5bcd))
1 parent ea1bfdd commit 1d950fc

29 files changed

+825
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Nginx Server Configs | MIT License
2+
# https://github.com/h5bp/server-configs-nginx
3+
4+
include h5bp/internet_explorer/x-ua-compatible.conf;
5+
include h5bp/security/referrer-policy.conf;
6+
include h5bp/security/x-content-type-options.conf;
7+
include h5bp/security/x-frame-options.conf;
8+
include h5bp/security/x-xss-protection.conf;
9+
include h5bp/location/security_file_access.conf;
10+
include h5bp/cross-origin/requests.conf;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# ----------------------------------------------------------------------
2+
# | Cross-origin requests |
3+
# ----------------------------------------------------------------------
4+
5+
# Allow cross-origin requests.
6+
#
7+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
8+
# https://enable-cors.org/
9+
# https://www.w3.org/TR/cors/
10+
11+
# (!) Do not use this without understanding the consequences.
12+
# This will permit access from any other website.
13+
# Instead of using this file, consider using a specific rule such as
14+
# allowing access based on (sub)domain:
15+
#
16+
# add_header Access-Control-Allow-Origin "subdomain.example.com";
17+
18+
add_header Access-Control-Allow-Origin $cors;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ----------------------------------------------------------------------
2+
# | Cross-origin resource timing |
3+
# ----------------------------------------------------------------------
4+
5+
# Allow cross-origin access to the timing information for all resources.
6+
#
7+
# If a resource isn't served with a `Timing-Allow-Origin` header that would
8+
# allow its timing information to be shared with the document, some of the
9+
# attributes of the `PerformanceResourceTiming` object will be set to zero.
10+
#
11+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin
12+
# https://www.w3.org/TR/resource-timing/
13+
# https://www.stevesouders.com/blog/2014/08/21/resource-timing-practical-tips/
14+
15+
add_header Timing-Allow-Origin "*";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# ----------------------------------------------------------------------
2+
# | Custom error messages/pages |
3+
# ----------------------------------------------------------------------
4+
5+
# Customize what Nginx returns to the client in case of an error.
6+
#
7+
# https://nginx.org/en/docs/http/ngx_http_core_module.html#error_page
8+
9+
error_page 404 /404.html;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# ----------------------------------------------------------------------
2+
# | Document modes |
3+
# ----------------------------------------------------------------------
4+
5+
# Force Internet Explorer 8/9/10 to render pages in the highest mode
6+
# available in various cases when it may not.
7+
#
8+
# https://hsivonen.fi/doctype/#ie8
9+
#
10+
# (!) Starting with Internet Explorer 11, document modes are deprecated.
11+
# If your business still relies on older web apps and services that were
12+
# designed for older versions of Internet Explorer, you might want to
13+
# consider enabling `Enterprise Mode` throughout your company.
14+
#
15+
# https://msdn.microsoft.com/en-us/library/ie/bg182625.aspx#docmode
16+
# https://blogs.msdn.microsoft.com/ie/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11/
17+
# https://msdn.microsoft.com/en-us/library/ff955275.aspx
18+
19+
add_header X-UA-Compatible $x_ua_compatible;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# ----------------------------------------------------------------------
2+
# | File access |
3+
# ----------------------------------------------------------------------
4+
5+
# Block access to all hidden files and directories except for the
6+
# visible content from within the `/.well-known/` hidden directory.
7+
#
8+
# These types of files usually contain user preferences or the preserved state
9+
# of a utility, and can include rather private places like, for example, the
10+
# `.git` or `.svn` directories.
11+
#
12+
# The `/.well-known/` directory represents the standard (RFC 5785) path prefix
13+
# for "well-known locations" (e.g.: `/.well-known/manifest.json`,
14+
# `/.well-known/keybase.txt`), and therefore, access to its visible content
15+
# should not be blocked.
16+
#
17+
# https://www.mnot.net/blog/2010/04/07/well-known
18+
# https://tools.ietf.org/html/rfc5785
19+
20+
location ~* /\.(?!well-known\/) {
21+
deny all;
22+
}
23+
24+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
25+
26+
# Block access to files that can expose sensitive information.
27+
#
28+
# By default, block access to backup and source files that may be left by some
29+
# text editors and can pose a security risk when anyone has access to them.
30+
#
31+
# https://feross.org/cmsploit/
32+
#
33+
# (!) Update the `location` regular expression from below to include any files
34+
# that might end up on your production server and can expose sensitive
35+
# information about your website. These files may include: configuration
36+
# files, files that contain metadata about the project (e.g.: project
37+
# dependencies, build scripts, etc.).
38+
39+
location ~* (?:#.*#|\.(?:bak|conf|dist|fla|in[ci]|log|orig|psd|sh|sql|sw[op])|~)$ {
40+
deny all;
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ----------------------------------------------------------------------
2+
# | Filename-based cache busting |
3+
# ----------------------------------------------------------------------
4+
5+
# If you're not using a build process to manage your filename version revving,
6+
# you might want to consider enabling the following directives.
7+
#
8+
# To understand why this is important and even a better solution than using
9+
# something like `*.css?v231`, please see:
10+
# https://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
11+
12+
location ~* (.+)\.(?:\w+)\.(bmp|css|cur|gif|ico|jpe?g|m?js|png|svgz?|webp|webmanifest)$ {
13+
try_files $uri $1.$2;
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# ----------------------------------------------------------------------
2+
# | SVGZ Compression |
3+
# ----------------------------------------------------------------------
4+
5+
# SVGZ files are already compressed.
6+
# Disable gzip function for `.svgz` files.
7+
8+
location ~* \.svgz$ {
9+
gzip off;
10+
add_header Content-Encoding gzip;
11+
12+
include h5bp/security/x-content-type-options.conf;
13+
include h5bp/security/content-security-policy.conf;
14+
include h5bp/security/referrer-policy.conf;
15+
include h5bp/cross-origin/requests.conf;
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# ----------------------------------------------------------------------
2+
# | Character encodings |
3+
# ----------------------------------------------------------------------
4+
5+
# Serve all resources labeled as `text/html` or `text/plain` with the media type
6+
# `charset` parameter set to `UTF-8`.
7+
#
8+
# https://nginx.org/en/docs/http/ngx_http_charset_module.html#charset
9+
10+
charset utf-8;
11+
12+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
13+
14+
# Update charset_types to match updated mime.types.
15+
# `text/html` is always included by charset module.
16+
# Default: text/html text/xml text/plain text/vnd.wap.wml application/javascript application/rss+xml
17+
#
18+
# https://nginx.org/en/docs/http/ngx_http_charset_module.html#charset_types
19+
20+
charset_types
21+
text/css
22+
text/plain
23+
text/vnd.wap.wml
24+
text/javascript
25+
text/markdown
26+
text/calendar
27+
text/x-component
28+
text/vcard
29+
text/cache-manifest
30+
text/vtt
31+
application/json
32+
application/manifest+json;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# ----------------------------------------------------------------------
2+
# | Media types |
3+
# ----------------------------------------------------------------------
4+
5+
# Serve resources with the proper media types (f.k.a. MIME types).
6+
#
7+
# https://www.iana.org/assignments/media-types/media-types.xhtml
8+
# https://nginx.org/en/docs/http/ngx_http_core_module.html#types
9+
10+
include mime.types;
11+
12+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
13+
14+
# Default: text/plain
15+
#
16+
# https://nginx.org/en/docs/http/ngx_http_core_module.html#default_type
17+
18+
default_type application/octet-stream;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# ----------------------------------------------------------------------
2+
# | Content Security Policy (CSP) |
3+
# ----------------------------------------------------------------------
4+
5+
# Mitigate the risk of cross-site scripting and other content-injection
6+
# attacks.
7+
#
8+
# This can be done by setting a `Content Security Policy` which whitelists
9+
# trusted sources of content for your website.
10+
#
11+
# There is no policy that fits all websites, you will have to modify the
12+
# `Content-Security-Policy` directives in the example depending on your needs.
13+
#
14+
# To make your CSP implementation easier, you can use an online CSP header
15+
# generator such as:
16+
# https://report-uri.com/home/generate/
17+
#
18+
# It is encouraged that you validate your CSP header using a CSP validator
19+
# such as:
20+
# https://csp-evaluator.withgoogle.com
21+
#
22+
# https://csp.withgoogle.com/docs/
23+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
24+
# https://www.html5rocks.com/en/tutorials/security/content-security-policy/
25+
# https://www.w3.org/TR/CSP/
26+
27+
add_header Content-Security-Policy $content_security_policy always;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ----------------------------------------------------------------------
2+
# | Referrer Policy |
3+
# ----------------------------------------------------------------------
4+
5+
# Set a strict Referrer Policy to mitigate information leakage.
6+
#
7+
# (1) The `Referrer-Policy` header is included in responses for resources
8+
# that are able to request (or navigate to) other resources.
9+
#
10+
# This includes the commonly used resource types:
11+
# HTML, CSS, XML/SVG, PDF documents, scripts and workers.
12+
#
13+
# To prevent referrer leakage entirely, specify the `no-referrer` value
14+
# instead. Note that the effect could impact analytics metrics negatively.
15+
#
16+
# To check your Referrer Policy, you can use an online service, such as:
17+
# https://securityheaders.com/
18+
# https://observatory.mozilla.org/
19+
#
20+
# https://scotthelme.co.uk/a-new-security-header-referrer-policy/
21+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
22+
23+
add_header Referrer-Policy $referrer_policy always;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# ----------------------------------------------------------------------
2+
# | Server software information |
3+
# ----------------------------------------------------------------------
4+
5+
# Prevent Nginx from sending its version number in the "Server" response header.
6+
#
7+
# https://nginx.org/en/docs/http/ngx_http_core_module.html#server_tokens
8+
9+
server_tokens off;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# ----------------------------------------------------------------------
2+
# | HTTP Strict Transport Security (HSTS) |
3+
# ----------------------------------------------------------------------
4+
5+
# Force client-side TLS (Transport Layer Security) redirection.
6+
#
7+
# If a user types `example.com` in their browser, even if the server redirects
8+
# them to the secure version of the website, that still leaves a window of
9+
# opportunity (the initial HTTP connection) for an attacker to downgrade or
10+
# redirect the request.
11+
#
12+
# The following header ensures that a browser only connects to your server
13+
# via HTTPS, regardless of what the users type in the browser's address bar.
14+
#
15+
# (!) Be aware that Strict Transport Security is not revokable and you
16+
# must ensure being able to serve the site over HTTPS for the duration
17+
# you've specified in the `max-age` directive. When you don't have a
18+
# valid TLS connection anymore (e.g. due to an expired TLS certificate)
19+
# your visitors will see a nasty error message even when attempting to
20+
# connect over HTTP.
21+
#
22+
# (1) Preloading Strict Transport Security.
23+
# To submit your site for HSTS preloading, it is required that:
24+
# * the `includeSubDomains` directive is specified
25+
# * the `preload` directive is specified
26+
# * the `max-age` is specified with a value of at least 31536000 seconds
27+
# (1 year).
28+
# https://hstspreload.org/#deployment-recommendations
29+
#
30+
# https://tools.ietf.org/html/rfc6797#section-6.1
31+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
32+
# https://www.html5rocks.com/en/tutorials/security/transport-layer-security/
33+
# https://blogs.msdn.microsoft.com/ieinternals/2014/08/18/strict-transport-security/
34+
# https://hstspreload.org/
35+
36+
add_header Strict-Transport-Security "max-age=16070400; includeSubDomains" always;
37+
# (1) Enable your site for HSTS preload inclusion.
38+
# add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# ----------------------------------------------------------------------
2+
# | Content Type Options |
3+
# ----------------------------------------------------------------------
4+
5+
# Prevent some browsers from MIME-sniffing the response.
6+
#
7+
# This reduces exposure to drive-by download attacks and cross-origin data
8+
# leaks, and should be left uncommented, especially if the server is serving
9+
# user-uploaded content or content that could potentially be treated as
10+
# executable by the browser.
11+
#
12+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
13+
# https://blogs.msdn.microsoft.com/ie/2008/07/02/ie8-security-part-v-comprehensive-protection/
14+
# https://mimesniff.spec.whatwg.org/
15+
16+
add_header X-Content-Type-Options nosniff always;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# ----------------------------------------------------------------------
2+
# | Frame Options |
3+
# ----------------------------------------------------------------------
4+
5+
# Protect website against clickjacking.
6+
#
7+
# The example below sends the `X-Frame-Options` response header with the value
8+
# `DENY`, informing browsers not to display the content of the web page in any
9+
# frame.
10+
#
11+
# This might not be the best setting for everyone. You should read about the
12+
# other two possible values the `X-Frame-Options` header field can have:
13+
# `SAMEORIGIN` and `ALLOW-FROM`.
14+
# https://tools.ietf.org/html/rfc7034#section-2.1.
15+
#
16+
# Keep in mind that while you could send the `X-Frame-Options` header for all
17+
# of your website's pages, this has the potential downside that it forbids even
18+
# non-malicious framing of your content (e.g.: when users visit your website
19+
# using a Google Image Search results page).
20+
#
21+
# Nonetheless, you should ensure that you send the `X-Frame-Options` header for
22+
# all pages that allow a user to make a state-changing operation (e.g: pages
23+
# that contain one-click purchase links, checkout or bank-transfer confirmation
24+
# pages, pages that make permanent configuration changes, etc.).
25+
#
26+
# Sending the `X-Frame-Options` header can also protect your website against
27+
# more than just clickjacking attacks.
28+
# https://cure53.de/xfo-clickjacking.pdf.
29+
#
30+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
31+
# https://tools.ietf.org/html/rfc7034
32+
# https://blogs.msdn.microsoft.com/ieinternals/2010/03/30/combating-clickjacking-with-x-frame-options/
33+
# https://www.owasp.org/index.php/Clickjacking
34+
35+
add_header X-Frame-Options $x_frame_options always;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# ----------------------------------------------------------------------
2+
# | Cross-Site Scripting (XSS) Protection |
3+
# ----------------------------------------------------------------------
4+
5+
# Protect website reflected Cross-Site Scripting (XSS) attacks.
6+
#
7+
# (1) Try to re-enable the cross-site scripting (XSS) filter built into most
8+
# web browsers.
9+
#
10+
# The filter is usually enabled by default, but in some cases, it may be
11+
# disabled by the user. However, in Internet Explorer, for example, it can be
12+
# re-enabled just by sending the `X-XSS-Protection` header with the value
13+
# of `1`.
14+
#
15+
# (2) Prevent web browsers from rendering the web page if a potential reflected
16+
# (a.k.a non-persistent) XSS attack is detected by the filter.
17+
#
18+
# By default, if the filter is enabled and browsers detect a reflected XSS
19+
# attack, they will attempt to block the attack by making the smallest
20+
# possible modifications to the returned web page.
21+
#
22+
# Unfortunately, in some browsers (e.g.: Internet Explorer), this default
23+
# behavior may allow the XSS filter to be exploited. Therefore, it's better
24+
# to inform browsers to prevent the rendering of the page altogether,
25+
# instead of attempting to modify it.
26+
#
27+
# https://hackademix.net/2009/11/21/ies-xss-filter-creates-xss-vulnerabilities
28+
#
29+
# (!) Do not rely on the XSS filter to prevent XSS attacks! Ensure that you are
30+
# taking all possible measures to prevent XSS attacks, the most obvious
31+
# being: validating and sanitizing your website's inputs.
32+
#
33+
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
34+
# https://blogs.msdn.microsoft.com/ie/2008/07/02/ie8-security-part-iv-the-xss-filter/
35+
# https://blogs.msdn.microsoft.com/ieinternals/2011/01/31/controlling-the-xss-filter/
36+
# https://www.owasp.org/index.php/Cross-site_Scripting_%28XSS%29
37+
38+
add_header X-XSS-Protection $x_xss_protection always;

0 commit comments

Comments
 (0)