diff --git a/internal/report/report.go b/internal/report/report.go index dc11f12..b89e13d 100644 --- a/internal/report/report.go +++ b/internal/report/report.go @@ -61,7 +61,7 @@ func RemoveIgnored(c *commons.Config, tests []commons.Tests) []commons.Tests { for _, check := range test.Checks { checkTmp := check checkTmp.Results = []commons.Result{} - checkTmp.InitCheck(check.Name, check.Description, check.Id, check.Category) + checkTmp.InitCheck(check.Name, check.Description, check.Id, check.Categories) for _, result := range check.Results { if !IsIgnored(c, result, check) { checkTmp.AddResult(result) diff --git a/plugins/commons/check.go b/plugins/commons/check.go index 515da69..6e6b2fb 100644 --- a/plugins/commons/check.go +++ b/plugins/commons/check.go @@ -8,7 +8,7 @@ type Check struct { Description string `yaml:"description"` // Description of the check Status string `yaml:"status"` // Status of the check - OK, FAIL Id string `yaml:"id"` // ID of the check - unique identifier for the check - AWS_IAM_001 - Category string `yaml:"category"` // Category of the check - Security, Cost, Performance, Fault Tolerance, Operational Excellence, etc ... + Categories []string `yaml:"categories"` // Category of the check - Security, Cost, Performance, Fault Tolerance, Operational Excellence, etc ... Results []Result `yaml:"results"` // Results of the check Duration time.Duration `yaml:"duration"` // Duration of the check StartTime time.Time diff --git a/plugins/commons/types.go b/plugins/commons/types.go index b08cb28..e78af31 100644 --- a/plugins/commons/types.go +++ b/plugins/commons/types.go @@ -15,12 +15,12 @@ func (c *Check) AddResult(result Result) { } // Initialise a check -func (c *Check) InitCheck(name, description, id string, category string) { +func (c *Check) InitCheck(name, description, id string, categories []string) { c.Name = name c.Description = description c.Status = "OK" c.Id = id - c.Category = category + c.Categories = categories c.StartTime = time.Now() } diff --git a/plugins/commons/types_test.go b/plugins/commons/types_test.go index 687dd73..f34f67e 100644 --- a/plugins/commons/types_test.go +++ b/plugins/commons/types_test.go @@ -163,7 +163,8 @@ func TestCheck_InitCheck(t *testing.T) { Id: tt.fields.Id, Results: tt.fields.Results, } - c.InitCheck(tt.args.name, tt.args.description, tt.args.id, "test") + categories := []string{"test"} + c.InitCheck(tt.args.name, tt.args.description, tt.args.id, categories) if c.Name != tt.args.name { t.Errorf("Name is not %s", tt.args.name) } diff --git a/plugins/manager/manager.go b/plugins/manager/manager.go index 5bafb00..d039bbe 100644 --- a/plugins/manager/manager.go +++ b/plugins/manager/manager.go @@ -69,7 +69,7 @@ func RunPlugin(pluginInput commons.Plugin, c *commons.Config) []commons.Tests { // This prevents users from executing bad plugins or executing a plugin // directory. It is a UX feature, not a security feature. var handshakeConfig = plugin.HandshakeConfig{ - ProtocolVersion: 1, + ProtocolVersion: 2, MagicCookieKey: "BASIC_PLUGIN", MagicCookieValue: "hello", }