Skip to content

Commit

Permalink
Fix false positive non-superuser errors
Browse files Browse the repository at this point in the history
Regex matching solely against the word "insufficient" means that it's trivial to cause this to alert unnecessarily by merely including the string "insufficient" in one's real query. Instead verify that we don't actually have a real query and know for certain this is an error condition.
  • Loading branch information
jcoleman authored Jan 26, 2022
1 parent 9f536c7 commit 3942fd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion check_postgres.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8737,7 +8737,7 @@ sub check_txn_idle {
my $st = defined($r->{state}) ? $r->{state} : '';

## Return unknown if we cannot see because we are a non-superuser
if ($cq =~ /insufficient/) {
if ($cq eq '<insufficient privilege>') {
add_unknown msg('psa-nosuper');
return;
}
Expand Down

0 comments on commit 3942fd4

Please sign in to comment.