35
About this talk: Keywords I Network Security Policy I Stateful Firewalls I Isabelle/HOL

Network Security Policy Stateful Firewalls Isabelle/HOL

  • Upload
    others

  • View
    11

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Network Security Policy Stateful Firewalls Isabelle/HOL

About this talk: Keywords

I Network Security Policy

I Stateful Firewalls

I Isabelle/HOL

Page 2: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Directed Security Policies:A Stateful Network Implementation

3rd International Workshop on Engineering Safety and SecuritySystems (ESSS)

Cornelius Diekmann† Lars Hupel‡ Georg Carle†

†Chair for Network Architectures and Services ‡Chair for Logic and VerificationTechnische Universitat Munchen

Munich, Germany

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation 1/24

Page 3: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Motivation

I A directed security policy

Alice→ BobAlice→ Carl

...I A policy rule

A→ B

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Motivation 2/24

Page 4: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Motivation

I A policy rule

A→ BI Policy implementation (Linux netfilter iptables firewall)

I Version Aiptables -A INPUT -s A -d B -j ACCEPT

iptables -A INPUT -j DROP

I Version Biptables -A INPUT -s A -d B -m conntrack --ctstate NEW -j ACCEPT

iptables -A INPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT

iptables -A INPUT -j DROP

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Motivation 3/24

Page 5: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Version Aiptables -A INPUT -s A -d B -j ACCEPT

iptables -A INPUT -j DROP

I A→ B is “can send packets to”

I Direct translation of policy

I Example: Smart meter A reports data to billing gateway B

Version Biptables -A INPUT -s A -d B -m conntrack --ctstate NEW -j ACCEPT

iptables -A INPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT

iptables -A INPUT -j DROP

I A→ B is “can initiate connections to”

I Lax interpretation of policy, also allow packets from B to A

I Example: Alice A requests cat pictures from website B

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Motivation 4/24

Page 6: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Version Aiptables -A INPUT -s A -d B -j ACCEPT

iptables -A INPUT -j DROP

I A→ B is “can send packets to”

I Direct translation of policy

I Example: Smart meter A reports data to billing gateway B

Version Biptables -A INPUT -s A -d B -m conntrack --ctstate NEW -j ACCEPT

iptables -A INPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT

iptables -A INPUT -j DROP

I A→ B is “can initiate connections to”

I Lax interpretation of policy, also allow packets from B to A

I Example: Alice A requests cat pictures from website B

A give me cat pictures−−−−−−−−−−−→ B

A ←−−−−−− B

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Motivation 4/24

Page 7: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Overall Problem Statement

Directed Policy: A→ B

Stateless Implementation Version Aiptables -A INPUT -s A -d B -j ACCEPT

iptables -A INPUT -j DROP

Security ++

Network functionality --

Stateful Implementation Version Biptables -A INPUT -s A -d B -m conntrack --ctstate NEW -j ACCEPT

iptables -A INPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT

iptables -A INPUT -j DROP

Security -

Network functionality ++

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Motivation 5/24

Page 8: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Agenda1 Motivation2 Agenda3 Example4 Formal Model5 Compliance Criteria6 Contributions7 Example8 Case Study9 Conclusion

λ→

∀=Is

abelle

β

α

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Agenda 6/24

Page 9: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Example: Policy of a university department network

Students

WebSrv

PrinterInternet

Employees

FilesSrv

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Example 7/24

Page 10: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Security Invariants: Access Control

Students

WebSrv

PrinterInternet

Employees

FilesSrv

ACS 1 Printer only accessible by Employees and StudentsACS 2 FileServer only accessible by EmployeesACS 3 Employees and Students are in a joint subnet

(can collaborate, are protected from accesses from the outside)

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Example 8/24

Page 11: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Security Invariants: Information Flow

Students

WebSrv

PrinterInternet

Employees

FilesSrv

IFS 1 FileServer has confidential data. Only Employees have thenecessary security clearance and are trusted (i.e. candeclassify).

IFS 2 Printer is an information sink(no data, e.g., exams, must be retrievable from the printer)

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Example 9/24

Page 12: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Directed Policy

I Directed graph G = (V , E)

I Example

I A→ BI G = ({A,B}, {(A,B)})

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Formal Model 10/24

Page 13: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Security Invariant

see [DPN+14]

I Total function m of type G ⇒ B

I m G ←→ policy G fulfills invariant m

I Monotonicity: “prohibiting more is more or equally secure”m (V ,E) ∧ E ′ ⊆ E =⇒ m (V ,E ′)

I m’s security strategy

I ACS: Access Control StrategyI IFS: Information Flow Strategy

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Formal Model 11/24

Page 14: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Offending Flows

G = (V , E)

I If a security invariant is violated ¬ m G

I Flows F ⊆ E responsible for the violation

I offending flows m G is the set of all such minimal F

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Formal Model 12/24

Page 15: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Offending Flows

