Skip to content

Commit cc4762c

Browse files
committed
adjust API authorization logging
1 parent 36b4ad9 commit cc4762c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

x-pack/plugins/security/server/authorization/api_authorization.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export function initAPIAuthorization(
2424

2525
// if there are no tags starting with "access:", just continue
2626
if (actionTags.length === 0) {
27-
logger.debug('API endpoint is not marked with "access:" tags, skipping.');
2827
return toolkit.next();
2928
}
3029

@@ -34,11 +33,11 @@ export function initAPIAuthorization(
3433

3534
// we've actually authorized the request
3635
if (checkPrivilegesResponse.hasAllRequested) {
37-
logger.debug(`authorized for "${request.url.path}"`);
36+
logger.debug(`User authorized for "${request.url.path}"`);
3837
return toolkit.next();
3938
}
4039

41-
logger.debug(`not authorized for "${request.url.path}"`);
40+
logger.warn(`User not authorized for "${request.url.path}": responding with 404`);
4241
return response.notFound();
4342
});
4443
}

0 commit comments

Comments
 (0)