Skip to content

Commit 26f0454

Browse files
Merge pull request #1 from OTCShare2/May22-update
Added new instance types
2 parents 304e7c6 + a771026 commit 26f0454

File tree

11 files changed

+166
-170
lines changed

11 files changed

+166
-170
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<p align="center">
2-
<img src="https://github.com/intel/policy-library-intel-aws/blob/main/images/logo-classicblue-800px.png?raw=true" alt="Intel Logo" width="250"/>
2+
<img src="https://github.com/intel/intel-policy-library/blob/main/images/logo-classicblue-800px.png?raw=true" alt="Intel Logo" width="250"/>
33
</p>
44

55
# Sentinel Policies for Cloud Workloads - Intel Optimized Cloud Modules
66

7-
© Copyright 2022, Intel Corporation
7+
© Copyright 2024, Intel Corporation
88

99
## Purpose of this library
1010

docs/aws/policies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ Parameter: instance_type
2424

2525
Allowed Types:
2626

27-
- **Optimal:** c7i.large, c7i.xlarge, c7i.2xlarge, c7i.4xlarge, c7i.8xlarge, c7i.12xlarge, c7i.16xlarge, c7i.24xlarge, c7i.48xlarge, c7i.metal-24xl, c7i.metal-48xl, m7i.12xlarge, m7i.16xlarge, m7i.24xlarge, m7i.2xlarge, m7i.48xlarge, m7i.4xlarge, m7i.8xlarge, m7i.large, m7i.xlarge, m7i.metal-24xl, m7i.metal-48xl, m7i-flex.large, m7i-flex.xlarge, m7i-flex.2xlarge, m7i-flex.4xlarge, m7i-flex.8xlarge, r7iz.12xlarge, r7iz.24xlarge, r7iz.2xlarge, r7iz.32xlarge, r7iz.4xlarge, r7iz.8xlarge, r7iz.large, r7iz.metal16xl, r7iz.metal32xl, r7iz.xlarge
27+
- **Optimal:** c7i.large, c7i.xlarge, c7i.2xlarge, c7i.4xlarge, c7i.8xlarge, c7i.12xlarge, c7i.16xlarge, c7i.24xlarge, c7i.48xlarge, c7i.metal-24xl, c7i.metal-48xl, c7i-flex.large, c7i-flex.xlarge, c7i-flex.2xlarge, c7i-flex.4xlarge, c7i-flex.8xlarge, m7i.12xlarge, m7i.16xlarge, m7i.24xlarge, m7i.2xlarge, m7i.48xlarge, m7i.4xlarge, m7i.8xlarge, m7i.large, m7i.xlarge, m7i.metal-24xl, m7i.metal-48xl, m7i-flex.large, m7i-flex.xlarge, m7i-flex.2xlarge, m7i-flex.4xlarge, m7i-flex.8xlarge, r7iz.12xlarge, r7iz.24xlarge, r7iz.2xlarge, r7iz.32xlarge, r7iz.4xlarge, r7iz.8xlarge, r7iz.large, r7iz.metal16xl, r7iz.metal32xl, r7iz.xlarge
2828
- **Alternative:** c6i.12xlarge, c6i.16xlarge, c6i.24xlarge, c6i.2xlarge, c6i.32xlarge, c6i.4xlarge, c6i.8xlarge, c6i.large, c6i.metal, c6i.xlarge, c6in.12xlarge, c6in.16xlarge, c6in.24xlarge, c6in.2xlarge, c6in.32xlarge, c6in.4xlarge, c6in.8xlarge, c6in.large, c6in.xlarge, i4i.16xlarge, i4i.2xlarge, i4i.32xlarge, i4i.4xlarge, i4i.8xlarge, i4i.large, i4i.metal, i4i.xlarge, m6i.12xlarge, m6i.16xlarge, m6i.24xlarge, m6i.2xlarge, m6i.32xlarge, m6i.4xlarge, m6i.8xlarge, m6i.large, m6i.metal, m6i.xlarge, m6in.12xlarge, m6in.16xlarge, m6in.24xlarge, m6in.2xlarge, m6in.32xlarge, m6in.4xlarge, m6in.8xlarge, m6in.large, m6in.xlarge, r6i.12xlarge, r6i.16xlarge, r6i.24xlarge, r6i.2xlarge, r6i.32xlarge, r6i.4xlarge, r6i.8xlarge, r6i.large, r6i.metal, r6i.xlarge, r6in.12xlarge, r6in.16xlarge, r6in.24xlarge, r6in.2xlarge, r6in.32xlarge, r6in.4xlarge, r6in.8xlarge, r6in.large, r6in.xlarge, trn1.2xlarge, trn1.32xlarge, x2idn.16xlarge, x2idn.24xlarge, x2idn.32xlarge, x2idn.metal, x2iedn.16xlarge, x2iedn.24xlarge, x2iedn.2xlarge, x2iedn.32xlarge, x2iedn.4xlarge, x2iedn.8xlarge, x2iedn.metal, x2iedn.xlarge
29-
- **AI:** c7i.large, c7i.xlarge, c7i.2xlarge, c7i.4xlarge, c7i.8xlarge, c7i.12xlarge, c7i.16xlarge, c7i.24xlarge, c7i.48xlarge, c7i.metal-24xl, c7i.metal-48xl, m7i.12xlarge, m7i.16xlarge, m7i.24xlarge, m7i.2xlarge, m7i.48xlarge, m7i.4xlarge, m7i.8xlarge, m7i.large, m7i.xlarge, m7i-flex.large, m7i-flex.xlarge, m7i-flex.2xlarge, m7i-flex.4xlarge, m7i-flex.8xlarge, r7iz.12xlarge, r7iz.24xlarge, r7iz.2xlarge, r7iz.32xlarge, r7iz.4xlarge, r7iz.8xlarge, r7iz.large, r7iz.metal16xl, r7iz.metal32xl, r7iz.xlarge
29+
- **AI:** c7i.large, c7i.xlarge, c7i.2xlarge, c7i.4xlarge, c7i.8xlarge, c7i.12xlarge, c7i.16xlarge, c7i.24xlarge, c7i.48xlarge, c7i.metal-24xl, c7i.metal-48xl, c7i-flex.large, c7i-flex.xlarge, c7i-flex.2xlarge, c7i-flex.4xlarge, c7i-flex.8xlarge, m7i.12xlarge, m7i.16xlarge, m7i.24xlarge, m7i.2xlarge, m7i.48xlarge, m7i.4xlarge, m7i.8xlarge, m7i.large, m7i.xlarge, m7i-flex.large, m7i-flex.xlarge, m7i-flex.2xlarge, m7i-flex.4xlarge, m7i-flex.8xlarge, r7iz.12xlarge, r7iz.24xlarge, r7iz.2xlarge, r7iz.32xlarge, r7iz.4xlarge, r7iz.8xlarge, r7iz.large, r7iz.metal16xl, r7iz.metal32xl, r7iz.xlarge
3030