G = (V , E)

I If a security invariant is violated ¬ m G

I Flows F ⊆ E responsible for the violation

I offending flows m G is the set of all such minimal F

I Example: m is that A must not access C transitively

B

A C

G

B

A C

{(B,C)}

B

A C

{(A,B)}

I offending flows m G = {{(B,C)}, {(A,B)}}

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Formal Model 12/24

Page 16: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Stateful Policy

I T = (V , Eτ , Eσ)

I Eτ ≈ EI Eσ ⊆ Eτ flows “upgraded” to stateful flows

I Mapping α between T and G

α T = (V , Eτ ∪←−Eσ)

I where←−Eσ = {(r , s) | (s, r) ∈ Eσ} backflows

I Example: α (V , E , ∅)︸ ︷︷ ︸Tstateless

= G

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Formal Model 13/24

Page 17: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

When does T comply with G?

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Compliance Criteria 14/24

Page 18: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

IFS Compliance

I Protect against information leakageI side channels: ACKs, SEQ nr, ... timing channels, ...

I All IFS invariants must be fulfilled

∀m ∈ getIFS M. m (α T ) (1)

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Compliance Criteria 15/24

Page 19: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

ACS Compliance

I Requirements can be relaxed

I If A accesses B, A expects an answer from B for its request

I ExampleI Alice→ CatPictures

Assumption: no (higher layer) software vulnerability at A

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Compliance Criteria 16/24

Page 20: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

ACS Compliance

I Violations due to backflows are tolerable (expected answers)

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Compliance Criteria 17/24

Page 21: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

ACS Compliance

I Violations due to backflows are tolerable (expected answers)

I As long as they cause no negative side effect!

I ExampleI m is that A must not access C transitivelyI G = ({A,B,C}, {(B,A), (B,C)})I T = ({A,B,C}, {(B,A), (B,C)}, {(B,A)}︸ ︷︷ ︸

)

I α T = ({A,B,C}, {(B,A), (B,C), (A,B)})I offending flows m G =

{{(B,C)}, {(A,B)}} = {{(B,C)},←−Eσ}

B

A C

G

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Compliance Criteria 18/24

Page 22: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

ACS Compliance

I Violations due to backflows are tolerable (expected answers)

I As long as they cause no negative side effect!

I ExampleI m is that A must not access C transitivelyI G = ({A,B,C}, {(B,A), (B,C)})I T = ({A,B,C}, {(B,A), (B,C)}, {(B,A)}︸ ︷︷ ︸

)

I α T = ({A,B,C}, {(B,A), (B,C), (A,B)})I offending flows m G =

{{(B,C)}, {(A,B)}} = {{(B,C)},←−Eσ}

B

A C

T

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Compliance Criteria 18/24

Page 23: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

ACS Compliance

I Violations due to backflows are tolerable (expected answers)

I As long as they cause no negative side effect!

I ExampleI m is that A must not access C transitivelyI G = ({A,B,C}, {(B,A), (B,C)})I T = ({A,B,C}, {(B,A), (B,C)}, {(B,A)}︸ ︷︷ ︸

)

I α T = ({A,B,C}, {(B,A), (B,C), (A,B)})I offending flows m G =

{{(B,C)}, {(A,B)}} = {{(B,C)},←−Eσ}

B

A C

α T

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Compliance Criteria 18/24

Page 24: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

ACS Compliance

I Violations due to backflows are tolerable (expected answers)

I As long as they cause no negative side effect!

I ExampleI m is that A must not access C transitivelyI G = ({A,B,C}, {(B,A), (B,C)})I T = ({A,B,C}, {(B,A), (B,C)}, {(B,A)}︸ ︷︷ ︸

)

I α T = ({A,B,C}, {(B,A), (B,C), (A,B)})I offending flows m G =

{{(B,C)}, {(A,B)}} = {{(B,C)},←−Eσ}

B

A C⋃offending

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Compliance Criteria 18/24

Page 25: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

ACS Compliance

I Violations due to backflows are tolerable (expected answers)

I As long as they cause no negative side effect!

I Approach: for all subsets of←−Eσ, verify that violations are exactly

in this subset

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Compliance Criteria 19/24

Page 26: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

ContributionsI Verify that T is compliant with G and the security invariants

I in linear time O(|E |)

I Generate T (in particular Eσ) from G and the security invariantsI in O(|E |2)

For linear time security invariants

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Contributions 20/24

Page 27: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Example

Students

WebSrv

PrinterInternet

Employees

FilesSrv Students

WebSrv

PrinterInternet

Employees

FilesSrv

I Everything can be stateful – except at the PrinterI Special cases

I Aircrafts, critical infrastructure, SCADA systems, smart meters, ...

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Example 21/24

Page 28: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Case Study

Class0[0-130].[0-255].[0-255].[0-255]131.[0-158].[0-255].[0-255]

