Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Sanitize sensitive fields in request header and body in logger #5279

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

Open
0xi4o wants to merge 2 commits into main
base: main
Choose a base branch
Loading
from fix/log-filters

Conversation

@0xi4o
Copy link
Contributor

@0xi4o 0xi4o commented Oct 1, 2025
edited
Loading

Comment on lines 245 to 254
const requestMetadata = {
request: {
method: req.method,
url: req.url,
body: sanitizedBody,// Use sanitized body instead of raw body
query: req.query,
body: sanitizedBody,
query: sanitizedQuery,
params: req.params,
headers: req.headers
headers: sanitizedHeaders
}
}
Copy link

Choose a reason for hiding this comment

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

Even with redaction, logging HTTP request bodies, params and query strings is generally a bad idea because it significantly increases the risk of accidental exposure of sensitive data due to misconfigurations, broken redaction logic, or logs being improperly secured. It also creates a massive compliance burden under regulations like GDPR and CCPA, as these logs can inadvertently capture Personally Identifiable Information that must then be managed and defensibly deleted.

Recommend either removing body, params & querystring from here or putting them behind a log level so they're only captured when debug logs are enabled.

Copy link

Choose a reason for hiding this comment

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

btw, apologies if this changes the requirement from what's on the Jira. The Jira's wording was based on the documented findings. Now that I'm seeing the code and not just the finding, I think the finding's recommendation was not in line with how Workday generally treats areas where sensitive data could slip in. Omitting these specific bits on production request logging is standard practice.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. I'll put them behind the debug log level so the headers, body, and querystring are not logged. They won't be logged in production since we've use the default info.

# LOG_PATH=/your_log_path/.flowise/logs
# LOG_LEVEL=info #(error | warn | info | verbose | debug)
LOG_SANITIZE_BODY_FIELDS=password,pwd,pass,secret,token,apikey,api_key,accesstoken,access_token,refreshtoken,refresh_token,clientsecret,client_secret,privatekey,private_key,secretkey,secret_key,auth,authorization,credential,credentials
LOG_SANITIZE_HEADER_FIELDS=authorization,x-api-key,x-auth-token,cookie
Copy link

Choose a reason for hiding this comment

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

How this will be deployed in the Flowise cloud?
How this will be communicated to Enterprise customers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will not be deployed in Flowise Cloud, since we don't want to log headers, body, and querystring. And we've set the default log level to info so there won't be a need to set these variables for Flowise Cloud.

vasunous reacted with thumbs up emoji
# DEBUG=true
# LOG_PATH=/your_log_path/.flowise/logs
# LOG_LEVEL=info #(error | warn | info | verbose | debug)
LOG_SANITIZE_BODY_FIELDS=password,pwd,pass,secret,token,apikey,api_key,accesstoken,access_token,refreshtoken,refresh_token,clientsecret,client_secret,privatekey,private_key,secretkey,secret_key,auth,authorization,credential,credentials
Copy link

Choose a reason for hiding this comment

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

How did you compile this list? How to validate is there any missing field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just wrote down commonly used keys for sensitive information and their different variations. Since we can't know ahead of time what data will be sent in headers, body, and querystring, it'll be the open-source/enterprise customers' responsibility to configure it based on their requirements.

vasunous reacted with thumbs up emoji
Copy link

@vasunous vasunous left a comment

Choose a reason for hiding this comment

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

I don't have access to approve it. But it looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@HenryHengZJ HenryHengZJ HenryHengZJ approved these changes

+2 more reviewers

@hob hob hob left review comments

@vasunous vasunous vasunous left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /