• No results found

20% more formulas. Verified Firewall Ruleset Verification. Now with. with Isabelle/HOL. Cornelius Diekmann

N/A
N/A
Protected

Academic year: 2021

Share "20% more formulas. Verified Firewall Ruleset Verification. Now with. with Isabelle/HOL. Cornelius Diekmann"

Copied!
101
0
0

Loading.... (view fulltext now)

Full text

(1)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Now with

20%

more

form

ula

s

Verified Firewall Ruleset Verification

with Isabelle/HOL

(2)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(3)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(4)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(5)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(6)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(7)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(8)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(9)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(10)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(11)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(12)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(13)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(14)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(15)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(16)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(17)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Introduction to Firewalls

Chain INPUT (policy ACCEPT)

target prot source destination DOS_PROTECT all 0.0.0.0/0 0.0.0.0/0

ACCEPT all 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp dpt:22

DROP tcp 0.0.0.0/0 0.0.0.0/0 multiport dports 21,873,5005,5006,80,548,. . . DROP udp 0.0.0.0/0 0.0.0.0/0 multiport dports 123,111,2049,892,5353 ACCEPT all 192.168.0.0/16 0.0.0.0/0

DROP all 0.0.0.0/0 0.0.0.0/0

Chain DOS_PROTECT (1 references)

target prot source destination

RETURN icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8 limit: avg 1/sec burst 5 DROP icmp 0.0.0.0/0 0.0.0.0/0 icmptype 8

RETURN tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 DROP tcp 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04

(18)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Problem

“there are no good high-complexity rule sets”

“firewalls are (still) poorly configured

“tools do not understand real-world firewall rules”

A. Wool, A Quantitative Study of Firewall Configuration Errors, Computer, IEEE, vol. 37, no. 6, pp. 62–67, Jun. 2004.

A. Wool, Trends in Firewall Configuration Errors: Measuring the Holes in Swiss Cheese, Internet Computing, IEEE, vol. 14, no. 4, pp. 58–65, Jul. 2010.

C. Diekmann, L. Hupel, and G. Carle, Semantics-Preserving Simplification of Real-World Firewall Rule Sets, in Formal Methods (FM). Springer, pp. 195–212. Jun. 2015

(19)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Problem

“there are no good high-complexity rule sets”

“firewalls are (still) poorly configured

“tools do not understand real-world firewall rules”

A. Wool, A Quantitative Study of Firewall Configuration Errors, Computer, IEEE, vol. 37, no. 6, pp. 62–67, Jun. 2004.

A. Wool, Trends in Firewall Configuration Errors: Measuring the Holes in Swiss Cheese, Internet Computing, IEEE, vol. 14, no. 4, pp. 58–65, Jul. 2010.

C. Diekmann, L. Hupel, and G. Carle, Semantics-Preserving Simplification of Real-World Firewall Rule Sets, in Formal Methods (FM). Springer, pp. 195–212. Jun. 2015

(20)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Problem

“there are no good high-complexity rule sets”

“firewalls are (still) poorly configured

“tools do not understand real-world firewall rules”

A. Wool, A Quantitative Study of Firewall Configuration Errors, Computer, IEEE, vol. 37, no. 6, pp. 62–67, Jun. 2004.

A. Wool, Trends in Firewall Configuration Errors: Measuring the Holes in Swiss Cheese, Internet Computing, IEEE, vol. 14, no. 4, pp. 58–65, Jul. 2010.

(21)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

A Tool for Ruleset Verification

Specification

I

Documentation

I

What is a correct ruleset?

I

Goal: Spoofing protection

I

Needs: Model of iptables

Implementation

I

Code, tool

I

Performance

(22)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

A Tool for Ruleset Verification

Specification

I

Documentation

I

What is a correct ruleset?

I

Goal: Spoofing protection

I

Needs: Model of iptables

Implementation

I

Code, tool

I

Performance

(23)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

A Tool for Ruleset Verification

Specification

I

Documentation

I

What is a correct ruleset?

I

Goal: Spoofing protection

I

Needs: Model of iptables

Implementation

I

Code, tool

I

Performance

(24)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

A Tool for Ruleset Verification

Specification

I

Documentation

I

What is a correct ruleset?

