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

fix(security): update HSTS to 31536000 #2010

Merged
merged 1 commit into from
Jul 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/browserid-verifier/lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ app.use(function(req, res, next) {
res.setHeader('X-XSS-Protection', '1; mode=block');
res.setHeader('X-Content-Type-Options', 'nosniff');
res.setHeader('X-Frame-Options', 'DENY');
res.setHeader('Strict-Transport-Security', 'max-age=15552000');
res.setHeader('Strict-Transport-Security', 'max-age=31536000');
res.setHeader(
'Content-Security-Policy',
"default-src 'none'; frame-ancestors 'none'; report-uri /__cspreport__"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var should = require('should');

function shouldReturnSecurityHeaders(res) {
var expect = {
'strict-transport-security': 'max-age=15552000',
'strict-transport-security': 'max-age=31536000',
'x-content-type-options': 'nosniff',
'x-xss-protection': '1; mode=block',
'x-frame-options': 'DENY',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
},
security: {
hsts: {
maxAge: 15552000,
maxAge: 31536000,
includeSubdomains: true,
},
xframe: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-auth-server/fxa-oauth-server/test/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const config = require('../../lib/config').getProperties();

function assertSecurityHeaders(res, expect = {}) {
expect = {
'strict-transport-security': 'max-age=15552000; includeSubDomains',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
'x-content-type-options': 'nosniff',
'x-xss-protection': '1; mode=block',
'x-frame-options': 'DENY',
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-auth-server/lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ async function create(log, error, config, routes, db, oauthdb, translator) {
},
security: {
hsts: {
maxAge: 15552000,
maxAge: 31536000,
includeSubdomains: true,
},
},
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-auth-server/test/remote/misc_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ describe('remote misc', function() {
}).spread((res, body) => {
assert.equal(
res.headers['strict-transport-security'],
'max-age=15552000; includeSubDomains'
'max-age=31536000; includeSubDomains'
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-content-server/server/lib/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ const conf = (module.exports = convict({
},
},
hsts_max_age: {
default: 15552000, // 180 days
default: 31536000, // a year
doc: 'Max age of the STS directive in seconds',
// Note: This format is a number because the value needs to be in seconds
format: Number,
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-payments-server/server/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const conf = convict({
format: [ 'development', 'production' ],
},
hstsMaxAge: {
default: 15552000, // 180 days
default: 31536000, // a year
doc: 'Max age of the STS directive in seconds',
// Note: This format is a number because the value needs to be in seconds
format: Number
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-profile-server/lib/server/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ exports.create = function createServer() {
cors: true,
security: {
hsts: {
maxAge: 15552000,
maxAge: 31536000,
includeSubdomains: true,
},
xframe: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/fxa-profile-server/test/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const assert = require('insist');

function assertSecurityHeaders(res) {
var expect = {
'strict-transport-security': 'max-age=15552000; includeSubDomains',
'strict-transport-security': 'max-age=31536000; includeSubDomains',
'x-content-type-options': 'nosniff',
'x-xss-protection': '1; mode=block',
'x-frame-options': 'DENY',
Expand Down