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

Changing logging type to give warning for basic auth with no creds #2334

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions abc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
i
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public boolean authenticate(final RestRequest request, final RestChannel channel

if(authDomain.isChallenge() && httpAuthenticator.reRequestAuthentication(channel, null)) {
auditLog.logFailedLogin("<NONE>", false, null, request);
log.trace("No 'Authorization' header, send 401 and 'WWW-Authenticate Basic'");
log.warn("No 'Authorization' header, send 401 and 'WWW-Authenticate Basic'");
Copy link
Member

Choose a reason for hiding this comment

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

This is a potential denial of surface vector since unauthenticated callers will be able to force this message into the log - leading to full disks. I would much rather this was configurable for OpenSearch administrators, via the log4j configuration file or a configuration setting. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ideally logs should reveal if unauthenticated callers are trying to login. Currently there is zero visibility in it.
Regarding disks being full, log rotation should take care of it.

return false;
} else {
//no reRequest possible
Expand Down