Skip to content

Commit

Permalink
logging for default ingress rules in FAST (#2030)
Browse files Browse the repository at this point in the history
* Add default ingress deny rule with logging to FAST net stages.

Fixes #2024

* Allow firewall factory to omit rules key

* Fix tests

* Fix fast tests

* fix fast tests
  • Loading branch information
juliocc authored Jan 30, 2024
1 parent 7b58114 commit da95434
Show file tree
Hide file tree
Showing 22 changed files with 161 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
trusted-ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
untrusted-ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
trusted-ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
untrusted-ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# skip boilerplate check

ingress:
ingress-default-deny:
description: "Deny and log any unmatched ingress traffic."
deny: true
priority: 65535
enable_logging:
include_metadata: false
4 changes: 2 additions & 2 deletions modules/net-vpc-firewall/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2022 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,7 +27,7 @@ locals {
for name, rule in ruleset : {
name = name
deny = try(rule.deny, false)
rules = try(rule.rules, [{ protocol = "all" }])
rules = try(rule.rules, [{ protocol = "all", ports = null }])
description = try(rule.description, null)
destination_ranges = try(rule.destination_ranges, null)
direction = upper(direction)
Expand Down
6 changes: 3 additions & 3 deletions tests/fast/stages/s2_networking_a_peering/stage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,5 +13,5 @@
# limitations under the License.

counts:
modules: 28
resources: 148
modules: 29
resources: 151
6 changes: 3 additions & 3 deletions tests/fast/stages/s2_networking_b_vpn/stage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,5 +13,5 @@
# limitations under the License.

counts:
modules: 30
resources: 185
modules: 31
resources: 188
6 changes: 3 additions & 3 deletions tests/fast/stages/s2_networking_c_nva/stage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,5 +13,5 @@
# limitations under the License.

counts:
modules: 42
resources: 195
modules: 43
resources: 199
6 changes: 3 additions & 3 deletions tests/fast/stages/s2_networking_d_separate_envs/stage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,5 +13,5 @@
# limitations under the License.

counts:
modules: 21
resources: 170
modules: 22
resources: 172
6 changes: 3 additions & 3 deletions tests/fast/stages/s2_networking_e_nva_bgp/stage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,5 +13,5 @@
# limitations under the License.

counts:
modules: 36
resources: 206
modules: 37
resources: 210

0 comments on commit da95434

Please sign in to comment.