Skip to content

Commit

Permalink
Merge pull request #643 from marcioaffonso/ECO-4623
Browse files Browse the repository at this point in the history
[ECO-4623] - Add security headers
  • Loading branch information
Robert Hainer authored Sep 10, 2020
2 parents 46f96e9 + d8213d8 commit 07a5554
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ produces:
x-implementation-module: serverMethods.js
x-implementation-middleware:
- configReady
- securityHeaders
- iframingOptions
- featureEnabled
x-implementation-configuration: loadConfig
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"grunt-html-build": "^0.7.1",
"grunt-karma": "^0.12.2",
"grunt-mocha-test": "^0.12.7",
"helmet": "^4.1.0",
"ioredis": "^4.6.3",
"lodash": "^4.17.19",
"opentok": "^2.3.0",
Expand Down
8 changes: 8 additions & 0 deletions server/serverMethods.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@
'use strict';

var SwaggerBP = require('swagger-boilerplate');
var helmet = require('helmet');
var C = require('./serverConstants');
var configLoader = require('./configLoader');
var FirebaseArchives = require('./firebaseArchives');
var GoogleAuth = require('./googleAuthStrategies');
var testHealth = require('./testHealth');

var securityHeaders = helmet({
referrerPolicy: { policy: 'no-referrer-when-downgrade' },
contentSecurityPolicy: false,
frameGuard: false, // configured by tbConfig.allowIframing
});

function ServerMethods(aLogLevel, aModules) {
aModules = aModules || {};

Expand Down Expand Up @@ -848,6 +855,7 @@ function ServerMethods(aLogLevel, aModules) {
return {
logger,
configReady,
securityHeaders,
iframingOptions,
featureEnabled,
loadConfig,
Expand Down

0 comments on commit 07a5554

Please sign in to comment.