Skip to content
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

feat: add configurations around endpoint logging #8249

Merged
merged 2 commits into from
Oct 12, 2021

Conversation

agavra
Copy link
Contributor

@agavra agavra commented Oct 12, 2021

Description

Endpoint logging potentially contains sensitive information. This patch allows some more configuration to control this behavior by introducing two configurations:

  • a configuration to avoid filtering the query portion of the URI, this is the disabled by default
  • a configuration to filter out endpoints altogether. this can be used (1) if a security leak is identified in production that cannot be covered by the previous config or (2) to prevent logging of verbose endpoints (such as the heartbeat endpoint)

Testing done

Unit testing

Reviewer checklist

  • Ensure docs are updated if necessary. (eg. if a user visible feature is being added or changed).
  • Ensure relevant issues are linked (description should include text like "Fixes #")

@agavra agavra requested a review from a team as a code owner October 12, 2021 00:57
Copy link
Member

@cprasad1 cprasad1 left a comment

Choose a reason for hiding this comment

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

lgtm

try {
// do not log the query that was sent with the URI, since this may contain
// sensitive user information
final URI uriWithQueryString = new URI(routingContext.request().uri());
Copy link
Member

Choose a reason for hiding this comment

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

uriWithoutQueryString?

Also, I think you can just ask for routingContext.request().path() if you want just the path, rather than having to construct it by hand.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice - thanks for the tip

}
}

if (endpointFilter.isPresent() && endpointFilter.get().matcher(uri).matches()) {
Copy link
Member

Choose a reason for hiding this comment

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

Filter is a bit confusing because some filters take functions which retain their elements rather than remove them. Not sure if I have a suggestion for a name. KSQL_ENDPOINT_LOGGING_SKIP_ENDPOINT_CONFIG?

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 went with KSQL_ENDPOINT_LOGGING_IGNORED_PATHS_REGEX

@agavra agavra merged commit 69bf46d into confluentinc:master Oct 12, 2021
@agavra agavra deleted the uri_logger branch October 12, 2021 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants