-
Notifications
You must be signed in to change notification settings - Fork 45
Please provide a way to remove or filter printed env vars #114
Comments
Relevant bit of code that currently reports the env vars: node-report/src/node_report.cc Lines 851 to 875 in 8246487
Some things to discuss:
|
@richardlau how about we introduce 2 new env vars: I think we just provide both options like this. Then, we just indicate that whitelist behavior will override blacklist behavior. Then, we just auto santize each "obscured" env var by logging it as |
The blacklist I understand, and printing it with some kind of replaced value makes sense to me, but what's the use case for the whitelist? |
@sam-github Well, if you consider the motive for this request - it's about security. How you decide on whitelist or blacklist depends on how important this is to your situation. A blacklist is a strategy that says "allow everything - except these". Whitelist is more confined & restrictive:
|
I wasn't clear on how the white and black list interacted. As I understand you know, the black list will be completely ignored if a white list is present. Points 1 and 3 above I don't think should be goals of node-report. node-report is verbose by design (I believe), it doesn't have a way to add/remove sections, or increase and decrease verbosity. Point 2 I find mildly compelling. node-reports aren't public, people concerned about the report output can post-process them to remove anything they want somewhere between disk and whatever log storage they use. Still, white lists look easy to implement when only one of a white or black list has to be considered. Are you interested in implementing this feature, or hoping someone else will? |
@sem-GitHub i must admit, i am a green horn with c++ - however, if u can point me in right direction...id be happy to take a stab at it |
Richard pointed at the relevant code above. I guess you'd have to change it to get the env vars you propose, and check if the env var that is about to be printed is white or black listed. |
For example, currently all env vars are reported:
Per this example,
SOME_API_KEY
is actually considered sensitive and we don't want it printed to console. I think there should be a way to hide these.The text was updated successfully, but these errors were encountered: