Skip to content

Commit 75584a9

Browse files
github-actions[bot]thomas-serre-sonarsource
authored andcommitted
Update rule metadata (#321)
Co-authored-by: thomas-serre-sonarsource <118730793+thomas-serre-sonarsource@users.noreply.github.com> GitOrigin-RevId: 09e4dfb7a6a00e0c22b5e0d05747e5f6ede4c376
1 parent 7c6c74a commit 75584a9

File tree

17 files changed

+25
-32
lines changed

17 files changed

+25
-32
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ <h2>Why is this an issue?</h2>
1111
<code>__iter__</code> methods generated automatically.</p>
1212
<h2>How to fix it</h2>
1313
<p>Make sure that the <code>__iter__</code> method returns a valid iterator.</p>
14-
<h2>Code examples</h2>
15-
<h3>Noncompliant code example</h3>
14+
<h3>Code examples</h3>
15+
<h4>Noncompliant code example</h4>
1616
<pre data-diff-id="1" data-diff-type="noncompliant">
1717
class MyIterable:
1818
def __init__(self, values):
@@ -21,7 +21,7 @@ <h3>Noncompliant code example</h3>
2121
def __iter__(self):
2222
return None # Noncompliant: Not a valid iterator
2323
</pre>
24-
<h3>Compliant solution</h3>
24+
<h4>Compliant solution</h4>
2525
<pre data-diff-id="1" data-diff-type="compliant">
2626
class MyIterable:
2727
def __init__(self, values):

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<p>This rule is deprecated; use {rule:python:S5852}, {rule:pythonsecurity:S2631} instead.</p>
1+
<p>This rule is deprecated; use {rule:python:S5852} instead.</p>
22
<p>Using regular expressions is security-sensitive. It has led in the past to the following vulnerabilities:</p>
33
<ul>
44
<li> <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16021">CVE-2017-16021</a> </li>

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<p>Cryptographic hash algorithms such as <code>MD2</code>, <code>MD4</code>, <code>MD5</code>, <code>MD6</code>, <code>HAVAL-128</code>,
2-
<code>HMAC-MD5</code>, <code>DSA</code> (which uses <code>SHA-1</code>), <code>RIPEMD</code>, <code>RIPEMD-128</code>, <code>RIPEMD-160</code>,
3-
<code>HMACRIPEMD160</code> and <code>SHA-1</code> are no longer considered secure, because it is possible to have <code>collisions</code> (little
4-
computational effort is enough to find two or more different inputs that produce the same hash).</p>
2+
<code>DSA</code> (which uses <code>SHA-1</code>), <code>RIPEMD</code>, <code>RIPEMD-128</code>, <code>RIPEMD-160</code>and <code>SHA-1</code> are no
3+
longer considered secure, because it is possible to have <code>collisions</code> (little computational effort is enough to find two or more different
4+
inputs that produce the same hash).</p>
5+
<p>Message authentication code (MAC) algorithms such as <code>HMAC-MD5</code> or <code>HMAC-SHA1</code> use weak hash functions as building blocks.
6+
Although they are not all proven to be weak, they are considered legacy algorithms and should be avoided.</p>
57
<h2>Ask Yourself Whether</h2>
68
<p>The hashed value is used in a security context like:</p>
79
<ul>

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ <h3>Documentation</h3>
7070
<h3>Standards</h3>
7171
<ul>
7272
<li> OWASP - <a href="https://owasp.org/Top10/A01_2021-Broken_Access_Control/">Top 10 2021 Category A1 - Broken Access Control</a> </li>
73-
<li> OWASP - <a href="https://owasp.org/www-project-top-ten/2017/A9_2017-Using_Components_with_Known_Vulnerabilities">Top 10 2017 Category A9 -
74-
Using Components with Known Vulnerabilities</a> </li>
7573
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/377">CWE-377 - Insecure Temporary File</a> </li>
7674
<li> CWE - <a href="https://cwe.mitre.org/data/definitions/379">CWE-379 - Creation of Temporary File in Directory with Incorrect Permissions</a>
7775
</li>

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
377,
2525
379
2626
],
27-
"OWASP": [
28-
"A9"
29-
],
3027
"OWASP Top 10 2021": [
3128
"A1"
3229
],

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ <h2>Why is this an issue?</h2>
88
<code>__contains__</code>, <code>__iter__</code>, <code>__getitem__</code>.</p>
99
<p>If none of these methods is implemented, a <code>TypeError</code> will be raised when performing a membership test.</p>
1010
<h2>How to fix it</h2>
11-
<h2>Code examples</h2>
12-
<h3>Noncompliant code example</h3>
11+
<h3>Code examples</h3>
12+
<h4>Noncompliant code example</h4>
1313
<pre>
1414
myint = 42
1515

@@ -23,7 +23,7 @@ <h3>Noncompliant code example</h3>
2323
if "mystring" in A(["mystring"]): # Noncompliant: class A doesn't support membership protocol
2424
...
2525
</pre>
26-
<h3>Compliant solution</h3>
26+
<h4>Compliant solution</h4>
2727
<pre>
2828
mylist = [42]
2929

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,5 @@ <h4>Compliant solution</h4>
2626
</pre>
2727
<h2>Resources</h2>
2828
<h3>Documentation</h3>
29-
<p><a
30-
href="https://docs.djangoproject.com/en/4.1/ref/models/instances/#django.db.models.Model">https://docs.djangoproject.com/en/4.1/ref/models/instances/#django.db.models.Model</a>.<em>str</em>[Django
31-
Model.<em>str</em>()]</p>
29+
<p><a href="https://docs.djangoproject.com/en/4.1/ref/models/instances/#django.db.models.Model.<em>str</em>">Django Model.<em>str</em>()</a></p>
3230

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ <h4>Compliant solution</h4>
3131
<h2>Resources</h2>
3232
<h3>Documentation</h3>
3333
<ul>
34-
<li> Python Documentation - <a
35-
href="https://docs.python.org/3/reference/datamodel.html#object">https://docs.python.org/3/reference/datamodel.html#object</a>.<em>hash</em>[object.<em>hash</em>] </li>
34+
<li> Python Documentation - <a href="https://docs.python.org/3/reference/datamodel.html#object.<em>hash</em>">object.<em>hash</em></a> </li>
3635
<li> Python Documentation - <a href="https://docs.python.org/3/library/functions.html#hash">the hash built-in function</a> </li>
3736
</ul>
3837

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,5 @@ <h4>Compliant solution</h4>
3434
</pre>
3535
<h2>Resources</h2>
3636
<h3>Documentation</h3>
37-
<p>Python Documentation - <a
38-
href="https://docs.python.org/3/library/operator.html#operator">https://docs.python.org/3/library/operator.html#operator</a>.<em>index</em>[<em>index</em>
39-
method]</p>
37+
<p>Python Documentation - <a href="https://docs.python.org/3/library/operator.html#operator.<em>index</em>"><em>index</em> method</a></p>
4038

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"quickfix": "targeted",
1818
"code": {
1919
"impacts": {
20-
"RELIABILITY": "LOW"
20+
"MAINTAINABILITY": "LOW"
2121
},
2222
"attribute": "EFFICIENT"
2323
}

0 commit comments

Comments
 (0)