Skip to content

Commit c81bdb9

Browse files
authored
feature: Add 'Scan Type' field to Pattern object [TAROT-2627]
1 parent ad329bc commit c81bdb9

File tree

1 file changed

+53
-0
lines changed
  • codacy-plugins-api/src/main/scala/com/codacy/plugins/api/results

1 file changed

+53
-0
lines changed

codacy-plugins-api/src/main/scala/com/codacy/plugins/api/results/Pattern.scala

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ object Pattern {
3232
level: Result.Level,
3333
category: Category,
3434
subcategory: Option[Subcategory],
35+
scanType: Option[ScanType],
3536
parameters: Set[Parameter.Specification] = Set.empty,
3637
languages: Set[Language] = Set.empty,
3738
enabled: Boolean = false) {
@@ -50,4 +51,56 @@ object Pattern {
5051
InsecureModulesLibraries, Visibility, CSRF, Android, MaliciousCode, Cryptography, CommandInjection, FirefoxOS,
5152
Auth, DoS, SQLInjection, Routes, Regex, SSL, Other = Value
5253
}
54+
55+
/** ScanType represents the type of analysis performed to discover issues that match the associated patterns.
56+
*
57+
* Scan types can be divided into two "categories":
58+
* - Static scan types: these are the only scan types that can actually be associated to a pattern of our static
59+
* analysis pipeline. These scans are performed on "static" source code.
60+
* - SAST
61+
* - SCA
62+
* - ContainerSCA
63+
* - Secrets
64+
* - IaC
65+
* - CICD
66+
* - License
67+
* - Dynamic scan types: are performed on live applications and can never be associated with patterns of our static
68+
* analysis pipeline. They are defined here for completion.
69+
* - PenTesting
70+
* - DAST
71+
* - CSPM
72+
*/
73+
type ScanType = ScanType.Value
74+
object ScanType extends Enumeration {
75+
76+
/** Static application security testing, i.e. source code scanning. */
77+
val SAST = Value
78+
79+
/** Software composition analysis or supply chain security. Scan open source libraries that projects depend on for vulnerabilities or CVEs.*/
80+
val SCA = Value
81+
82+
/** Like SCA but scanning container dependencies. */
83+
val ContainerSCA = Value
84+
85+
/** Scan files for exposed API keys, passwords, certificates, encryption keys, etc. */
86+
val Secrets = Value
87+
88+
/** Scan infrastructure-as-code files for misconfigurations and vulnerabilities. */
89+
val IaC = Value
90+
91+
/** Scan CI/CD files for misconfigurations and vulnerabilities. */
92+
val CICD = Value
93+
94+
/** Scan license files for compliance with organization policies. */
95+
val License = Value
96+
97+
/** Manually scan an application or system for vulnerabilities. */
98+
val PenTesting = Value
99+
100+
/** Similar to pen-testing, but automated and not as customizable. */
101+
val DAST = Value
102+
103+
/** Cloud security posture management. Scan live cloud environments for infrastructure and configuration risks. */
104+
val CSPM = Value
105+
}
53106
}

0 commit comments

Comments
 (0)