Skip to content

Commit

Permalink
Merge pull request #71 from airween/issue70
Browse files Browse the repository at this point in the history
fix: Remove strict '&' usage from front of targets
  • Loading branch information
airween authored Apr 10, 2024
2 parents 88ef01a + 93735e2 commit b982800
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/secrules_parsing/model/secrules.tx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ There is no check against collections existance, or typying between variables an
FILES is a collection, so it doesn't belong here
*/
Variable:
'!'? ('ARGS_COMBINED_SIZE' | 'ARGS_GET_NAMES' | 'ARGS_NAMES' | 'ARGS_POST_NAMES' |
'!'? '&'? ('ARGS_COMBINED_SIZE' | 'ARGS_GET_NAMES' | 'ARGS_NAMES' | 'ARGS_POST_NAMES' |
'AUTH_TYPE' | 'DURATION' | 'FILES_COMBINED_SIZE' | 'FILES_NAMES' | 'FILES' |
'FULL_REQUEST' | 'FULL_REQUEST_LENGTH' | 'FILES_SIZES' | 'FILES_TMPNAMES' |
'FILES_TMP_CONTENT' | 'HIGHEST_SEVERITY' | 'INBOUND_DATA_ERROR' | 'MATCHED_VAR_NAME' |
Expand All @@ -69,11 +69,9 @@ Variable:
'STATUS_LINE' | 'STREAM_INPUT_BODY' | 'STREAM_OUTPUT_BODY' | 'TIME' | 'TIME_DAY' | 'TIME_EPOCH' |
'TIME_HOUR' | 'TIME_MIN' | 'TIME_MON' | 'TIME_SEC' | 'TIME_WDAY' | 'TIME_YEAR' | 'UNIQUE_ID' |
'URLENCODED_ERROR' | 'USERID' | 'USERAGENT_IP' | 'WEBAPPID' | 'WEBSERVER_ERROR_LOG' |
count=Count? collection=CollectionName ':'? collectionArg=CollectionArgument?) |
collection=CollectionName ':'? collectionArg=CollectionArgument?) |
SpecialCollection | 'MATCHED_VAR';

CollectionCount: '&' collection=CollectionName ':' VariableName;

VariableOrCollection: Variable | CollectionName;

// CollectionArgument: AnythingBetweenSlashes | "'"? '/' SlashedRegExp '/' "'"? | VariableName;
Expand All @@ -94,8 +92,6 @@ XPathExpression: /(\/\*|\/\/@\*)/;
AnythingBetweenSlashes: /(\*|\\\/)+/;
AnythingBetweenSingleQuotes: /\'.+\'/;

Count: '&';

//- pattern match (pm/pmf)
Operator:
('beginsWith' beginswith=PathOrMacro | 'contains' contains=PatternMatch | 'containsWord' containsWord=STRING |
Expand Down

0 comments on commit b982800

Please sign in to comment.