-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add inspec support for ACM level (#4212)
- Loading branch information
Showing
5 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...google_access_context_manager_access_level/google_access_context_manager_access_level.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<% gcp_organization_id = "#{external_attribute(pwd, 'gcp_organization_id', doc_generation)}" -%> | ||
<% service_perimeter = grab_attributes(pwd)['service_perimeter'] -%> | ||
|
||
policy_name = google_access_context_manager_access_policies(org_id: <%= gcp_organization_id %>).names.first | ||
|
||
describe google_access_context_manager_access_level(parent: policy_name, name: "ip_subnet") do | ||
it { should exist } | ||
its('title') { should cmp "ip_subnet" } | ||
its('basic.conditions.size') { should cmp 1 } | ||
its('basic.conditions.first.ip_subnetworks') { should include "192.0.2.0/24" } | ||
end | ||
|
||
describe google_access_context_manager_access_level(parent: policy_name, name: "none") do | ||
it { should_not exist } | ||
end |
3 changes: 3 additions & 0 deletions
3
...ss_context_manager_access_level/google_access_context_manager_access_level_attributes.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
gcp_organization_id = attribute(:gcp_organization_id, default: <%= external_attribute(pwd, 'gcp_organization_id') -%>, description: 'The identifier of the organization that is the parent of the perimeter') | ||
gcp_enable_privileged_resources = attribute(:gcp_enable_privileged_resources, default:0, description:'Flag to enable privileged resources requiring elevated privileges in GCP.') | ||
service_perimeter = attribute('service_perimeter', default: <%= JSON.pretty_generate(grab_attributes(pwd)['service_perimeter']) -%>, description: 'Service perimeter definition') |
8 changes: 8 additions & 0 deletions
8
...oogle_access_context_manager_access_level/google_access_context_manager_access_levels.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<% gcp_organization_id = "#{external_attribute(pwd, 'gcp_organization_id', doc_generation)}" -%> | ||
<% service_perimeter = grab_attributes(pwd)['service_perimeter'] -%> | ||
|
||
policy_name = google_access_context_manager_access_policies(org_id: <%= gcp_organization_id %>).names.first | ||
|
||
describe google_access_context_manager_access_levels(parent: policy_name) do | ||
its('names') { should include "ip_subnet" } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters