Skip to content

Commit 41c0a86

Browse files
Update rule metadata (#1202)
1 parent cb51089 commit 41c0a86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+266
-100
lines changed

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S1523.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
</ul>
66
<p>Some APIs enable the execution of dynamic code by providing it as strings at runtime. These APIs might be useful in some very specific
77
meta-programming use-cases. However most of the time their use is frowned upon because they also increase the risk of maliciously <a
8-
href="https://www.owasp.org/index.php/Code_Injection">Injected Code</a>. Such attacks can either run on the server or in the client (example: XSS
9-
attack) and have a huge impact on an application’s security.</p>
8+
href="https://owasp.org/www-community/attacks/Code_Injection">Injected Code</a>. Such attacks can either run on the server or in the client (example:
9+
XSS attack) and have a huge impact on an application’s security.</p>
1010
<p>This rule marks for review each occurrence of such dynamic code execution. This rule does not detect code injections. It only highlights the use of
1111
APIs which should be used sparingly and very carefully.</p>
1212
<h2>Ask Yourself Whether</h2>
@@ -45,7 +45,7 @@ <h2>Sensitive Code Example</h2>
4545
<h2>See</h2>
4646
<ul>
4747
<li> <a href="https://owasp.org/Top10/A03_2021-Injection/">OWASP Top 10 2021 Category A3</a> - Injection </li>
48-
<li> <a href="https://www.owasp.org/index.php/Top_10-2017_A1-Injection">OWASP Top 10 2017 Category A1</a> - Injection </li>
48+
<li> <a href="https://owasp.org/www-project-top-ten/2017/A1_2017-Injection">OWASP Top 10 2017 Category A1</a> - Injection </li>
4949
<li> <a href="https://cwe.mitre.org/data/definitions/95">MITRE, CWE-95</a> - Improper Neutralization of Directives in Dynamically Evaluated Code
5050
('Eval Injection') </li>
5151
</ul>

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S1523.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@
3030
],
3131
"PCI DSS 4.0": [
3232
"6.2.4"
33+
],
34+
"ASVS 4.0": [
35+
"5.2.4",
36+
"5.5.4"
3337
]
3438
},
3539
"quickfix": "unknown"

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S1607.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<p>When a test fails due, for example, to infrastructure issues, you might want to ignore it temporarily. But without some kind of notation about why
2-
the test is being ignored, it may never be reactivated. Such tests are difficult to address without comprehensive knowledge of the project, and end up
3-
polluting their projects.</p>
2+
the test is being ignored, it may never be reactivated. Such tests are difficult to address without comprehensive knowledge of the project, and end up
3+
polluting their projects.</p>
44
<p>This rule raises an issue for each skipped test with "<code>unittest.skip</code>" or "<code>pytest.mark.skip</code>" without providing a reason
5-
argument.</p>
5+
argument.</p>
66
<h2>Noncompliant Code Example</h2>
77
<pre>
88
import unittest
@@ -19,6 +19,6 @@ <h2>Compliant Solution</h2>
1919
</pre>
2020
<h2>See</h2>
2121
<p><a href="https://docs.python.org/3/library/unittest.html#skipping-tests-and-expected-failures">Unittest documentation - skipping tests and expected
22-
failures</a></p>
22+
failures</a></p>
2323
<p><a href="https://docs.pytest.org/en/latest/how-to/skipping.html#skipping-test-functions">Pytest documentation - skipping test functions</a></p>
2424

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S1721.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ <h2>Compliant Solution</h2>
1515
print "x is now %d" % (x)
1616
x += 1
1717
</pre>
18+
<h2>Deprecated</h2>
19+
<p>This rule is deprecated; use {rule:python:S5905} instead.</p>
1820

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S1721.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "Parentheses should not be used after certain keywords",
33
"type": "CODE_SMELL",
4-
"status": "ready",
4+
"status": "deprecated",
55
"remediation": {
66
"func": "Constant\/Issue",
77
"constantCost": "1 min"

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S1854.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ <h2>Noncompliant Code Example</h2>
55
<pre>
66
def func(a, b, compute):
77
i = a + b # Noncompliant; calculation result not used before value is overwritten
8-
i = compute() # Noncompliant; the value is not used before leaving the function
8+
i = compute()
9+
return i
910
</pre>
1011
<h2>Compliant Solution</h2>
1112
<pre>

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S2053.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ <h2>Compliant Solution</h2>
3838
<h2>See</h2>
3939
<ul>
4040
<li> <a href="https://owasp.org/Top10/A02_2021-Cryptographic_Failures/">OWASP Top 10 2021 Category A2</a> - Cryptographic Failures </li>
41-
<li> <a href="https://www.owasp.org/index.php/Top_10-2017_A3-Sensitive_Data_Exposure">OWASP Top 10 2017 Category A3</a> - Sensitive Data Exposure
42-
</li>
41+
<li> <a href="https://www.owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure">OWASP Top 10 2017 Category A3</a> - Sensitive Data
42+
Exposure </li>
4343
<li> <a href="https://cwe.mitre.org/data/definitions/759">MITRE, CWE-759</a> - Use of a One-Way Hash without a Salt </li>
4444
<li> <a href="https://cwe.mitre.org/data/definitions/760">MITRE, CWE-760</a> - Use of a One-Way Hash with a Predictable Salt </li>
4545
<li> <a href="https://www.sans.org/top25-software-errors/#cat3">SANS Top 25</a> - Porous Defenses </li>

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S2068.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ <h2>See</h2>
4141
<ul>
4242
<li> <a href="https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/">OWASP Top 10 2021 Category A7</a> - Identification and
4343
Authentication Failures </li>
44-
<li> <a href="https://www.owasp.org/index.php/Top_10-2017_A2-Broken_Authentication">OWASP Top 10 2017 Category A2</a> - Broken Authentication </li>
44+
<li> <a href="https://owasp.org/www-project-top-ten/2017/A2_2017-Broken_Authentication">OWASP Top 10 2017 Category A2</a> - Broken Authentication
45+
</li>
4546
<li> <a href="https://cwe.mitre.org/data/definitions/798">MITRE, CWE-798</a> - Use of Hard-coded Credentials </li>
4647
<li> <a href="https://cwe.mitre.org/data/definitions/259">MITRE, CWE-259</a> - Use of Hard-coded Password </li>
4748
<li> <a href="https://www.sans.org/top25-software-errors/#cat3">SANS Top 25</a> - Porous Defenses </li>

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S2068.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
],
3232
"PCI DSS 4.0": [
3333
"6.2.4"
34+
],
35+
"ASVS 4.0": [
36+
"2.10.4",
37+
"3.5.2",
38+
"6.4.1"
3439
]
3540
}
3641
}

python-checks/src/main/resources/org/sonar/l10n/py/rules/python/S2077.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ <h2>Ask Yourself Whether</h2>
1010
<p>There is a risk if you answered yes to any of those questions.</p>
1111
<h2>Recommended Secure Coding Practices</h2>
1212
<ul>
13-
<li> Use <a href="https://www.owasp.org/index.php/Query_Parameterization_Cheat_Sheet">parameterized queries, prepared statements, or stored
14-
procedures</a> and bind variables to SQL query parameters. </li>
13+
<li> Use <a href="https://cheatsheetseries.owasp.org/cheatsheets/Query_Parameterization_Cheat_Sheet.html">parameterized queries, prepared
14+
statements, or stored procedures</a> and bind variables to SQL query parameters. </li>
1515
<li> Consider using ORM frameworks if there is a need to have an abstract layer to access data. </li>
1616
</ul>
1717
<h2>Sensitive Code Example</h2>
@@ -58,12 +58,10 @@ <h2>Compliant Solution</h2>
5858
<h2>See</h2>
5959
<ul>
6060
<li> <a href="https://owasp.org/Top10/A03_2021-Injection/">OWASP Top 10 2021 Category A3</a> - Injection </li>
61-
<li> <a href="https://www.owasp.org/index.php/Top_10-2017_A1-Injection">OWASP Top 10 2017 Category A1</a> - Injection </li>
61+
<li> <a href="https://owasp.org/www-project-top-ten/2017/A1_2017-Injection">OWASP Top 10 2017 Category A1</a> - Injection </li>
62+
<li> <a href="https://cwe.mitre.org/data/definitions/20">MITRE, CWE-20</a> - Improper Input Validation </li>
6263
<li> <a href="https://cwe.mitre.org/data/definitions/89">MITRE, CWE-89</a> - Improper Neutralization of Special Elements used in an SQL Command
6364
</li>
64-
<li> <a href="https://cwe.mitre.org/data/definitions/564">MITRE, CWE-564</a> - SQL Injection: Hibernate </li>
65-
<li> <a href="https://cwe.mitre.org/data/definitions/20">MITRE, CWE-20</a> - Improper Input Validation </li>
66-
<li> <a href="https://cwe.mitre.org/data/definitions/943">MITRE, CWE-943</a> - Improper Neutralization of Special Elements in Data Query Logic </li>
6765
<li> <a href="https://www.sans.org/top25-software-errors/#cat1">SANS Top 25</a> - Insecure Interaction Between Components </li>
6866
<li> Derived from FindSecBugs rules <a href="https://h3xstream.github.io/find-sec-bugs/bugs.htm#SQL_INJECTION_JPA">Potential SQL/JPQL Injection
6967
(JPA)</a>, <a href="https://h3xstream.github.io/find-sec-bugs/bugs.htm#SQL_INJECTION_JDO">Potential SQL/JDOQL Injection (JDO)</a>, <a

0 commit comments

Comments
 (0)