|
1 | 1 | <?xml version="1.0"?> |
2 | | -<ruleset name="Drupal7Security"> |
3 | | - <description>Rules for Drupal 7 projects</description> |
4 | | -<!-- Code Reviews Rules --> |
5 | | -<!-- |
6 | | - <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/> |
7 | | - <rule ref="PEAR"/> |
8 | | ---> |
| 2 | +<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Drupal7Security" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd"> |
| 3 | + <description>Rules for Drupal 7 projects</description> |
9 | 4 |
|
10 | | -<!-- Security Code Reviews Rules --> |
| 5 | + <!-- Code Reviews Rules --> |
| 6 | + <!-- |
| 7 | + <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/> |
| 8 | + <rule ref="PEAR"/> |
| 9 | + --> |
11 | 10 |
|
12 | | -<!-- Global properties --> |
13 | | -<!-- Please note that not every sniff uses them and they can be overwritten by rule --> |
14 | | -<!-- Framework or CMS used. Must be a class under Security_Sniffs. --> |
15 | | -<config name="CmsFramework" value="Drupal7"/> |
16 | | -<!-- Paranoia mode: Will generate more alerts but will miss less vulnerabilites. Good for assisting manual code review. --> |
17 | | -<config name="ParanoiaMode" value="1"/> |
| 11 | + <!-- Security Code Reviews Rules --> |
18 | 12 |
|
19 | | -<!-- BadFunctions --> |
20 | | -<!-- PHP functions that can lead to security issues --> |
21 | | -<rule ref="Security.BadFunctions.Asserts"/> |
22 | | -<rule ref="Security.BadFunctions.Backticks"/> |
23 | | -<rule ref="Security.BadFunctions.CallbackFunctions"/> |
24 | | -<rule ref="Security.BadFunctions.CryptoFunctions"/> |
25 | | -<rule ref="Security.BadFunctions.EasyRFI"/> |
26 | | -<rule ref="Security.BadFunctions.EasyXSS"/> |
27 | | -<rule ref="Security.BadFunctions.ErrorHandling"/> |
28 | | -<rule ref="Security.BadFunctions.FilesystemFunctions"/> |
29 | | -<rule ref="Security.BadFunctions.FringeFunctions"/> |
30 | | -<rule ref="Security.BadFunctions.FunctionHandlingFunctions"/> |
31 | | -<rule ref="Security.BadFunctions.Mysqli"/> |
32 | | -<rule ref="Security.BadFunctions.NoEvals"/> |
33 | | -<rule ref="Security.BadFunctions.Phpinfos"/> |
34 | | -<rule ref="Security.BadFunctions.PregReplace"/> |
35 | | -<rule ref="Security.BadFunctions.SQLFunctions"/> |
36 | | -<rule ref="Security.BadFunctions.SystemExecFunctions"/> |
| 13 | + <!-- Global properties. --> |
| 14 | + <!-- Please note that not every sniff uses them and they can be overwritten per rule. --> |
| 15 | + <!-- Framework or CMS used. Must be a class under Security_Sniffs. --> |
| 16 | + <config name="CmsFramework" value="Drupal7"/> |
| 17 | + <!-- Paranoia mode: Will generate more alerts but will miss less vulnerabilites. Good for assisting manual code review. --> |
| 18 | + <config name="ParanoiaMode" value="1"/> |
37 | 19 |
|
38 | | -<!-- CVE --> |
39 | | -<!-- Entries from CVE database from vendor PHP and bugs.php.net --> |
40 | | -<rule ref="Security.CVE.CVE20132110"/> |
41 | | -<rule ref="Security.CVE.CVE20134113"/> |
| 20 | + <!-- BadFunctions --> |
| 21 | + <!-- PHP functions that can lead to security issues --> |
| 22 | + <rule ref="Security.BadFunctions.Asserts"/> |
| 23 | + <rule ref="Security.BadFunctions.Backticks"/> |
| 24 | + <rule ref="Security.BadFunctions.CallbackFunctions"/> |
| 25 | + <rule ref="Security.BadFunctions.CryptoFunctions"/> |
| 26 | + <rule ref="Security.BadFunctions.EasyRFI"/> |
| 27 | + <rule ref="Security.BadFunctions.EasyXSS"/> |
| 28 | + <rule ref="Security.BadFunctions.ErrorHandling"/> |
| 29 | + <rule ref="Security.BadFunctions.FilesystemFunctions"/> |
| 30 | + <rule ref="Security.BadFunctions.FringeFunctions"/> |
| 31 | + <rule ref="Security.BadFunctions.FunctionHandlingFunctions"/> |
| 32 | + <rule ref="Security.BadFunctions.Mysqli"/> |
| 33 | + <rule ref="Security.BadFunctions.NoEvals"/> |
| 34 | + <rule ref="Security.BadFunctions.Phpinfos"/> |
| 35 | + <rule ref="Security.BadFunctions.PregReplace"/> |
| 36 | + <rule ref="Security.BadFunctions.SQLFunctions"/> |
| 37 | + <rule ref="Security.BadFunctions.SystemExecFunctions"/> |
42 | 38 |
|
43 | | -<!-- Misc --> |
44 | | -<rule ref="Security.Misc.BadCorsHeader"/> |
45 | | -<rule ref="Security.Misc.IncludeMismatch"/> |
| 39 | + <!-- CVE --> |
| 40 | + <!-- Entries from CVE database from vendor PHP and bugs.php.net. --> |
| 41 | + <rule ref="Security.CVE.CVE20132110"/> |
| 42 | + <rule ref="Security.CVE.CVE20134113"/> |
46 | 43 |
|
47 | | -<!-- Drupal7 --> |
48 | | -<!-- Specific security issues of Drupal7 and advisories --> |
49 | | -<rule ref="Security.Drupal7.AdvisoriesContrib"> |
50 | | - <exclude-pattern>(?<!\.info)$</exclude-pattern> |
51 | | -</rule> |
52 | | -<rule ref="Security.Drupal7.AdvisoriesCore"> |
53 | | - <exclude-pattern>(?<!includes\/bootstrap\.inc)$</exclude-pattern> |
54 | | -</rule> |
55 | | -<rule ref="Security.Drupal7.SQLi"/> |
56 | | -<rule ref="Security.Drupal7.SQLi.D7NoDbQuery"/> |
57 | | -<rule ref="Security.Drupal7.SQLi.D7DbQuerySQLi"/> |
58 | | -<rule ref="Security.Drupal7.SQLi.D7DbQueryDirectVar"/> |
59 | | -<rule ref="Security.Drupal7.XSSPTheme"/> |
60 | | -<rule ref="Security.Drupal7.UserInputWatch"> |
61 | | - <properties> |
62 | | - <property name="FormThreshold" value="10"/> |
63 | | - <property name="FormStateThreshold" value="10"/> |
64 | | - </properties> |
65 | | -</rule> |
66 | | -<rule ref="Security.Drupal7.XSSFormValue"/> |
67 | | -<rule ref="Security.Drupal7.XSSHTMLConstruct"/> |
68 | | -<rule ref="Security.Drupal7.DbQueryAC"> |
69 | | - <properties> |
70 | | - <!-- Comment out to follow global ParanoiaMode --> |
71 | | - <property name="forceParanoia" value="1"/> |
72 | | - </properties> |
73 | | -</rule> |
74 | | -<rule ref="Security.Drupal7.DynQueries"/> |
75 | | -<rule ref="Security.Drupal7.Cachei"/> |
76 | | -<rule ref="Security.Drupal7.HttpRequest"/> |
| 44 | + <!-- Misc --> |
| 45 | + <rule ref="Security.Misc.BadCorsHeader"/> |
| 46 | + <rule ref="Security.Misc.IncludeMismatch"/> |
77 | 47 |
|
78 | | -</ruleset> |
| 48 | + <!-- Drupal 7 --> |
| 49 | + <!-- Specific security issues of Drupal7 and advisories. --> |
| 50 | + <rule ref="Security.Drupal7.AdvisoriesContrib"> |
| 51 | + <exclude-pattern>(?<!\.info)$</exclude-pattern> |
| 52 | + </rule> |
| 53 | + <rule ref="Security.Drupal7.AdvisoriesCore"> |
| 54 | + <exclude-pattern>(?<!includes\/bootstrap\.inc)$</exclude-pattern> |
| 55 | + </rule> |
| 56 | + <rule ref="Security.Drupal7.SQLi"/> |
| 57 | + <rule ref="Security.Drupal7.SQLi.D7NoDbQuery"/> |
| 58 | + <rule ref="Security.Drupal7.SQLi.D7DbQuerySQLi"/> |
| 59 | + <rule ref="Security.Drupal7.SQLi.D7DbQueryDirectVar"/> |
| 60 | + <rule ref="Security.Drupal7.XSSPTheme"/> |
| 61 | + <rule ref="Security.Drupal7.UserInputWatch"> |
| 62 | + <properties> |
| 63 | + <property name="FormThreshold" value="10"/> |
| 64 | + <property name="FormStateThreshold" value="10"/> |
| 65 | + </properties> |
| 66 | + </rule> |
| 67 | + <rule ref="Security.Drupal7.XSSFormValue"/> |
| 68 | + <rule ref="Security.Drupal7.XSSHTMLConstruct"/> |
| 69 | + <rule ref="Security.Drupal7.DbQueryAC"> |
| 70 | + <properties> |
| 71 | + <!-- Comment out to follow global ParanoiaMode --> |
| 72 | + <property name="forceParanoia" value="1"/> |
| 73 | + </properties> |
| 74 | + </rule> |
| 75 | + <rule ref="Security.Drupal7.DynQueries"/> |
| 76 | + <rule ref="Security.Drupal7.Cachei"/> |
| 77 | + <rule ref="Security.Drupal7.HttpRequest"/> |
79 | 78 |
|
| 79 | +</ruleset> |
0 commit comments