Merge pull request #1659 from projectdiscovery/unkown-severity-value

Added unknown as severity value when it is not known
This commit is contained in:
Sandeep Singh 2022-03-01 00:21:13 +05:30 committed by GitHub
commit d38033014f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -115,8 +115,8 @@ FILTERING:
-eid, -exclude-id string[] templates to exclude based on template ids (comma-separated, file)
-it, -include-templates string[] templates to be executed even if they are excluded either by default or configuration
-et, -exclude-templates string[] template or template directory to exclude (comma-separated, file)
-s, -severity value[] templates to run based on severity. Possible values: info, low, medium, high, critical
-es, -exclude-severity value[] templates to exclude based on severity. Possible values: info, low, medium, high, critical
-s, -severity value[] templates to run based on severity. Possible values: info, low, medium, high, critical, unknown
-es, -exclude-severity value[] templates to exclude based on severity. Possible values: info, low, medium, high, critical, unknown
-pt, -type value[] templates to run based on protocol type. Possible values: dns, file, http, headless, network, workflow, ssl, websocket, whois
-ept, -exclude-type value[] templates to exclude based on protocol type. Possible values: dns, file, http, headless, network, workflow, ssl, websocket, whois

View File

@ -24,6 +24,8 @@ const (
High
// name:critical
Critical
// name:unknown
Unknown
limit
)
@ -33,6 +35,7 @@ var severityMappings = map[Severity]string{
Medium: "medium",
High: "high",
Critical: "critical",
Unknown: "unknown",
}
func GetSupportedSeverities() Severities {

View File

@ -26,7 +26,7 @@ func TestYamlUnmarshalFail(t *testing.T) {
func TestGetSupportedSeverities(t *testing.T) {
severities := GetSupportedSeverities()
assert.Equal(t, severities, Severities{Info, Low, Medium, High, Critical})
assert.Equal(t, severities, Severities{Info, Low, Medium, High, Critical, Unknown})
}
func testUnmarshal(t *testing.T, unmarshaller func(data []byte, v interface{}) error, payloadCreator func(value string) string) {