Skip to content

Commit

Permalink
Add firewall existence check
Browse files Browse the repository at this point in the history
Signed-off-by: Dev <Dev25@users.noreply.github.com>
  • Loading branch information
Dev25 committed Jun 20, 2020
1 parent d2f64c9 commit 22c2a6e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/integration/safer_cluster/controls/network.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

project_id = attribute('project_id')
cluster_name = attribute('cluster_name')

control "network" do
title "gcp network configuration"
describe google_compute_firewalls(project: project_id) do
its('firewall_names') { should include "gke-#{cluster_name[0..25]}-intra-cluster-egress" }
its('firewall_names') { should include "gke-#{cluster_name[0..25]}-webhooks" }
end

end
4 changes: 4 additions & 0 deletions test/integration/safer_cluster/inspec.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
name: safer_cluster
depends:
- name: inspec-gcp
git: https://github.com/inspec/inspec-gcp.git
tag: v0.11.0
attributes:
- name: project_id
required: true
Expand Down

0 comments on commit 22c2a6e

Please sign in to comment.