I

Goal: Spoofing protection

I

Needs: Model of iptables

Implementation

I

Code, tool

I

Performance

(25)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

A Tool for Ruleset Verification

Specification

I

Documentation

I

What is a correct ruleset?

I

Goal: Spoofing protection

I

Needs: Model of iptables

Implementation

I

Code, tool

I

Performance

α

A

β

λ

http://isabelle.in.tum.de/
(26)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

A Tool for Ruleset Verification

Specification

I

Documentation

I

What is a correct ruleset?

I

Goal: Spoofing protection

I

Needs: Model of iptables

Implementation

I

Code, tool

I

Performance

α

A

β

λ

Proof

http://isabelle.in.tum.de/
(27)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

A Tool for Ruleset Verification

Specification

I

Documentation

I

What is a correct ruleset?

I

Goal: Spoofing protection

I

Needs: Model of iptables

Implementation

I

Code, tool

I

Performance

α

A

β

λ

Proof

http://isabelle.in.tum.de/
(28)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Syntax

I

How to represent match expressions?

datatype

0

a mexpr

=

Match

0

a

|

MatchAny

|

MatchNot

0

a mexpr

|

MatchAnd

0

a mexpr

0

a mexpr

Example:

(29)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Syntax

I

How to represent match expressions?

datatype

0

a mexpr

=

Match

0

a

|

MatchAny

|

MatchNot

0

a mexpr

|

MatchAnd

0

a mexpr

0

a mexpr

Polymorphic: arbitrary type

0

a

Example:

(30)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Syntax

I

How to represent match expressions?

datatype

0

a mexpr

=

Match

0

a

|

MatchAny

|

MatchNot

0

a mexpr

|

MatchAnd

0

a mexpr

0

a mexpr

Polymorphic: arbitrary type

0

a

Example:

(31)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Syntax

I

How to represent match expressions?

datatype

0

a mexpr

=

Match

0

a

|

MatchAny

|

MatchNot

0

a mexpr

|

MatchAnd

0

a mexpr

0

a mexpr

Polymorphic: arbitrary type

0

a

Example:

(32)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Syntax

I

How to represent match expressions?

datatype

0

a mexpr

=

Match

0

a

|

MatchAny

|

MatchNot

0

a mexpr

|

MatchAnd

0

a mexpr

0

a mexpr

Polymorphic: arbitrary type

0

a

Recursive datatype

Example:

(33)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Syntax

I

How to represent match expressions?

datatype

0

a mexpr

=

Match

0

a

|

MatchAny

|

MatchNot

0

a mexpr

|

MatchAnd

0

a mexpr

0

a mexpr

Polymorphic: arbitrary type

0

a

Recursive datatype

Example:

(34)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Syntax

I

How to represent match expressions?

datatype

0

a mexpr

=

Match

0

a

|

MatchAny

|

MatchNot

0

a mexpr

|

MatchAnd

0

a mexpr

0

a mexpr

Example:

(35)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Syntax

I

How to represent match expressions?

datatype

0

a mexpr

=

Match

0

a

|

MatchAny

|

MatchNot

0

a mexpr

|

MatchAnd

0

a mexpr

0

a mexpr

Primitive

Example:

(36)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Semantics

I

What do match expressions mean?

matches

::

0

a

0

p

B

0

a mexpr

0

p

B

matches

γ

(

Match

a

)

p

←→

γ

a p

matches

MatchAny

←→

True

matches

γ

(

MatchNot

m

)

p

←→ ¬

matches

γ

m p

(37)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Semantics

I

What do match expressions mean?

matches

::

0

a

0

p

B

0

a mexpr

0

p

B

matches

γ

(

Match

a

)

p

←→

γ

a p

matches

MatchAny

←→

True

matches

γ

(

MatchNot

m

)

p

←→ ¬

matches

γ

m p

(38)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Semantics

I

What do match expressions mean?

matches

::

0

a

0

p

B

0

a mexpr

0

p

B

matches

γ

(

Match

a

)

p

←→

γ

a p

matches

MatchAny

←→

True

matches

γ

(

MatchNot

m

)

p

←→ ¬

matches

γ

m p

(39)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Semantics

I

What do match expressions mean?

matches

::

0

