lib/policy_templates/regex-protection/regex.js
function regularExpressions () {
  var regexFile = path.join(process.cwd(), 'regex_rules.json')
  var regex = require(regexFile)
  return regex
}
function regularExpressions () {
  var regexFile = path.join(process.cwd(), 'regex_rules.json')
  var regex = require(regexFile)
  return regex
}
/*
Reguired format of the json file:

[{
"element": "Header",
"filters": [{
"flags": "i",
"rule": "(?:<script.*?>)"
}, {
"flags": "i",
"rule": "(?:<style.*?>.*?((@[i\\\\\\\\])|(([:=]|(&#x?0*((58)|(3A)|(61)|(3D));?)).*?([(\\\\\\\\]|(&#x?0*((40)|(28)|(92)|(5C));?)))))"
}],
"name": "Cookie"
}, {
"element": "XMLPayload",
"filters": [{
"flags": "i",
"rule": "(?:<script.*?[ /+\\t]*?((src)|(xlink:href)|(href))[ /+\\t]*=)"
}, {
"flags": "i",
"rule": "(?:<[i]?frame.*?[ /+\\t]*?src[ /+\\t]*=)"
}],
"name": null
}, {
"element": "QueryParam",
"filters": [{
"flags": "i",
"rule": "([\\s\\\"'`;\\/0-9\\=]+on\\w+\\s*=)"
}, {
"flags": "i",
"rule": "(?:(?:procedure\\s+analyse\\s*?\\()|(?:;\\s*?(declare|open)\\s+[\\w-]+)|(?:create\\s+(procedure|function)\\s*?\\w+\\s*?\\(\\s*?\\)\\s*?-)|(?:declare[^\\w]+[@#]\\s*?\\w+)|(exec\\s*?\\(\\s*?@))"
}, {
"flags": "i",
"rule": "(?:(?:create\\s+function\\s+\\w+\\s+returns)|(?:;\\s*?(?:select|create|rename|truncate|load|alter|delete|update|insert|desc)\\s*?[\\[(]?\\w{2,}))"
}],
"name": ".*"
}]