Skip to content

Commit

Permalink
Fixes for Elasticsearch query correctness CI tests
Browse files Browse the repository at this point in the history
* Quoting in rule
* Reading queries without special processing of backslashes

Unfortunately, backslashes still cause breaks caused by Bash handling of
them.
  • Loading branch information
thomaspatzke committed Apr 9, 2018
1 parent 24d94d3 commit 788111f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rules/application/app_sqlinjection_errors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ detection:
# SQL Server
- Unclosed quotation mark
# SQLite
- near "*": syntax error
- 'near "*": syntax error'
- SELECTs to the left and right of UNION do not have the same number of result columns
condition: keywords
falsepositives:
Expand Down
4 changes: 2 additions & 2 deletions tests/test-backend-es-qs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

#set -vx

curl -XPUT 'localhost:9200/test?pretty' -H 'Content-Type: application/json' -d'
{
Expand All @@ -12,7 +12,7 @@ curl -XPUT 'localhost:9200/test?pretty' -H 'Content-Type: application/json' -d'
}
'
tools/sigmac -t es-qs -Orulecomment -I -r rules/ > es-queries.txt
while read line
while read -r line
do
if [[ $line == \#* ]]
then
Expand Down

0 comments on commit 788111f

Please sign in to comment.