Skip to content

Commit

Permalink
Logs route path access
Browse files Browse the repository at this point in the history
  • Loading branch information
TinaHeiligers committed Mar 2, 2023
1 parent 54d6321 commit bf7a3c3
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ export class HttpServer {
}

private configureRoute(route: RouterRoute) {
const optionsLogger = this.logger.get('http', 'server', this.name, 'options');
this.log.debug(`registering route handler for [${route.path}]`);
// Hapi does not allow payload validation to be specified for 'head' or 'get' requests
const validate = isSafeMethod(route.method) ? undefined : { payload: true };
Expand All @@ -526,6 +527,10 @@ export class HttpServer {
xsrfRequired: route.options.xsrfRequired ?? !isSafeMethod(route.method),
access: route.options.access ?? (route.path.startsWith('/internal') ? 'internal' : 'public'),
};
// Log HTTP API target consumer. Warning: may log sensitive information on paths including secrets
optionsLogger.debug(
`kibanaRouteOptions [${kibanaRouteOptions.access}] for path [${route.path}]`
);

this.server!.route({
handler: route.handler,
Expand Down

0 comments on commit bf7a3c3

Please sign in to comment.