a

0

p

B

0

a mexpr

0

p

B

matches

γ

(

Match

a

)

p

←→

γ

a p

matches

MatchAny

←→

True

matches

γ

(

MatchNot

m

)

p

←→ ¬

matches

γ

m p

(40)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Semantics

I

What do match expressions mean?

matches

::

0

a

0

p

B

0

a mexpr

0

p

B

matches

γ

(

Match

a

)

p

←→

γ

a p

matches

MatchAny

←→

True

matches

γ

(

MatchNot

m

)

p

←→ ¬

matches

γ

m p

(41)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Semantics

I

What do match expressions mean?

matches

::

0

a

0

p

B

0

a mexpr

0

p

B

matches

γ

(

Match

a

)

p

←→

γ

a p

matches

MatchAny

←→

True

matches

γ

(

MatchNot

m

)

p

←→ ¬

matches

γ

m p

(42)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Semantics

I

What do match expressions mean?

matches

::

0

a

0

p

B

0

a mexpr

0

p

B

matches

γ

(

Match

a

)

p

←→

γ

a p

matches

MatchAny

←→

True

matches

γ

(

MatchNot

m

)

p

←→ ¬

matches

γ

m p

(43)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Semantics

I

What do match expressions mean?

matches

::

0

a

0

p

B

0

a mexpr

0

p

B

matches

γ

(

Match

a

)

p

←→

γ

a p

matches

MatchAny

←→

True

matches

γ

(

MatchNot

m

)

p

←→ ¬

matches

γ

m p

(44)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Semantics

I

What do match expressions mean?

matches

::

0

a

0

p

B

0

a mexpr

0

p

B

matches

γ

(

Match

a

)

p

←→

γ

a p

matches

MatchAny

←→

True

matches

γ

(

MatchNot

m

)

p

←→ ¬

matches

γ

m p

(45)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Semantics

I

What do match expressions mean?

matches

::

0

a

0

p

B

0

a mexpr

0

p

B

matches

γ

(

Match

a

)

p

←→

γ

a p

matches

MatchAny

←→

True

matches

γ

(

MatchNot

m

)

p

←→ ¬

matches

γ

m p

(46)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Match Expressions: Syntax and Semantics

Semantics

I

What do match expressions mean?

matches

::

0

a

0

p

B

0

a mexpr

0

p

B

matches

γ

(

Match

a

)

p

←→

γ

a p

matches

MatchAny

←→

True

matches

γ

(

MatchNot

m

)

p

←→ ¬

matches

γ

m p

(47)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Iptables Semantics: Filtering Behavior

SKIP γ,p` [], t ⇒t ACCEPT matchesγm p γ,p` [(m,Accept)], ?⇒ ! DROP matchesγm p γ,p` [(m,Drop)], ?⇒ % REJECT matchesγm p γ,p` [(m,Reject)], ?⇒% NOMATCH ¬matchesγm p γ,p` [(m,a)], ?? DECISION t 6 = ? γ,p` rs, t ⇒t SEQ γ,p` rs1, ?⇒t γ,p`rs2,t⇒t0 γ,p` rs1:::rs2, ?⇒t0 LOG matchesγm p γ,p` [(m,Log)], ?? EMPTY matchesγm p γ,p` [(m,Empty)], ??

CALLRESULT matchesγm p γ,p `

Γc, ?⇒t γ,p`

[(m,Callc)], ?⇒t

CALLRETURN

matchesγm p Γc=rs1::: (m0,Return) ::rs2 matchesγm0p γ,p`

rs1, ??

γ,p`

[(m,Callc)], ??

(48)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Iptables Semantics: Filtering Behavior

SKIP γ,p` [], t ⇒t ACCEPT matchesγm p γ,p` [(m,Accept)], ?⇒ ! DROP matchesγm p γ,p` [(m,Drop)], ?⇒ % REJECT matchesγm p γ,p` [(m,Reject)], ?⇒% NOMATCH ¬matchesγm p γ,p` [(m,a)], ?? DECISION t 6 = ? γ,p` rs, t ⇒t SEQ γ,p` rs1, ?⇒t γ,p`rs2,t⇒t0 γ,p` rs1:::rs2, ?⇒t0 LOG matchesγm p γ,p` [(m,Log)], ?? EMPTY matchesγm p γ,p` [(m,Empty)], ??

