Skip to content
This repository has been archived by the owner on Oct 27, 2018. It is now read-only.

Security changes whitelisting #22

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
7 changes: 6 additions & 1 deletion config/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ modules:
collectors:
# Uncomment the modules that you'd like to use
# - ./modules/collectionLogger
# - ./modules/statsd
- ./modules/statsd
# - ./modules/openTSDB
# - ./modules/influxdb

whitelistedkeys:
- key1
- key2
- key3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whitelistedkeys part should be commented out as an 'example'

14 changes: 13 additions & 1 deletion server.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ configWrapper = require './lib/configWrapper'
load = require './lib/load'

MODULES = config.modules

loadLogger = ->
if MODULES.logger
load(MODULES.logger, {config})
Expand Down Expand Up @@ -60,9 +61,20 @@ loadApp = (logger, loadedConfig) ->
APP_ROOT = process.env.APP_ROOT ? loadedConfig.get('server.appRoot').get() ? ''

moduleGroups = {}
loadModuleGroup = (group) ->
loadKeys = (group) ->
moduleGroups[group] = {}
if MODULES[group]
_.map MODULES[group], (name) ->
logger.log "Key found", name

else
[]

appPromises = loadKeys 'whitelistedkeys'

moduleGroups = {}
loadModuleGroup = (group) ->
moduleGroups[group] = {}
if MODULES[group]
_.map MODULES[group], (name) ->
logger.log "Loading #{ group } Module", name
Expand Down