-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #697 from pitkley/support-ctc-same-network-verdict
Support default network verdict within the same network
- Loading branch information
Showing
16 changed files
with
210 additions
and
22 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
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
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
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,7 @@ | ||
[container_to_container] | ||
default_policy = "drop" | ||
same_network_verdict = "accept" | ||
|
||
[[container_to_container.rules]] | ||
network = "PROJECT_default" | ||
verdict = "reject" |
12 changes: 12 additions & 0 deletions
12
resources/test/docker/ctc-network-policies/docker-compose.yml
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,12 @@ | ||
version: '2' | ||
|
||
services: | ||
a: | ||
image: nginx:alpine | ||
networks: | ||
- default | ||
- other | ||
|
||
networks: | ||
default: | ||
other: |
Empty file.
32 changes: 32 additions & 0 deletions
32
resources/test/docker/ctc-network-policies/iptables/expected-iptables-v4.txt
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,32 @@ | ||
*filter | ||
:DFWRS_FORWARD - [0:0] | ||
:DFWRS_INPUT - [0:0] | ||
:FORWARD - [0:0] | ||
:INPUT - [0:0] | ||
-F DFWRS_FORWARD | ||
-A DFWRS_FORWARD -m state --state INVALID -j DROP | ||
-A DFWRS_FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT | ||
-A DFWRS_FORWARD -i $input=bridge -o $output=bridge -j REJECT "$input" == "$output" | ||
-A DFWRS_FORWARD -i $input=bridge -o $output=bridge -j ACCEPT "$input" == "$output" | ||
-A DFWRS_FORWARD -i $input=bridge -o $output=bridge -j ACCEPT "$input" == "$output" | ||
-A DFWRS_FORWARD -i $input=bridge -o $output=bridge -j ACCEPT "$input" == "$output" | ||
-A DFWRS_FORWARD -i $input=bridge -o $output=bridge -j ACCEPT "$input" == "$output" | ||
-A DFWRS_FORWARD -i $input=bridge -o $output=bridge -j ACCEPT "$input" == "$output" | ||
-A DFWRS_FORWARD -j DROP | ||
-F DFWRS_INPUT | ||
-A DFWRS_INPUT -m state --state INVALID -j DROP | ||
-A DFWRS_INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | ||
-A DFWRS_INPUT -i docker0 -j ACCEPT | ||
-A FORWARD -j DFWRS_FORWARD | ||
-A INPUT -j DFWRS_INPUT | ||
COMMIT | ||
*nat | ||
:DFWRS_POSTROUTING - [0:0] | ||
:DFWRS_PREROUTING - [0:0] | ||
:POSTROUTING - [0:0] | ||
:PREROUTING - [0:0] | ||
-F DFWRS_POSTROUTING | ||
-F DFWRS_PREROUTING | ||
-A POSTROUTING -j DFWRS_POSTROUTING | ||
-A PREROUTING -j DFWRS_PREROUTING | ||
COMMIT |
16 changes: 16 additions & 0 deletions
16
resources/test/docker/ctc-network-policies/iptables/expected-iptables-v6.txt
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,16 @@ | ||
*filter | ||
:DFWRS_FORWARD - [0:0] | ||
:DFWRS_INPUT - [0:0] | ||
-F DFWRS_FORWARD | ||
-A DFWRS_FORWARD -m state --state INVALID -j DROP | ||
-A DFWRS_FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT | ||
-F DFWRS_INPUT | ||
-A DFWRS_INPUT -m state --state INVALID -j DROP | ||
-A DFWRS_INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | ||
COMMIT | ||
*nat | ||
:DFWRS_POSTROUTING - [0:0] | ||
:DFWRS_PREROUTING - [0:0] | ||
-F DFWRS_POSTROUTING | ||
-F DFWRS_PREROUTING | ||
COMMIT |
Empty file.
24 changes: 24 additions & 0 deletions
24
resources/test/docker/ctc-network-policies/nftables/expected-nftables.txt
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,24 @@ | ||
add table inet dfw | ||
flush table inet dfw | ||
add chain inet dfw input { type filter hook input priority -5 ; } | ||
add rule inet dfw input ct state invalid drop | ||
add rule inet dfw input ct state { related, established } accept | ||
add chain inet dfw forward { type filter hook forward priority -5 ; } | ||
add rule inet dfw forward ct state invalid drop | ||
add rule inet dfw forward ct state { related, established } accept | ||
add table ip dfw | ||
flush table ip dfw | ||
add chain ip dfw prerouting { type nat hook prerouting priority -105 ; } | ||
add chain ip dfw postrouting { type nat hook postrouting priority 95 ; } | ||
add table ip6 dfw | ||
flush table ip6 dfw | ||
add chain ip6 dfw prerouting { type nat hook prerouting priority -105 ; } | ||
add chain ip6 dfw postrouting { type nat hook postrouting priority 95 ; } | ||
add rule inet dfw input meta iifname docker0 meta mark set 0xdf accept | ||
add chain inet dfw forward { policy drop ; } | ||
add rule inet dfw forward meta iifname $input=bridge oifname $output=bridge meta mark set 0xdf reject "$input" == "$output" | ||
add rule inet dfw forward meta iifname $input=bridge oifname $output=bridge meta mark set 0xdf accept "$input" == "$output" | ||
add rule inet dfw forward meta iifname $input=bridge oifname $output=bridge meta mark set 0xdf accept "$input" == "$output" | ||
add rule inet dfw forward meta iifname $input=bridge oifname $output=bridge meta mark set 0xdf accept "$input" == "$output" | ||
add rule inet dfw forward meta iifname $input=bridge oifname $output=bridge meta mark set 0xdf accept "$input" == "$output" | ||
add rule inet dfw forward meta iifname $input=bridge oifname $output=bridge meta mark set 0xdf accept "$input" == "$output" |
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
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
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
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
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
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