CALLRESULT matchesγm p γ,p `

Γc, ?⇒t γ,p`

[(m,Callc)], ?⇒t

CALLRETURN

matchesγm p Γc=rs1::: (m0,Return) ::rs2 matchesγm0p γ,p`

rs1, ??

γ,p`

[(m,Callc)], ??

(49)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained

Primitive matcher

Packet

γ ,

p

`

rs

,

s

t

ruleset

start state

(e.g.,

?

)

final state

(50)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained

Primitive matcher

Packet

γ ,

p

`

rs

,

s

t

ruleset

start state

(e.g.,

?

)

final state

(51)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained

Primitive matcher

Packet

γ ,

p

`

rs

,

s

t

ruleset

start state

(e.g.,

?

)

final state

(52)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained

Primitive matcher

Packet

γ ,

p

`

rs

,

s

t

ruleset

start state

(e.g.,

?

)

final state

(e.g.,

!

,

%

)

(53)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained

Primitive matcher

Packet

γ ,

p

`

rs

,

s

t

ruleset

start state

(e.g.,

?

)

final state

(54)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained

Primitive matcher

Packet

γ ,

p

`

rs

,

s

t

ruleset

start state

(e.g.,

?

)

final state

(55)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: SKIP

γ,

p

`

[]

,

t

t

(56)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: SKIP

Precondition

Conclusion

γ,

p

`

[]

,

t

t

I

no precondition

I Holds unconditionally I IFTRUEthenγ,p` [], t ⇒t
(57)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: SKIP

Precondition

Conclusion

γ,

p

`

[]

,

t

t

I

no precondition

I Holds unconditionally I IFTRUEthenγ,p` [], t ⇒t
(58)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: SKIP

Precondition

Conclusion

γ,

p

`

[]

,

t

t

I

no precondition

I Holds unconditionally I IFTRUEthenγ,p` [], t ⇒t
(59)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: SKIP

Precondition

Conclusion

γ,

p

`

[]

,

t

t

I

no precondition

I Holds unconditionally I IFTRUEthenγ,p` [], t ⇒t
(60)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: SKIP

γ,

p

`

[]

,

t

t

I

Empty Ruleset

I

Start state equals final state

(61)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: SKIP

γ,

p

`

[]

,

t

t

I

Empty Ruleset

I

Start state equals final state

(62)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: SKIP

γ,

p

`

[]

,

t

t

I

Empty Ruleset

I

Start state equals final state

(63)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: SKIP

γ,

p

`

[]

,

t

t

I

Empty Ruleset

I

Start state equals final state

(64)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: ACCEPT

matches

γ

m p

γ,

p

`

[(

m

,

Accept

)]

,

?

!

I

Ruleset: single rule

I

matches

I

The action of the rule is

Accept

rule

I

The firewall does not have a decision yet

I

It will accept the packet

(65)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: ACCEPT

matches

γ

m p

γ,

p

`

[(

m

,

Accept

)]

,

?

!

I

Ruleset: single rule

I

matches

I

The action of the rule is

Accept

rule

I

The firewall does not have a decision yet

I

It will accept the packet

(66)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: ACCEPT

matches

γ

m p

γ,

p

`

[(

m

,

Accept

)]

,

?

!

I

Ruleset: single rule

I

matches

I

The action of the rule is

Accept

rule

I

The firewall does not have a decision yet

I

It will accept the packet

(67)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: ACCEPT

matches

γ

m p

γ,

p

`

[(

m

,

Accept

)]

,

?

!

I

Ruleset: single rule

I

matches

I

The action of the rule is

Accept

rule

I

The firewall does not have a decision yet

I

It will accept the packet

(68)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: ACCEPT

matches

γ

m p

γ,

p

`

[(

m

,

Accept

)]

,

?

!

I

Ruleset: single rule

I

matches

I

The action of the rule is

Accept

rule

I

The firewall does not have a decision yet

I

It will accept the packet

(69)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: ACCEPT

matches

γ

m p

γ,

p

