Skip to content

Commit

Permalink
Skip vpc flow log checks for internal HTTPS LB subnets (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
KonradSchieban authored Oct 12, 2020
1 parent 5e12bcf commit 059e1ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions controls/3.08-networking.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,17 @@
google_compute_regions(project: gcp_project_id).region_names.each do |region|
google_compute_subnetworks(project: gcp_project_id, region: region).subnetwork_names.each do |subnet|
subnet_obj = google_compute_subnetwork(project: gcp_project_id, region: region, name: subnet)
describe "[#{gcp_project_id}] #{region}/#{subnet}" do
subject { subnet_obj }
if subnet_obj.methods.include?(:log_config) == true
it 'should have logging enabled' do
expect(subnet_obj.log_config.enable).to be true
if subnet_obj.purpose == 'INTERNAL_HTTPS_LOAD_BALANCER' # filter subnets for internal HTTPs Load Balancing
describe "[#{gcp_project_id} #{region}/#{subnet}] does not support VPC Flow Logs. This test is Not Applicable." do
skip "[#{gcp_project_id} #{region}/#{subnet}] does not support VPC Flow Logs."
end
else
describe "[#{gcp_project_id}] #{region}/#{subnet}" do
subject { subnet_obj }
if subnet_obj.methods.include?(:log_config) == true
it 'should have logging enabled' do
expect(subnet_obj.log_config.enable).to be true
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion inspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ copyright: Google
copyright_email: [email protected]
license: Apache-2.0
summary: "Inspec Google Cloud Platform Center for Internet Security Benchmark v1.1 Profile"
version: "1.1.0-18"
version: "1.1.0-19"
supports:
- platform: gcp
depends:
Expand Down

0 comments on commit 059e1ff

Please sign in to comment.