Skip to content

Commit d1a32b4

Browse files
fix log metrics and remove alert conditions (#73)
1 parent 16870f8 commit d1a32b4

9 files changed

+5
-37
lines changed

controls/2.04-logging.rb

-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@
7272
describe "[#{gcp_project_id}] Project Ownership changes alert policy" do
7373
subject { condition }
7474
it { should exist }
75-
its('aggregation_cross_series_reducer') { should eq 'REDUCE_COUNT' }
76-
its('aggregation_per_series_aligner') { should eq 'ALIGN_RATE' }
77-
its('condition_threshold_value') { should eq 0.001 }
78-
its('aggregation_alignment_period') { should eq '60s' }
7975
end
8076
end
8177
end

controls/2.05-logging.rb

-4
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@
5555
describe "[#{gcp_project_id}] Audit configuration changes alert policy" do
5656
subject { condition }
5757
it { should exist }
58-
its('aggregation_cross_series_reducer') { should eq 'REDUCE_COUNT' }
59-
its('aggregation_per_series_aligner') { should eq 'ALIGN_RATE' }
60-
its('condition_threshold_value') { should eq 0.001 }
61-
its('aggregation_alignment_period') { should eq '60s' }
6258
end
6359
end
6460
end

controls/2.06-logging.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
ref 'GCP Docs', url: 'https://cloud.google.com/logging/docs/reference/tools/gcloud-logging'
4242
ref 'GCP Docs', url: 'https://cloud.google.com/iam/docs/understanding-custom-roles'
4343

44-
log_filter = 'resource.type="iam_role" AND protoPayload.methodName="google.iam.admin.v1.CreateRole" OR protoPayload.methodName="google.iam.admin.v1.DeleteRole" OR protoPayload.methodName="google.iam.admin.v1.UpdateRole"'
44+
log_filter = 'protoPayload.methodName="google.iam.admin.v1.CreateRole" OR protoPayload.methodName="google.iam.admin.v1.DeleteRole" OR protoPayload.methodName="google.iam.admin.v1.UpdateRole"'
4545
describe "[#{gcp_project_id}] Custom Role changes filter" do
4646
subject { google_project_metrics(project: gcp_project_id).where(metric_filter: log_filter) }
4747
it { should exist }
@@ -55,10 +55,6 @@
5555
describe "[#{gcp_project_id}] Custom Role changes alert policy" do
5656
subject { condition }
5757
it { should exist }
58-
its('aggregation_cross_series_reducer') { should eq 'REDUCE_COUNT' }
59-
its('aggregation_per_series_aligner') { should eq 'ALIGN_RATE' }
60-
its('condition_threshold_value') { should eq 0.001 }
61-
its('aggregation_alignment_period') { should eq '60s' }
6258
end
6359
end
6460
end

controls/2.07-logging.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
ref 'GCP Docs', url: 'https://cloud.google.com/logging/docs/reference/tools/gcloud-logging'
4242
ref 'GCP Docs', url: 'https://cloud.google.com/vpc/docs/firewalls'
4343

44-
log_filter = 'resource.type="gce_firewall_rule" AND jsonPayload.event_subtype="compute.firewalls.patch" OR jsonPayload.event_subtype="compute.firewalls.insert"'
44+
log_filter = 'jsonPayload.event_subtype="compute.firewalls.patch" OR jsonPayload.event_subtype="compute.firewalls.insert"'
4545
describe "[#{gcp_project_id}] VPC FW Rule changes filter" do
4646
subject { google_project_metrics(project: gcp_project_id).where(metric_filter: log_filter) }
4747
it { should exist }
@@ -55,10 +55,6 @@
5555
describe "[#{gcp_project_id}] VPC FW Rule changes alert policy" do
5656
subject { condition }
5757
it { should exist }
58-
its('aggregation_cross_series_reducer') { should eq 'REDUCE_COUNT' }
59-
its('aggregation_per_series_aligner') { should eq 'ALIGN_RATE' }
60-
its('condition_threshold_value') { should eq 0.001 }
61-
its('aggregation_alignment_period') { should eq '60s' }
6258
end
6359
end
6460
end

controls/2.08-logging.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
ref 'GCP Docs', url: 'https://cloud.google.com/logging/docs/reference/tools/gcloud-logging'
4444
ref 'GCP Docs', url: 'https://cloud.google.com/storage/docs/access-control/iam'
4545

46-
log_filter = 'resource.type="gce_route" AND jsonPayload.event_subtype="compute.routes.delete" OR jsonPayload.event_subtype="compute.routes.insert"'
46+
log_filter = 'jsonPayload.event_subtype="compute.routes.delete" OR jsonPayload.event_subtype="compute.routes.insert"'
4747
describe "[#{gcp_project_id}] VPC Route changes filter" do
4848
subject { google_project_metrics(project: gcp_project_id).where(metric_filter: log_filter) }
4949
it { should exist }
@@ -57,10 +57,6 @@
5757
describe "[#{gcp_project_id}] VPC Route changes alert policy" do
5858
subject { condition }
5959
it { should exist }
60-
its('aggregation_cross_series_reducer') { should eq 'REDUCE_COUNT' }
61-
its('aggregation_per_series_aligner') { should eq 'ALIGN_RATE' }
62-
its('condition_threshold_value') { should eq 0.001 }
63-
its('aggregation_alignment_period') { should eq '60s' }
6460
end
6561
end
6662
end

controls/2.09-logging.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
ref 'GCP Docs', url: 'https://cloud.google.com/logging/docs/reference/tools/gcloud-logging'
4444
ref 'GCP Docs', url: 'https://cloud.google.com/vpc/docs/overview'
4545

46-
log_filter = 'resource.type=gce_network AND jsonPayload.event_subtype="compute.networks.insert" OR jsonPayload.event_subtype="compute.networks.patch" OR jsonPayload.event_subtype="compute.networks.delete" OR jsonPayload.event_subtype="compute.networks.removePeering" OR jsonPayload.event_subtype="compute.networks.addPeering"'
46+
log_filter = 'jsonPayload.event_subtype="compute.networks.insert" OR jsonPayload.event_subtype="compute.networks.patch" OR jsonPayload.event_subtype="compute.networks.delete" OR jsonPayload.event_subtype="compute.networks.removePeering" OR jsonPayload.event_subtype="compute.networks.addPeering"'
4747
describe "[#{gcp_project_id}] VPC Network changes filter" do
4848
subject { google_project_metrics(project: gcp_project_id).where(metric_filter: log_filter) }
4949
it { should exist }
@@ -57,10 +57,6 @@
5757
describe "[#{gcp_project_id}] VPC Network changes alert policy" do
5858
subject { condition }
5959
it { should exist }
60-
its('aggregation_cross_series_reducer') { should eq 'REDUCE_COUNT' }
61-
its('aggregation_per_series_aligner') { should eq 'ALIGN_RATE' }
62-
its('condition_threshold_value') { should eq 0.001 }
63-
its('aggregation_alignment_period') { should eq '60s' }
6460
end
6561
end
6662
end

controls/2.10-logging.rb

-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@
5656
describe "[#{gcp_project_id}] Cloud Storage changes alert policy" do
5757
subject { condition }
5858
it { should exist }
59-
its('aggregation_cross_series_reducer') { should eq 'REDUCE_COUNT' }
60-
its('aggregation_per_series_aligner') { should eq 'ALIGN_RATE' }
61-
its('condition_threshold_value') { should eq 0.001 }
62-
its('aggregation_alignment_period') { should eq '60s' }
6359
end
6460
end
6561
end

controls/2.11-logging.rb

-4
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@
6363
describe "[#{gcp_project_id}] Cloud SQL changes alert policy" do
6464
subject { condition }
6565
it { should exist }
66-
its('aggregation_cross_series_reducer') { should eq 'REDUCE_COUNT' }
67-
its('aggregation_per_series_aligner') { should eq 'ALIGN_RATE' }
68-
its('condition_threshold_value') { should eq 0.001 }
69-
its('aggregation_alignment_period') { should eq '60s' }
7066
end
7167
end
7268
end

inspec.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ copyright: "(c) 2020, Google, Inc."
1919
copyright_email: "[email protected]"
2020
license: "Apache-2.0"
2121
summary: "Inspec Google Cloud Platform Center for Internet Security Benchmark v1.1 Profile"
22-
version: 1.1.0-23
22+
version: 1.1.0-24
2323

2424
supports:
2525
- platform: gcp

0 commit comments

Comments
 (0)