Skip to content

Commit

Permalink
Update RSPEC (#6096)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-mikula-sonarsource authored Sep 15, 2022
1 parent 7ac10e5 commit c834145
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 86 deletions.
12 changes: 2 additions & 10 deletions analyzers/rspec/cs/S2115_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,8 @@
"6.2.4"
],
"ASVS 4.0": [
"2.1.1",
"2.1.11",
"2.1.12",
"2.1.2",
"2.1.3",
"2.1.4",
"2.1.7",
"2.1.8",
"2.1.9",
"2.10.3"
"9.2.2",
"9.2.3"
]
},
"quickfix": "unknown"
Expand Down
22 changes: 21 additions & 1 deletion analyzers/rspec/cs/S3353_c#.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h2>Noncompliant Code Example</h2>
<pre>
public bool Seek(int[] input)
{
int target = 32; // Noncompliant
var target = 32; // Noncompliant
foreach (int i in input)
{
if (i == target)
Expand All @@ -15,6 +15,16 @@ <h2>Noncompliant Code Example</h2>
return false;
}
</pre>
<p>or</p>
<pre>
public class Sample
{
public void Method()
{
var context = $"{nameof(Sample)}.{nameof(Method)}"; // Noncompliant (C# 10 and above only)
}
}
</pre>
<h2>Compliant Solution</h2>
<pre>
public bool Seek(int[] input)
Expand All @@ -30,4 +40,14 @@ <h2>Compliant Solution</h2>
return false;
}
</pre>
<p>or</p>
<pre>
public class Sample
{
public void Method()
{
const string context = $"{nameof(Sample)}.{nameof(Method)}";
}
}
</pre>