`

[(

m

,

Accept

)]

,

?

!

I

Ruleset: single rule

I

matches

I

The action of the rule is

Accept

rule

I

The firewall does not have a decision yet

I

It will accept the packet

(70)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: ACCEPT

matches

γ

m p

γ,

p

`

[(

m

,

Accept

)]

,

?

!

I

Ruleset: single rule

I

matches

I

The action of the rule is

Accept

rule

I

The firewall does not have a decision yet

I

It will accept the packet

(71)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: CALLRETURN

matchesγm p Γc =rs1::: (m0,Return) ::rs2 matchesγm0p γ,p`

rs1, ??

γ,p`

[(m, Callc)], ??

I

matches

I

The called chain

c

in the background ruleset

Γ

is defined as

rs

1

::: (

m

0

,

Return

) ::

rs

2

I

First part

rs

1

is processed without result

I

Then there is a matching

Return

(72)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: CALLRETURN

matchesγm p Γc =rs1::: (m0,Return) ::rs2 matchesγm0p γ,p`

rs1, ??

γ,p`

[(m, Callc)], ??

I

matches

I

The called chain

c

in the background ruleset

Γ

is defined as

rs

1

::: (

m

0

,

Return

) ::

rs

2

I

First part

rs

1

is processed without result

I

Then there is a matching

Return

(73)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: CALLRETURN

matchesγm p Γc =rs1::: (m0,Return) ::rs2 matchesγm0p γ,p`

rs1, ??

γ,p`

[(m, Callc)], ??

I

matches

I

The called chain

c

in the background ruleset

Γ

is defined as

rs

1

::: (

m

0

,

Return

) ::

rs

2

I

First part

rs

1

is processed without result

I

Then there is a matching

Return

(74)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: CALLRETURN

matchesγm p Γc =rs1::: (m0,Return) ::rs2 matchesγm0p γ,p`

rs1, ??

γ,p`

[(m, Callc)], ??

I

matches

I

The called chain

c

in the background ruleset

Γ

is defined as

rs

1

::: (

m

0

,

Return

) ::

rs

2

I

First part

rs

1

is processed without result

I

Then there is a matching

Return

(75)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: CALLRETURN

matchesγm p Γc =rs1::: (m0,Return) ::rs2 matchesγm0p γ,p`

rs1, ??

γ,p`

[(m, Callc)], ??

I

matches

I

The called chain

c

in the background ruleset

Γ

is defined as

rs

1

::: (

m

0

,

Return

) ::

rs

2

I

First part

rs

1

is processed without result

I

Then there is a matching

Return

(76)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: CALLRETURN

matchesγm p Γc =rs1::: (m0,Return) ::rs2 matchesγm0p γ,p`

rs1, ??

γ,p`

[(m, Callc)], ??

I

matches

I

The called chain

c

in the background ruleset

Γ

is defined as

rs

1

::: (

m

0

,

Return

) ::

rs

2

I

First part

rs

1

is processed without result

I

Then there is a matching

Return

(77)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics Explained: CALLRETURN

matchesγm p Γc =rs1::: (m0,Return) ::rs2 matchesγm0p γ,p`

rs1, ??

γ,p`

[(m, Callc)], ??

I

matches

I

The called chain

c

in the background ruleset

Γ

is defined as

rs

1

::: (

m

0

,

Return

) ::

rs

2

I

First part

rs

1

is processed without result

I

Then there is a matching

Return

(78)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics-Preserving Simplification

γ,

p

`

rs,

s

t

iff

γ,

p

`

f

rs,

s

t

I

f

::

0

a ruleset

0

a ruleset

I

f

does not change filtering behavior of firewall

I

Removing

Log

rules

I

Unfolding of user-defined chains

(79)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics-Preserving Simplification

γ,

p

`

rs,

s

t

iff

γ,

p

`

f

rs,

s

t

I

f

::

0

a ruleset

0

a ruleset

I

f

does not change filtering behavior of firewall

I

Removing

Log

rules

I

Unfolding of user-defined chains

(80)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics-Preserving Simplification

γ,

p

`

rs,

s

t

iff

γ,

p

`

f

rs,

s

t

I

f

::

0

a ruleset

0

a ruleset

I

f

does not change filtering behavior of firewall

I

Removing

Log

rules

I