3131
## AWS Db Instance Deny Unapproved Instance Types
3232

docs/google/policies.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Parameter: machine_type
7878

7979
Allowed Types:
8080

81-
- **Optimal:** c3-highcpu-4, c3-highcpu-8, c3-highcpu-22, c3-highcpu-44, c3-highcpu-88, c3-highcpu-176, c3-highmem-4, c3-highmem-8, c3-highmem-22, c3-highmem-44, c3-highmem-88, c3-highmem-176, c3-standard-4, c3-standard-8, c3-standard-22, c3-standard-44, c3-standard-88, c3-standard-176
81+
- **Optimal:** c3-highcpu-4, c3-highcpu-8, c3-highcpu-22, c3-highcpu-44, c3-highcpu-88, c3-highcpu-176, c3-highmem-4, c3-highmem-8, c3-highmem-22, c3-highmem-44, c3-highmem-88, c3-highmem-176, c3-standard-4, c3-standard-8, c3-standard-22, c3-standard-44, c3-standard-88, c3-standard-176, n4-standard-2, n4-standard-4, n4-standard-8, n4-standard-16, n4-standard-32, n4-standard-48, n4-standard-64, n4-standard-80, n4-highcpu-2, n4-highcpu-4, n4-highcpu-8, n4-highcpu-16, n4-highcpu-32, n4-highcpu-48, n4-highcpu-64, n4-highcpu-80, n4-highmem-2, n4-highmem-4, n4-highmem-8, n4-highmem-16, n4-highmem-32, n4-highmem-48, n4-highmem-64, n4-highmem-80
8282
- **Alternative:** n2-standard-2, n2-standard-4, n2-standard-8, n2-standard-16, n2-standard-32, n2-standard-48, n2-standard-64, n2-standard-80, n2-standard-96, n2-standard-128, n2-highmem-2, n2-highmem-4, n2-highmem-8, n2-highmem-16, n2-highmem-32, n2-highmem-48, n2-highmem-64, n2-highmem-80, n2-highmem-96, n2-highmem-128, n2-highcpu-2, n2-highcpu-4, n2-highcpu-8, n2-highcpu-16, n2-highcpu-32, n2-highcpu-48, n2-highcpu-64, n2-highcpu-80, n2-highcpu-96, m2-megamem-416, m2-hypermem-416, m2-ultramem-208, m2-ultramem-416
83-
- **AI:** c3-highcpu-4, c3-highcpu-8, c3-highcpu-22, c3-highcpu-44, c3-highcpu-88, c3-highcpu-176, c3-highmem-4, c3-highmem-8, c3-highmem-22, c3-highmem-44, c3-highmem-88, c3-highmem-176, c3-standard-4, c3-standard-8, c3-standard-22, c3-standard-44, c3-standard-88, c3-standard-176
83+
- **AI:** c3-highcpu-4, c3-highcpu-8, c3-highcpu-22, c3-highcpu-44, c3-highcpu-88, c3-highcpu-176, c3-highmem-4, c3-highmem-8, c3-highmem-22, c3-highmem-44, c3-highmem-88, c3-highmem-176, c3-standard-4, c3-standard-8, c3-standard-22, c3-standard-44, c3-standard-88, c3-standard-176, n4-standard-2, n4-standard-4, n4-standard-8, n4-standard-16, n4-standard-32, n4-standard-48, n4-standard-64, n4-standard-80, n4-highcpu-2, n4-highcpu-4, n4-highcpu-8, n4-highcpu-16, n4-highcpu-32, n4-highcpu-48, n4-highcpu-64, n4-highcpu-80, n4-highmem-2, n4-highmem-4, n4-highmem-8, n4-highmem-16, n4-highmem-32, n4-highmem-48, n4-highmem-64, n4-highmem-80
8484