12 changes: 1 addition & 11 deletions analyzers/rspec/cs/S4423_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,9 @@
"6.2.4"
],
"ASVS 4.0": [
"1.9.2",
"2.8.3",
"2.9.3",
"6.2.2",
"6.2.3",
"6.2.4",
"6.2.5",
"6.2.6",
"6.2.7",
"8.3.7",
"9.1.2",
"9.1.3",
"9.2.1"
"9.1.3"
]
},
"quickfix": "unknown"
Expand Down
9 changes: 1 addition & 8 deletions analyzers/rspec/cs/S4426_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,7 @@
"A2"
],
"ASVS 4.0": [
"2.8.3",
"6.2.3",
"6.2.4",
"6.2.5",
"6.2.6",
"6.2.7",
"9.1.2",
"9.1.3"
"6.2.3"
]
},
"quickfix": "unknown"
Expand Down
12 changes: 2 additions & 10 deletions analyzers/rspec/cs/S4433_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,8 @@
"6.2.4"
],
"ASVS 4.0": [
"2.1.1",
"2.1.11",
"2.1.12",
"2.1.2",
"2.1.3",
"2.1.4",
"2.1.7",
"2.1.8",
"2.1.9",
"2.10.3"
"9.2.2",
"9.2.3"
]
},
"quickfix": "unknown"
Expand Down
5 changes: 1 addition & 4 deletions analyzers/rspec/cs/S4792_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
],
"ASVS 4.0": [
"7.1.1",
"7.1.2",
"7.3.1",
"7.3.2",
"8.3.5"
"7.1.2"
]
}
}
2 changes: 1 addition & 1 deletion analyzers/rspec/cs/S5542_c#.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<li> For block cipher encryption algorithms (like AES):
<ul>
<li> The ECB (Electronic Codebook) cipher mode doesn’t provide serious message confidentiality: under a given key any given plaintext block
always gets encrypted to the same ciphertext block. This mode never be used. </li>
always gets encrypted to the same ciphertext block. This mode should never be used. </li>
<li> The CBC (Cipher Block Chaining) mode by itself provides only data confidentiality. This cipher mode is also vulnerable to <a
href="https://en.wikipedia.org/wiki/Padding_oracle_attack">padding oracle attacks</a> when used with padding. Using CBC along with Message
Authentication Code can provide data integrity and should prevent such attacks. In practice the implementation has many pitfalls and it’s
Expand Down
9 changes: 1 addition & 8 deletions analyzers/rspec/cs/S5547_c#.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,10 @@
"6.2.4"
],
"ASVS 4.0": [
"2.8.3",
"2.9.3",
"6.2.2",
"6.2.3",
"6.2.4",
"6.2.5",
"6.2.6",
"6.2.7",
"8.3.7",
"9.1.2",
"9.1.3"
"8.3.7"
]
},
"quickfix": "unknown"
Expand Down
12 changes: 1 addition & 11 deletions analyzers/rspec/vbnet/S4423_vb.net.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,9 @@
"6.2.4"
],
"ASVS 4.0": [
"1.9.2",
"2.8.3",
"2.9.3",
"6.2.2",
"6.2.3",
"6.2.4",
"6.2.5",
"6.2.6",
"6.2.7",
"8.3.7",
"9.1.2",
"9.1.3",
"9.2.1"
"9.1.3"
]
},
"quickfix": "unknown"
Expand Down
5 changes: 1 addition & 4 deletions analyzers/rspec/vbnet/S4792_vb.net.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
],
"ASVS 4.0": [
"7.1.1",
"7.1.2",
"7.3.1",
"7.3.2",
"8.3.5"
"7.1.2"
]
}
}
2 changes: 1 addition & 1 deletion analyzers/rspec/vbnet/S5542_vb.net.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<li> For block cipher encryption algorithms (like AES):
<ul>
<li> The ECB (Electronic Codebook) cipher mode doesn’t provide serious message confidentiality: under a given key any given plaintext block
always gets encrypted to the same ciphertext block. This mode never be used. </li>
always gets encrypted to the same ciphertext block. This mode should never be used. </li>
<li> The CBC (Cipher Block Chaining) mode by itself provides only data confidentiality. This cipher mode is also vulnerable to <a
href="https://en.wikipedia.org/wiki/Padding_oracle_attack">padding oracle attacks</a> when used with padding. Using CBC along with Message
Authentication Code can provide data integrity and should prevent such attacks. In practice the implementation has many pitfalls and it’s
Expand Down
9 changes: 1 addition & 8 deletions analyzers/rspec/vbnet/S5547_vb.net.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,10 @@
"6.2.4"
],
"ASVS 4.0": [
"2.8.3",
"2.9.3",
"6.2.2",
"6.2.3",
"6.2.4",
"6.2.5",
"6.2.6",
"6.2.7",
"8.3.7",
"9.1.2",
"9.1.3"
"8.3.7"
]
},
"quickfix": "unknown"
Expand Down
2 changes: 1 addition & 1 deletion analyzers/src/SonarAnalyzer.CSharp/sonarpedia.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"languages": [
"CSH"
],
"latest-update": "2022-08-18T08:35:17.004977500Z"
"latest-update": "2022-09-14T16:21:02.591923800Z"
}
2 changes: 1 addition & 1 deletion analyzers/src/SonarAnalyzer.VisualBasic/sonarpedia.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"languages": [
"VBNET"
],
"latest-update": "2022-08-18T08:36:58.940958600Z"
"latest-update": "2022-09-14T16:20:27.237152200Z"
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,7 @@ public void test_security_standards_with_vulnerability() {
assertThat(rule.type()).isEqualTo(RuleType.VULNERABILITY);
assertThat(rule.securityStandards()).containsExactlyInAnyOrder(
"cwe:326",
"owaspAsvs-4.0:2.8.3",
"owaspAsvs-4.0:6.2.3",
"owaspAsvs-4.0:6.2.4",
"owaspAsvs-4.0:6.2.5",
"owaspAsvs-4.0:6.2.6",
"owaspAsvs-4.0:6.2.7",
"owaspAsvs-4.0:9.1.2",
"owaspAsvs-4.0:9.1.3",
"owaspTop10-2021:a2",
"owaspTop10:a3",
"owaspTop10:a6");
Expand Down

0 comments on commit c834145

Please sign in to comment.