Unfolding of user-defined chains

(81)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics-Preserving Simplification

γ,

p

`

rs,

s

t

iff

γ,

p

`

f

rs,

s

t

I

f

::

0

a ruleset

0

a ruleset

I

f

does not change filtering behavior of firewall

I

Removing

Log

rules

I

Unfolding of user-defined chains

(82)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics-Preserving Simplification

γ,

p

`

rs,

s

t

iff

γ,

p

`

f

rs,

s

t

I

f

::

0

a ruleset

0

a ruleset

I

f

does not change filtering behavior of firewall

I

Removing

Log

rules

I

Unfolding of user-defined chains

(83)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Semantics-Preserving Simplification

γ,

p

`

rs,

s

t

iff

γ,

p

`

f

rs,

s

t

I

f

::

0

a ruleset

0

a ruleset

I

f

does not change filtering behavior of firewall

I

Removing

Log

rules

I

Unfolding of user-defined chains

(84)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Embedding in Ternary Logic

B

=

{

True

,

False

}

Ternary

=

{

True

,

False

,

Unknown

}

n

p

|

approx firewall

γ

stricter

rs

=

!

o

p

|

γ,

p

`

rs

,

?

!

n

p

|

approx firewall

γ

permissive

rs

=

!

o

I

Set of packets accepted by the firewall

I

We can specify a lot

. . .

(85)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Embedding in Ternary Logic

B

=

{

True

,

False

}

Ternary

=

{

True

,

False

,

Unknown

}

n

p

|

approx firewall

γ

stricter

rs

=

!

o

p

|

γ,

p

`

rs

,

?

!

n

p

|

approx firewall

γ

permissive

rs

=

!

o

I

Set of packets accepted by the firewall

I

We can specify a lot

. . .

(86)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Embedding in Ternary Logic

B

=

{

True

,

False

}

Ternary

=

{

True

,

False

,

Unknown

}

n

p

|

approx firewall

γ

stricter

rs

=

!

o

p

|

γ,

p

`

rs

,

?

!

n

p

|

approx firewall

γ

permissive

rs

=

!

o

I

Set of packets accepted by the firewall

I

We can specify a lot

. . .

(87)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Embedding in Ternary Logic

B

=

{

True

,

False

}

Ternary

=

{

True

,

False

,

Unknown

}

n

p

|

approx firewall

γ

stricter

rs

=

!

o

p

|

γ,

p

`

rs

,

?

!

n

p

|

approx firewall

γ

permissive

rs

=

!

o

I

Set of packets accepted by the firewall

I

We can specify a lot

. . .

(88)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Embedding in Ternary Logic

B

=

{

True

,

False

}

Ternary

=

{

True

,

False

,

Unknown

}

n

p

|

approx firewall

γ

stricter

rs

=

!

o

p

|

γ,

p

`

rs

,

?

!

n

p

|

approx firewall

γ

permissive

rs

=

!

o

not executable

I

Set of packets accepted by the firewall

I

We can specify a lot

. . .

(89)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Embedding in Ternary Logic

B

=

{

True

,

False

}

Ternary

=

{

True

,

False

,

Unknown

}

n

p

|

approx firewall

γ

stricter

rs

=

!

o

p

|

γ,

p

`

rs

,

?

!

n

p

|

approx firewall

γ

permissive

rs

=

!

o

executable

not executable

executable

I

Set of packets accepted by the firewall

(90)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Spoofing Protection

ipassmt

::

interface

IP set

Example:

ipassmt

= [

eth0

7→

192

.

168

.

0

.

0

/

24

]

Spoofing Protection:

p

.

src ip

|

p

.

in iface

=

eth0

γ,

p

`

rs

,

?

!

192

.

168

.

0

.

0

/

24

(91)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Spoofing Protection

ipassmt

::

interface

IP set

Example:

ipassmt

= [

eth0

7→

192

.

168

.

0

.

0

/

24

]

Spoofing Protection:

p

.

src ip

|

p

.

in iface

=

eth0

γ,

p

`

rs

,

?

!

192

.

168

.

0

.

0

/

24

(92)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Spoofing Protection

ipassmt

::

interface

IP set

Example:

ipassmt

= [

eth0

7→

192

.

168

.

0

.

0

/

24

]

