44 "strings"
55
66 "github.com/prometheus/client_golang/prometheus"
7+
8+ "github.com/webdevops/azure-auditor/auditor/types"
79)
810
911type (
@@ -97,7 +99,7 @@ func (validation *AuditConfigValidation) CreatePrometheusMetricFromAzureObject(o
9799 return labels
98100}
99101
100- func (validation * AuditConfigValidation ) Validate (object * AzureObject ) (string , bool ) {
102+ func (validation * AuditConfigValidation ) Validate (object * AzureObject ) (string , types. RuleStatus ) {
101103 resourceID := object .ResourceID ()
102104
103105 if validation .Rules != nil {
@@ -108,7 +110,7 @@ func (validation *AuditConfigValidation) Validate(object *AzureObject) (string,
108110 continue
109111 } else {
110112 // valid is not valid, returning here
111- return rule .Rule , rule .handleRuleStatus (object , false )
113+ return rule .Rule , rule .handleRuleStatus (object , types . RuleStatusDeny )
112114 }
113115 }
114116
@@ -127,7 +129,7 @@ func (validation *AuditConfigValidation) Validate(object *AzureObject) (string,
127129 continue
128130 } else {
129131 // valid is not valid, returning here
130- return rule .Rule , rule .handleRuleStatus (object , false )
132+ return rule .Rule , rule .handleRuleStatus (object , types . RuleStatusDeny )
131133 }
132134 }
133135
@@ -138,5 +140,5 @@ func (validation *AuditConfigValidation) Validate(object *AzureObject) (string,
138140 }
139141 }
140142
141- return "__DEFAULTDENY__" , false
143+ return "__DEFAULTDENY__" , types . RuleStatusDeny
142144}
0 commit comments