Skip to content

Commit

Permalink
Merge pull request #1659 from projectdiscovery/unkown-severity-value
Browse files Browse the repository at this point in the history
Added unknown as severity value when it is not known
  • Loading branch information
ehsandeep committed Feb 28, 2022
2 parents d3f06ec + 7ccd2ed commit d380330
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions v2/pkg/model/types/severity/severity.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const (
High
// name:critical
Critical
// name:unknown
Unknown
limit
)

Expand All @@ -33,6 +35,7 @@ var severityMappings = map[Severity]string{
Medium: "medium",
High: "high",
Critical: "critical",
Unknown: "unknown",
}

func GetSupportedSeverities() Severities {
Expand Down
2 changes: 1 addition & 1 deletion v2/pkg/model/types/severity/severity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d380330

Please sign in to comment.