policies/ibm/intel-ibm-is-instance-check-optimal-instance-types/testdata/mock-tfplan-failure.sentinel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,4 +348,3 @@ resource_changes = {
348348
"type": "ibm_is_security_group_rule",
349349
},
350350
}
351-

policies/ibm/intel-ibm-is-instance-check-optimal-instance-types/testdata/mock-tfplan-success.sentinel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,4 +348,3 @@ resource_changes = {
348348
"type": "ibm_is_security_group_rule",
349349
},
350350
}
351-

policies/ibm/intel-ibm-is-instance-deny-unapproved-instance-types/testdata/mock-tfplan-failure.sentinel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,4 +348,3 @@ resource_changes = {
348348
"type": "ibm_is_security_group_rule",
349349
},
350350
}
351-

policies/ibm/intel-ibm-is-instance-deny-unapproved-instance-types/testdata/mock-tfplan-success.sentinel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,4 +348,3 @@ resource_changes = {
348348
"type": "ibm_is_security_group_rule",
349349
},
350350
}
351-

policies/intel/intel-check-aws-optimized-instance-types/intel-check-aws-optimized-instance-types.sentinel

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,48 @@ import "approved"
44

55
# Define a function to validate instance types
66
validate_instance_types = func() {
7-
# Assume all instance types are valid initially
8-
all_valid = true
9-
10-
# Iterate over each AWS resource in the optimal file
11-
for optimal.aws as resource, details {
12-
# Skip processing for the 'policies_url' key
13-
if resource == "policies_url" {
14-
continue
15-
}
16-
17-
# Ensure the resource exists in the approved file and has an optimal property
18-
if resource in approved.aws and "optimal" in approved.aws[resource] {
19-
approved_types = approved.aws[resource].optimal
20-
21-
# Iterate over each optimal instance type for the resource
22-
for details.optimal as type {
23-
# If the instance type is not approved, set all_valid to false
24-
if type not in approved_types {
25-
all_valid = false
26-
break # Found an unapproved type, no need to check further
27-
}
28-
}
29-
} else {
30-
all_valid = false
31-
}
32-
33-
# Break out of the loop if a validation failure is detected
34-
if not all_valid {
35-
break
36-
}
37-
}
38-
39-
# If validation fails, print a specific message
40-
if !all_valid {
41-
print("New Intel optimal instance type recommendations are available. \n Update your policy library to take advantage of the latest series of performance and security enhancements available from Intel \n For instructions on staying up to date see https://github.com/intel/intel-policy-library")
42-
}
43-
44-
# Return the validation result
45-
return all_valid
7+
# Assume all instance types are valid initially
8+
all_valid = true
9+
10+
# Iterate over each AWS resource in the optimal file
11+
for optimal.aws as resource, details {
12+
# Skip processing for the 'policies_url' key
13+
if resource == "policies_url" {
14+
continue
15+
}
16+
17+
# Ensure the resource exists in the approved file and has an optimal property
18+
if resource in approved.aws and "optimal" in approved.aws[resource] {
19+
approved_types = approved.aws[resource].optimal
20+
21+
# Iterate over each optimal instance type for the resource
22+
for details.optimal as type {
23+
# If the instance type is not approved, set all_valid to false
24+
if type not in approved_types {
25+
all_valid = false
26+
break # Found an unapproved type, no need to check further
27+
}
28+
}
29+
} else {
30+
all_valid = false
31+
}
32+
33+
# Break out of the loop if a validation failure is detected
34+
if not all_valid {
35+
break
36+
}
37+
}
38+
39+
# If validation fails, print a specific message
40+
if !all_valid {
41+
print("New Intel optimal instance type recommendations are available. \n Update your policy library to take advantage of the latest series of performance and security enhancements available from Intel \n For instructions on staying up to date see https://github.com/intel/intel-policy-library")
42+
}
43+
44+
# Return the validation result
45+
return all_valid
4646
}
4747