131.[160-255].[0-255].[0-255][132-255].[0-255].[0-255].[0-255]

Class3131.159.14.1

Class5131.159.14.[7-9]131.159.14.24131.159.14.28131.159.14.37131.159.14.43131.159.14.58131.159.14.91131.159.14.122

Class6131.159.14.[10-11]131.159.14.22131.159.14.125

Class9131.159.14.36131.159.14.42

Class11131.159.14.52

Class14131.159.14.111

Class19131.159.15.[247-248]

Class1131.159.[0-13].[0-255]131.159.[16-19].[0-255]131.159.[22-255].[0-255]Class7

131.159.14.12

Class2131.159.14.0

131.159.14.[2-4]131.159.14.[25-26]131.159.14.[31-32]131.159.14.35

131.159.14.[38-41]131.159.14.49131.159.14.56131.159.14.59

131.159.14.[61-62]131.159.14.69131.159.14.80131.159.14.104131.159.14.110131.159.14.124

131.159.14.[126-137]131.159.14.[139-194]131.159.14.[196-205]

131.159.14.207131.159.14.[209-255]

Class4131.159.14.[5-6]

131.159.14.[13-21]131.159.14.23131.159.14.27131.159.14.29131.159.14.34

131.159.14.[44-46]131.159.14.48

131.159.14.[50-51]131.159.14.[53-55]131.159.14.57131.159.14.60

131.159.14.[63-68]131.159.14.[70-73]131.159.14.[75-79]131.159.14.[81-86]131.159.14.[88-90]131.159.14.[92-103]131.159.14.[105-109]131.159.14.[112-121]

131.159.14.123

Class8131.159.14.30131.159.14.33 Class10

131.159.14.47

Class12131.159.14.74

Class13131.159.14.87

Class15131.159.14.138131.159.14.195

Class16131.159.14.206131.159.14.208

Class17131.159.15.[0-11]

131.159.15.[13-215]131.159.15.[217-246]131.159.15.[249-251]131.159.15.[253-255]131.159.21.[0-255]

Class18131.159.15.12131.159.15.216

Class20131.159.15.252

Class21131.159.20.[0-24]131.159.20.[26-71]131.159.20.[73-92]131.159.20.[94-255]

Class22131.159.20.25

Class23131.159.20.72131.159.20.93

Figure : Firewall TUM Chair for Network Architectures and Services

I Instant resultsI Eσ = all unidirectional flows and α T = (V , E ∪

←−E )

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Case Study 22/24

Page 29: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Conclusion

I Stateful filtering: often overlooked in previous work

I Need for: formally verified translation of network deviceconfigurations to formally accessible objects

I E.g. firewall rule sets, SDN flow tables, routing tables, ... to graphs

I Directed policy vs. stateful firewall implementation 3

I Fully machine-verified with Isabelle/HOL 3

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

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Conclusion 23/24

Page 30: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Thanks for your attention!

Questions?

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Thank You! 24/24

Page 31: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Cornelius Diekmann, Stephan-A. Posselt, Heiko Niedermayer,Holger Kinkelin, Oliver Hanka, and Georg Carle.Verifying Security Policies using Host Attributes.In Proc. FORTE, Berlin, Germany, June 2014. Springer.to appear.

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Appendix 24/24

Page 32: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

Backup Slides

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Appendix 24/24

Page 33: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

ACS Compliance

I Approach: for all subsets of←−Eσ, verify that violations are exactly

in this subset

∀X ⊆←−Eσ.

∀F ∈ get offending flows (getACS M) (V , Eτ ∪ Eσ ∪ X ). F ⊆ X(2)⋃

get offending flows (getACS M) (α T ) ⊆←−Eσ (3)

∀(r , s) ∈←−Eσ.⋃

get offending flows (getACS M) (V , Eτ∪Eσ∪{(r , s)}) ⊆ {(r , s)}(4)

I Obviously (2) =⇒ (3) and (2) =⇒ (4)

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Appendix 24/24

Page 34: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

ACS Compliance

I Approach: for all subsets of←−Eσ, verify that violations are exactly

in this subsetI Exponential complexityI New formula: All violations must only be due to the newly added

backflows←−Eσ \ Eτ

I Sufficient to show lack of side effects!

Students

WebSrv

PrinterInternet

Employees

FilesSrv

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Appendix 24/24

Page 35: Network Security Policy Stateful Firewalls Isabelle/HOL

Fakultat fur Informatik Technische Universitat Munchen

ACS Compliance

I Formula (2): For all subsets of←−Eσ, verify that violations are

exactly in this subsetI New Formula (5): All violations must only be due to the newly

added backflows←−Eσ \ Eτ

⋃get offending flows (getACS M) (α T ) ⊆

←−Eσ \ Eτ (5)

I Theorem: (5) =⇒ (2)

ESSS, 2014, Directed Security Policies:A Stateful Network Implementation: Appendix 24/24