bereng commented on a change in pull request #1398:
URL: https://github.com/apache/cassandra/pull/1398#discussion_r783649458
##########
File path: src/java/org/apache/cassandra/audit/AuditLogManager.java
##########
@@ -154,7 +163,21 @@ else if (e instanceof AuthenticationException)
builder.setType(AuditLogEntryType.REQUEST_FAILURE);
}
-
builder.appendToOperation(QueryEvents.instance.getObfuscator().obfuscate(e.getMessage()));
+ // A syntax error may reveal the password in the form of 'line 1:33
mismatched input 'secret_password''
+ String safeMsg = e.getMessage();
+ if (e instanceof SyntaxException && queries != null &&
!queries.isEmpty())
+ {
+ for (String query : queries)
+ {
+ if
(query.toLowerCase().contains(PasswordObfuscator.PASSWORD_TOKEN))
+ {
+ safeMsg = "Syntax Exception. Obscured for security
reasons.";
+ break;
+ }
+ }
+ }
+
+ builder.appendToOperation(PasswordObfuscator.obfuscate(safeMsg));
Review comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]