4848
# New updates are available from Intel. Please update your policy library
4949
main = rule {
50-
validate_instance_types()
50+
validate_instance_types()
5151
}

policies/intel/intel-check-azurerm-optimized-instance-types/intel-check-azurerm-optimized-instance-types.sentinel

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,48 @@ import "approved"
44

55
# Define a function to validate instance types
66
validate_instance_types = func() {
7-
# Assume all instance types are valid initially
8-
all_valid = true
9-
10-
# Iterate over each AZURERM resource in the optimal file
11-
for optimal.azurerm as resource, details {
12-
# Skip processing for the 'policies_url' key
13-
if resource == "policies_url" {
14-
continue
15-
}
16-
17-
# Ensure the resource exists in the approved file and has an optimal property
18-
if resource in approved.azurerm and "optimal" in approved.azurerm[resource] {
19-
approved_types = approved.azurerm[resource].optimal
20-
21-
# Iterate over each optimal instance type for the resource
22-
for details.optimal as type {
23-
# If the instance type is not approved, set all_valid to false
24-
if type not in approved_types {
25-
all_valid = false
26-
break # Found an unapproved type, no need to check further
27-
}
28-
}
29-
} else {
30-
all_valid = false
31-
}
32-
33-
# Break out of the loop if a validation failure is detected
34-
if not all_valid {
35-
break
36-
}
37-
}
38-
39-
# If validation fails, print a specific message
40-
if !all_valid {
41-
print("New Intel optimal instance type recommendations are available. \n Update your policy library to take advantage of the latest series of performance and security enhancements available from Intel \n For instructions on staying up to date see https://github.com/intel/intel-policy-library")
42-
}
43-
44-
# Return the validation result
45-
return all_valid
7+
# Assume all instance types are valid initially
8+
all_valid = true
9+
10+
# Iterate over each AZURERM resource in the optimal file
11+
for optimal.azurerm as resource, details {
12+
# Skip processing for the 'policies_url' key
13+
if resource == "policies_url" {
14+
continue
15+
}
16+
17+
# Ensure the resource exists in the approved file and has an optimal property
18+
if resource in approved.azurerm and "optimal" in approved.azurerm[resource] {
19+
approved_types = approved.azurerm[resource].optimal
20+
21+
# Iterate over each optimal instance type for the resource
22+
for details.optimal as type {
23+
# If the instance type is not approved, set all_valid to false
24+
if type not in approved_types {
25+
all_valid = false
26+
break # Found an unapproved type, no need to check further
27+
}
28+
}
29+
} else {
30+
all_valid = false
31+
}
32+
33+
# Break out of the loop if a validation failure is detected
34+
if not all_valid {
35+
break
36+
}
37+
}
38+
39+
# If validation fails, print a specific message
40+
if !all_valid {
41+
print("New Intel optimal instance type recommendations are available. \n Update your policy library to take advantage of the latest series of performance and security enhancements available from Intel \n For instructions on staying up to date see https://github.com/intel/intel-policy-library")
42+
}
43+
44+
# Return the validation result
45+
return all_valid
4646
}
4747