Spoofing Protection:

p

.

src ip

|

p

.

in iface

=

eth0

γ,

p

`

rs

,

?

!

192

.

168

.

0

.

0

/

24

(93)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Spoofing Protection

ipassmt

::

interface

IP set

Example:

ipassmt

= [

eth0

7→

192

.

168

.

0

.

0

/

24

]

Spoofing Protection:

p

.

src ip

|

p

.

in iface

=

eth0

γ,

p

`

rs

,

?

!

192

.

168

.

0

.

0

/

24

(94)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Spoofing Protection

ipassmt

::

interface

IP set

Example:

ipassmt

= [

eth0

7→

192

.

168

.

0

.

0

/

24

]

Spoofing Protection:

p

.

src ip

|

p

.

in iface

=

eth0

γ,

p

`

rs

,

?

!

192

.

168

.

0

.

0

/

24

(95)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Spoofing Protection

ipassmt

::

interface

IP set

Example:

ipassmt

= [

eth0

7→

192

.

168

.

0

.

0

/

24

]

Spoofing Protection:

p

.

src ip

|

p

.

in iface

=

eth0

γ,

p

`

rs

,

?

!

192

.

168

.

0

.

0

/

24

(96)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Spoofing Protection

ipassmt

::

interface

IP set

Example:

ipassmt

= [

eth0

7→

192

.

168

.

0

.

0

/

24

]

Spoofing Protection:

eth

ipassmt

.

keys

p

.

src ip

|

p

.

in iface

=

eth

γ,

p

`

(97)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Spoofing Protection

ipassmt

::

interface

IP set

Example:

ipassmt

= [

eth0

7→

192

.

168

.

0

.

0

/

24

]

Spoofing Protection:

check spoofing protection

ipassmt rs

−→

eth

ipassmt

.

keys

p

.

src ip

|

p

.

in iface

=

eth

γ,

p

`

(98)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Spoofing Protection

ipassmt

::

interface

IP set

Example:

ipassmt

= [

eth0

7→

192

.

168

.

0

.

0

/

24

]

Spoofing Protection:

check spoofing protection

ipassmt rs

−→

eth

ipassmt

.

keys

p

.

src ip

|

p

.

in iface

=

eth

γ,

p

`

(99)

α

A

β

(100)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Service Matrix

internal

servers

multicast

INET

localhost

ip

1

ip

2

AS routers

INET’

I

Partitions complete IPv4

space

I

All IP addresses in each

group have same access

rights

I

Cannot be compressed any

(101)

α

A

β

λ → Verified Firewall Ruleset Verification – corny Technische Universit ¨at M ¨unchen

Sources

Firewall Rulesets

plz contribute

https://github.com/diekmann/net-network

Isabelle Theories + Haskell Tool:

http://isabelle.in.tum.de/ https://github.com/diekmann/net-network https://github.com/diekmann/Iptables_Semantics

References

Related documents

It should be also noted that the Research Division of AlJazira Capital had no information at the time of issuing this report regarding any conflict of interest between

2 The term VALENCIA HONORS SCHOLARS is reserved for those students who successfully complete at least 18 hours of honors coursework, who earn no less than a “C” in each

Yes, each school entity will be required to amend its special education plan using the Special Education Plan Revision Notice (SEPRN) for the 2009-10 school year to reflect the

Page 5.. It is not really feasible to extend the current loan scheme and if we offered staff a competitive loan there would complex tax implications as well as additional cost

(2) Conversely, given the Dicks coloring, we can obtain the 1-skeleton of ∆ by adding edges connecting each gate of a blue (resp. red) cell to all the vertices clockwise

■ Using Roles and Privileges for Data Warehouse Security ■ Using a Virtual Private Database in Data Warehouses ■ Overview of Oracle Label Security. ■ Overview of Fine-Grained

Using a panel data set that consists of over 2,000 markets observed from 1988 to 2004, we report a number of findings regarding the market characteristics that are associated with

arcs trending parallel to the Main Zagros Thrust, namely, the Mesozoic Sanandaj-Sirjan (SSMA) and the Tertiary to Plio- Quaternary Urumieh-Dokhtar magmatic arcs (UDMA) (Fig..