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

Conversation

msgauri
Copy link

@msgauri msgauri commented Jan 20, 2016

No description provided.

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'

@msgauri
Copy link
Author

msgauri commented Jan 20, 2016

Work in progress

@msgauri
Copy link
Author

msgauri commented Jan 20, 2016

(this addresses #20)

@msgauri
Copy link
Author

msgauri commented Jan 20, 2016

This one is ready to go in, waiting on review

@ckdake
Copy link

ckdake commented Jan 20, 2016

Could we check for the presence of whitelistedKeys and use that as the trigger to filter keys instead of having to use a separate boolean?

@msgauri
Copy link
Author

msgauri commented Jan 20, 2016

So you need atleast one of those keys commented out for the server to start up, else it gives parse errors.

@@ -36,3 +37,21 @@ modules:
# - ./modules/statsd
# - ./modules/openTSDB
# - ./modules/influxdb

whitelistedKeys:
# Uncomment the keys that you'd like to whitelist
Copy link

Choose a reason for hiding this comment

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

A note here would be helpful. "The example below are timing metrics that Bucky includes by default. You will need to whitelist these if you use the default configuration of Bucky and enable whitelisting"

@msgauri
Copy link
Author

msgauri commented Jan 29, 2016

@zackbloom could you review this and check if its ok to merge this?


module.exports = ({app, logger, config}, next) ->
collectorHandler = (collectors) ->
return (req, res) ->
if useWhitelistedKeys
if not _.every(_.keys(req.body), (v) -> _.contains(whitelistedkeys, v))
res.send(406, '')
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably respond with a meaningful error message here. I'm also not sure if it wouldn't make sense to accept the keys which do match the whitelist, rather than returning an error, in the interest of being able to use the BuckyClient software which automatically generates keys.

@@ -36,3 +37,23 @@ modules:
# - ./modules/statsd
# - ./modules/openTSDB
# - ./modules/influxdb

whitelistedKeys:
Copy link
Contributor

Choose a reason for hiding this comment

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

In trying to run this, it looks like this file is invalid YAML in this current form. I think you need to fix the indentation perhaps?

Copy link
Author

Choose a reason for hiding this comment

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

Uncommenting atleast 1 of the keys should fix that issue. This is similar to having to uncomment atleast 1 collectors.

@msgauri
Copy link
Author

msgauri commented Feb 22, 2016

@zackbloom I have uncommented the default keys sent by bucky in the yaml. It should work in its current form. Please check and merge if everything looks right.

@msgauri
Copy link
Author

msgauri commented Apr 19, 2016

@zackbloom wanted to check with you if you need anything from us after the last comment? Or is this ready to merge?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants