Skip to content

Commit f7b4847

Browse files
author
Adi Shaull
committed
Fix windows_cis_enabled
1 parent c8ab384 commit f7b4847

19 files changed

+51
-46
lines changed

aquasec/data_function_assurance_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func dataFunctionAssurancePolicy() *schema.Resource {
290290
},
291291
"packages_black_list": {
292292
Type: schema.TypeSet,
293-
Description: "List of blacklist images.",
293+
Description: "List of blacklisted images.",
294294
Computed: true,
295295
Elem: &schema.Resource{
296296
Schema: map[string]*schema.Schema{

aquasec/data_host_assurance_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func dataHostAssurancePolicy() *schema.Resource {
290290
},
291291
"packages_black_list": {
292292
Type: schema.TypeSet,
293-
Description: "List of blacklist images.",
293+
Description: "List of blacklisted images.",
294294
Computed: true,
295295
Elem: &schema.Resource{
296296
Schema: map[string]*schema.Schema{

aquasec/data_image_assurance_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func dataImageAssurancePolicy() *schema.Resource {
290290
},
291291
"packages_black_list": {
292292
Type: schema.TypeSet,
293-
Description: "List of blacklist images.",
293+
Description: "List of blacklisted images.",
294294
Computed: true,
295295
Elem: &schema.Resource{
296296
Schema: map[string]*schema.Schema{

aquasec/data_kubernetes_assurance_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ func dataKubernetesAssurancePolicy() *schema.Resource {
300300
},
301301
"packages_black_list": {
302302
Type: schema.TypeSet,
303-
Description: "List of blacklist images.",
303+
Description: "List of blacklisted images.",
304304
Computed: true,
305305
Elem: &schema.Resource{
306306
Schema: map[string]*schema.Schema{

aquasec/resource_function_assurance_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ func resourceFunctionAssurancePolicy() *schema.Resource {
310310
},
311311
"packages_black_list": {
312312
Type: schema.TypeSet,
313-
Description: "List of blacklist images.",
313+
Description: "List of blacklisted images.",
314314
Optional: true,
315315
Elem: &schema.Resource{
316316
Schema: map[string]*schema.Schema{

aquasec/resource_host_assurance_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func resourceHostAssurancePolicy() *schema.Resource {
308308
},
309309
"packages_black_list": {
310310
Type: schema.TypeSet,
311-
Description: "List of blacklist images.",
311+
Description: "List of blacklisted images.",
312312
Optional: true,
313313
Elem: &schema.Resource{
314314
Schema: map[string]*schema.Schema{

aquasec/resource_image_assurance_policy.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ func resourceImageAssurancePolicy() *schema.Resource {
310310
},
311311
"packages_black_list": {
312312
Type: schema.TypeSet,
313-
Description: "List of blacklist images.",
313+
Description: "List of blacklisted images.",
314314
Optional: true,
315315
Elem: &schema.Resource{
316316
Schema: map[string]*schema.Schema{
@@ -1800,6 +1800,11 @@ func expandAssurancePolicy(d *schema.ResourceData, a_type string) *client.Assura
18001800
iap.LinuxCisEnabled = linux_cis_enabled.(bool)
18011801
}
18021802

1803+
windows_cis_enabled, ok := d.GetOk("windows_cis_enabled")
1804+
if ok {
1805+
iap.WindowsCisEnabled = windows_cis_enabled.(bool)
1806+
}
1807+
18031808
openshift_hardening_enabled, ok := d.GetOk("openshift_hardening_enabled")
18041809
if ok {
18051810
iap.OpenshiftHardeningEnabled = openshift_hardening_enabled.(bool)

aquasec/resource_kubernetes_assurance_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ func resourceKubernetesAssurancePolicy() *schema.Resource {
309309
},
310310
"packages_black_list": {
311311
Type: schema.TypeSet,
312-
Description: "List of blacklist images.",
312+
Description: "List of blacklisted images.",
313313
Optional: true,
314314
Elem: &schema.Resource{
315315
Schema: map[string]*schema.Schema{

aquasec/resource_vmware_assurance_policy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ func resourceVMwareAssurancePolicy() *schema.Resource {
309309
},
310310
"packages_black_list": {
311311
Type: schema.TypeSet,
312-
Description: "List of blacklist images.",
312+
Description: "List of blacklisted images.",
313313
Optional: true,
314314
Elem: &schema.Resource{
315315
Schema: map[string]*schema.Schema{

client/assurance_policy.go

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
type AssurancePolicy struct {
1414
AssuranceType string `json:"assurance_type"`
15-
Id int `json:"id,omitempty"`
15+
Id int `json:"id"`
1616
Name string `json:"name"`
1717
Author string `json:"author"`
1818
Registry string `json:"registry,omitempty"`
@@ -185,19 +185,19 @@ type KubernetesControls struct {
185185
type KubernetesControlsArray []KubernetesControls
186186

187187
// GetAssurancePolicy - returns single Assurance Policy
188-
func (cli *Client) GetAssurancePolicy(name string, at string) (*AssurancePolicy, error) {
188+
func (cli *Client) GetAssurancePolicy(name string, assuranceType string) (*AssurancePolicy, error) {
189189
var err error
190190
var response AssurancePolicy
191191
var atype string
192-
if strings.EqualFold(at, "host") {
192+
if strings.EqualFold(assuranceType, "host") {
193193
atype = "host"
194-
} else if strings.EqualFold(at, "image") {
194+
} else if strings.EqualFold(assuranceType, "image") {
195195
atype = "image"
196-
} else if strings.EqualFold(at, "function") {
196+
} else if strings.EqualFold(assuranceType, "function") {
197197
atype = "function"
198-
} else if strings.EqualFold(at, "kubernetes") {
198+
} else if strings.EqualFold(assuranceType, "kubernetes") {
199199
atype = "kubernetes"
200-
} else if strings.EqualFold(at, "cf_application") {
200+
} else if strings.EqualFold(assuranceType, "cf_application") {
201201
atype = "cf_application"
202202
}
203203

@@ -238,18 +238,18 @@ func (cli *Client) GetAssurancePolicy(name string, at string) (*AssurancePolicy,
238238
}
239239

240240
// CreateAssurancePolicy - creates single Aqua Assurance Policy
241-
func (cli *Client) CreateAssurancePolicy(assurancepolicy *AssurancePolicy, at string) error {
242-
payload, err := json.Marshal(assurancepolicy)
241+
func (cli *Client) CreateAssurancePolicy(assurancePolicy *AssurancePolicy, assuranceType string) error {
242+
payload, err := json.Marshal(assurancePolicy)
243243
var atype string
244-
if strings.EqualFold(at, "host") {
244+
if strings.EqualFold(assuranceType, "host") {
245245
atype = "host"
246-
} else if strings.EqualFold(at, "image") {
246+
} else if strings.EqualFold(assuranceType, "image") {
247247
atype = "image"
248-
} else if strings.EqualFold(at, "function") {
248+
} else if strings.EqualFold(assuranceType, "function") {
249249
atype = "function"
250-
} else if strings.EqualFold(at, "kubernetes") {
250+
} else if strings.EqualFold(assuranceType, "kubernetes") {
251251
atype = "kubernetes"
252-
} else if strings.EqualFold(at, "cf_application") {
252+
} else if strings.EqualFold(assuranceType, "cf_application") {
253253
atype = "cf_application"
254254
}
255255

@@ -284,24 +284,24 @@ func (cli *Client) CreateAssurancePolicy(assurancepolicy *AssurancePolicy, at st
284284
}
285285

286286
// UpdateAssurancePolicy updates an existing Assurance Policy
287-
func (cli *Client) UpdateAssurancePolicy(assurancepolicy *AssurancePolicy, at string) error {
288-
payload, err := json.Marshal(assurancepolicy)
287+
func (cli *Client) UpdateAssurancePolicy(assurancePolicy *AssurancePolicy, assuranceType string) error {
288+
payload, err := json.Marshal(assurancePolicy)
289289
if err != nil {
290290
return err
291291
}
292292
var atype string
293-
if strings.EqualFold(at, "host") {
293+
if strings.EqualFold(assuranceType, "host") {
294294
atype = "host"
295-
} else if strings.EqualFold(at, "image") {
295+
} else if strings.EqualFold(assuranceType, "image") {
296296
atype = "image"
297-
} else if strings.EqualFold(at, "function") {
297+
} else if strings.EqualFold(assuranceType, "function") {
298298
atype = "function"
299-
} else if strings.EqualFold(at, "kubernetes") {
299+
} else if strings.EqualFold(assuranceType, "kubernetes") {
300300
atype = "kubernetes"
301-
} else if strings.EqualFold(at, "cf_application") {
301+
} else if strings.EqualFold(assuranceType, "cf_application") {
302302
atype = "cf_application"
303303
}
304-
apiPath := "/api/v2/assurance_policy/" + atype + "/" + assurancepolicy.Name
304+
apiPath := "/api/v2/assurance_policy/" + atype + "/" + assurancePolicy.Name
305305
request := cli.gorequest
306306
err = cli.limiter.Wait(context.Background())
307307
if err != nil {
@@ -329,18 +329,18 @@ func (cli *Client) UpdateAssurancePolicy(assurancepolicy *AssurancePolicy, at st
329329
}
330330

331331
// DeleteAssurancePolicy removes a Assurance Policy
332-
func (cli *Client) DeleteAssurancePolicy(name string, at string) error {
332+
func (cli *Client) DeleteAssurancePolicy(name string, assuranceType string) error {
333333
request := cli.gorequest
334334
var atype string
335-
if strings.EqualFold(at, "host") {
335+
if strings.EqualFold(assuranceType, "host") {
336336
atype = "host"
337-
} else if strings.EqualFold(at, "image") {
337+
} else if strings.EqualFold(assuranceType, "image") {
338338
atype = "image"
339-
} else if strings.EqualFold(at, "function") {
339+
} else if strings.EqualFold(assuranceType, "function") {
340340
atype = "function"
341-
} else if strings.EqualFold(at, "kubernetes") {
341+
} else if strings.EqualFold(assuranceType, "kubernetes") {
342342
atype = "kubernetes"
343-
} else if strings.EqualFold(at, "cf_application") {
343+
} else if strings.EqualFold(assuranceType, "cf_application") {
344344
atype = "cf_application"
345345
}
346346
apiPath := "/api/v2/assurance_policy/" + atype + "/" + name

0 commit comments

Comments
 (0)