From 7ad7dc9ace8bae3dff3a5bbf5ea13cc89e2caf39 Mon Sep 17 00:00:00 2001 From: 0xvighnesh Date: Fri, 20 Oct 2023 13:05:05 +0530 Subject: [PATCH] Adding OWASP API 2023 Compliance --- appknox/analyses.go | 1 + appknox/analyses_test.go | 2 ++ helper/analyses.go | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/appknox/analyses.go b/appknox/analyses.go index 9878cce..136ebf5 100644 --- a/appknox/analyses.go +++ b/appknox/analyses.go @@ -103,6 +103,7 @@ type Analysis struct { Cwe []string `json:"cwe,omitempty"` Gdpr []string `json:"gdpr,omitempty"` Mstg []string `json:"mstg,omitempty"` + Owaspapi2023 []string `json:"owaspapi2023,omitempty"` UpdatedOn *time.Time `json:"updated_on,omitempty"` VulnerabilityID int `json:"vulnerability,omitempty"` } diff --git a/appknox/analyses_test.go b/appknox/analyses_test.go index 2cbbe9f..7979641 100644 --- a/appknox/analyses_test.go +++ b/appknox/analyses_test.go @@ -45,6 +45,7 @@ func TestAnalysesCompliance_marshall(t *testing.T) { Cwe: []string{"C_1"}, Gdpr: []string{"G_1", "G_2"}, Mstg: []string{"M_1"}, + Owaspapi2023: []string{"API_2023_8"}, VulnerabilityID: 1, } want := `{ @@ -56,6 +57,7 @@ func TestAnalysesCompliance_marshall(t *testing.T) { "cwe": ["C_1"], "gdpr": ["G_1", "G_2"], "mstg": ["M_1"], + "owaspapi2023": ["API_2023_8"], "vulnerability": 1 }` testJSONMarshal(t, u, want) diff --git a/helper/analyses.go b/helper/analyses.go index 5382f3c..82081e5 100644 --- a/helper/analyses.go +++ b/helper/analyses.go @@ -36,7 +36,7 @@ func ProcessAnalyses(fileID int) { // header is an interface because t.AddHeader only supports // interface elements header := []interface{}{"ID", "RISK", "STATUS", "CVSS-VECTOR", "CVSS-BASE", "CVSS-VERSION", "OWASP", "ASVS", "CWE", - "MSTG"} + "MSTG", "OWASP API 2023"} if profileReportPref.ShowPcidss.Value { header = append(header, "PCI-DSS") } @@ -62,6 +62,7 @@ func ProcessAnalyses(fileID int) { finalAnalyses[i].Asvs, finalAnalyses[i].Cwe, finalAnalyses[i].Mstg, + finalAnalyses[i].Owaspapi2023, } if profileReportPref.ShowPcidss.Value { row = append(row, finalAnalyses[i].Pcidss)