4848
# New updates are available from Intel. Please update your policy library
4949
main = rule {
50-
validate_instance_types()
50+
validate_instance_types()
5151
}

policies/intel/intel-check-google-optimized-instance-types/intel-check-google-optimized-instance-types.sentinel

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,48 @@ import "approved"
44

55
# Define a function to validate instance types
66
validate_instance_types = func() {
7-
# Assume all instance types are valid initially
8-
all_valid = true
9-
10-
# Iterate over each GOOGLE resource in the optimal file
11-
for optimal.google as resource, details {
12-
# Skip processing for the 'policies_url' key
13-
if resource == "policies_url" {
14-
continue
15-
}
16-
17-
# Ensure the resource exists in the approved file and has an optimal property
18-
if resource in approved.google and "optimal" in approved.google[resource] {
19-
approved_types = approved.google[resource].optimal
20-
21-
# Iterate over each optimal instance type for the resource
22-
for details.optimal as type {
23-
# If the instance type is not approved, set all_valid to false
24-
if type not in approved_types {
25-
all_valid = false
26-
break # Found an unapproved type, no need to check further
27-
}
28-
}
29-
} else {
30-
all_valid = false
31-
}
32-
33-
# Break out of the loop if a validation failure is detected
34-
if not all_valid {
35-
break
36-
}
37-
}
38-
39-
# If validation fails, print a specific message
40-
if !all_valid {
41-
print("New Intel optimal instance type recommendations are available. \n Update your policy library to take advantage of the latest series of performance and security enhancements available from Intel \n For instructions on staying up to date see https://github.com/intel/intel-policy-library")
42-
}
43-
44-
# Return the validation result
45-
return all_valid
7+
# Assume all instance types are valid initially
8+
all_valid = true
9+
10+
# Iterate over each GOOGLE resource in the optimal file
11+
for optimal.google as resource, details {
12+
# Skip processing for the 'policies_url' key
13+
if resource == "policies_url" {
14+
continue
15+
}
16+
17+
# Ensure the resource exists in the approved file and has an optimal property
18+
if resource in approved.google and "optimal" in approved.google[resource] {
19+
approved_types = approved.google[resource].optimal
20+
21+
# Iterate over each optimal instance type for the resource
22+
for details.optimal as type {
23+
# If the instance type is not approved, set all_valid to false
24+
if type not in approved_types {
25+
all_valid = false
26+
break # Found an unapproved type, no need to check further
27+
}
28+
}
29+
} else {
30+
all_valid = false
31+
}
32+
33+
# Break out of the loop if a validation failure is detected
34+
if not all_valid {
35+
break
36+
}
37+
}
38+
39+
# If validation fails, print a specific message
40+
if !all_valid {
41+
print("New Intel optimal instance type recommendations are available. \n Update your policy library to take advantage of the latest series of performance and security enhancements available from Intel \n For instructions on staying up to date see https://github.com/intel/intel-policy-library")
42+
}
43+
44+
# Return the validation result
45+
return all_valid
4646
}
4747

4848
# New updates are available from Intel. Please update your policy library
4949
main = rule {
50-
validate_instance_types()
50+
validate_instance_types()
5151
}

0 commit comments

Comments
 (0)