Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of...

23
Malachite: Firewall Policy Comparison Dinesha Ranathunga * , Matthew Roughan * , Phil Kernick ** , Nick Falkner * , * University of Adelaide ** CQR Consulting 1 / 11

Transcript of Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of...

Page 1: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Malachite: Firewall Policy Comparison

Dinesha Ranathunga*, Matthew Roughan*, Phil Kernick**,Nick Falkner*,

* University of Adelaide

** CQR Consulting

1 / 11

Page 2: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Motivation

Current networks depend on firewalls to mitigate cyberattacks

especially SCADA networks

Supervisory Control And Data Acquisition networks

core to a nation’s critical infrastructuree.g., power, water, wastewaterdesigned for robustness, real-time performanceNOT secure

2 / 11

Page 3: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Motivation cont.

Industry standards exist (eg., Guide to Industrial ControlSystems Security by NIST, ANSI/ISA-62443-1-1) for

firewall architecturesservice-specific policiesnetwork segregation

NO standards for checking compliance

Serious firewall misconfigurations are frequent

Wool studied 74 corporate firewalls, >80% had serious errorswe studied 9 real SCADA firewalls, 100% had serious errors

3 / 11

Page 4: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Existing standards

ANSI/ISA Zone-Conduit model [ANSI/ISA-62443-1-1]:

SCADAZone

CorporateZoneConduit

Zone - groups systems with similar security requirements

single zone policy

Conduit - secure communication path between zones

firewalls are part of the conduits

Allows to construct network-wide high-level security policy

4 / 11

Page 5: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Need automated firewall-policy comparison

Multiple benefits

check best-practice compliancechange-impact analysisevaluate multiple policy-designs

Malachite: mathematical-framework based comparisons

precise and unambiguousrule-order independent

5 / 11

Page 6: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Comparison of network policy: a simple example

Implemented firewall policyP = (G1,P1)

Best-practice firewall policyRP = (G2,P2)

Is P equally or more restrictive than RP?

6 / 11

Page 7: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Comparison of network policy: a simple example

Implemented firewall policyP = (G1,P1)

Best-practice firewall policyRP = (G2,P2)

Is P equally or more restrictive than RP?

6 / 11

Page 8: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Workaround: use Line Digraphs (LDs)

L(G1) L(G2)

LD isomorphism =⇒ potential original-graph isomorphism

Harary and Norman 1960

7 / 11

Page 9: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Best-practice Compliance

Compliant if included or incorporated by best-practice policy

Definition (Partial Incorporation)

If P = (G1,P1), RP = (G2,P2), policy RP partially incorporatesP iff G1 is a subgraph of G2 and ∀e ∈ G1, pe1 ⊂ pe2 . We denotethis by P ⊂ RP(G1).

8 / 11

Page 10: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Implementation

Is P ⊂ RP(G1) ? where P = (G1,P1), RP = (G2,P2)

1. Derive semantic partitions SP1, SP2

partitions policy into equivalence classese.g., SP1 = {e1, e2}; e1 = {p12}, e2 = {p21}

2. Check SP1 ⊂ SP2

3. Find all feasible partition-mappings

4. Construct adjacency matrices A1, A2 of LDs per mapping

5. If A1 = A2 then P ⊂ RP(G1)

9 / 11

Page 11: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Application to real SCADA case studies

SUC Firewalls Zones Conduit-policies

Equivalenceclasses

Maximumclasssize

RPCompliant?

1 3 7 22 12 7 8

2 6 21 162 87 8 8

3 4 10 34 15 8 8

4 3 9 32 16 5 8

large equivalence class sizes =⇒ an inefficient network.

10 / 11

Page 12: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Conclusions

Many obstacles to firewall-policy comparison

Malachite addresses these challenges

network and vendor independent policy semanticsderives canonical policies for comparison

Limitations

best practice may not always be correctinclusion/incorporation may not always indicate compliancesome human intervention still required

11 / 11

Page 13: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Bibliography

[1] E. S. Al-Shaer and H. H. Hamed. “Discovery of policy anomalies in distributedfirewalls”. In: Annual Joint Conference of the IEEE CCS. INFOCOM. 2004,pp. 2605–2616.

[2] ANSI/ISA-62443-1-1. Security for Industrial Automation and Control SystemsPart 1-1: Terminology, Concepts, and Models. 2007.

[3] L. Babai. “Graph isomorphism in quasipolynomial time”. In: arXiv preprintarXiv:1512.03547 (2015).

[4] E. Byres, J. Karsch, and J. Carter. “NISCC good practice guide on firewalldeployment for SCADA and process control networks”. In: NISCC (2005).

[5] K. D. Gourley and D. M. Green. “Polygon-to-rectangle conversion algorithm.”In: IEEE CGA (1983), pp. 31–32.

[6] J. D. Guttman and A. L. Herzog. “Rigorous automated network securitymanagement”. In: IJIS 4.1-2 (2005), pp. 29–48.

[7] F. Harary and R. Z. Norman. “Some properties of line digraphs”. In:Rendiconti del Circolo Matematico di Palermo 9.2 (1960), pp. 161–168.

[8] C. D. Howe. What’s Beyond Firewalls? Forrester Research, Incorporated, 1996.

[9] H. Hu et al. “Flowguard: Building robust firewalls for software-definednetworks”. In: Proceedings of the third workshop on Hot topics in softwaredefined networking. ACM. 2014, pp. 97–102.

Page 14: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Bibliography (cont.)

[10] D. S. Johnson. “The NP-completeness Column”. In: ACM Transactions onAlgorithms 1.1 (July 2005), pp. 160–176. issn: 1549-6325. doi:10.1145/1077464.1077476. url:http://doi.acm.org/10.1145/1077464.1077476.

[11] A. X. Liu and M. G. Gouda. “Diverse firewall design”. In: Parallel andDistributed Systems, IEEE Transactions on 19.9 (2008), pp. 1237–1251.

[12] D. Ranathunga et al. “Identifying the Missing Aspects of the ANSI/ISA BestPractices for Security Policy”. In: 1st ACM Workshop on Cyber-PhysicalSystem Security (CPSS). ACM. 2015, pp. 37–48.

[13] D. Ranathunga et al. “Malachite: Firewall policy comparison, http://bandicoot.maths.adelaide.edu.au/public/PolicyComparison.pdf”. In:21st IEEE Symposium on Computers and Communications. 2016.

[14] A. Wool. “A quantitative study of firewall configuration errors”. In: Computer,IEEE 37.6 (2004), pp. 62–67.

[15] A. Wool. “Architecting the Lumeta Firewall Analyzer.” In: USENIX SecuritySymposium. 2001, pp. 85–97.

Page 15: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Firewall policy rule representation

pA(s) =

{s, if s ∈ A, // accept

φ, if s ∈ Ac , // deny .(1)

A ⊂ A where A={Atomic packet sequences}Only consider packet modifications that don’t effect otherrules (e.g., QoS, TTL changes)

no NAT, VPN functionalityno creation of packets by rules (e.g., logging)

Page 16: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Zone-Conduit policy snippet

Policy p0 { Z1 → Z2: https, dns;Z2 → Z1: http; }

Positive, explicit policies conditional on an implicit deny-allrule

Page 17: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Conduit-policy comparison

Definition (Equivalence)

Two policies pX and pY are equivalent on A iff pX (s) = pY (s),∀s ∈ A. We denote this equivalence by pX ≡ pY .

Definition (Inclusion)

A policy pX is included in pY on A iff pX (s) ∈ {pY (s), φ}, i.e., Xhas the same effect as Y on s, or denies s, for all s ∈ A. Wedenote inclusion by pX ⊂ pY .

Page 18: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Canonical policies

Lemma

Policies pX ≡ pY iff c(pX ) = c(pY ).

c : Φ→ Θ, where Φ is the policy space and Θ is the canonicalspace of policies

Page 19: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Canonicalisation of distinct rule sets of a policy

Policy polygon horizontally partitioned using a Polygon toRectangle conversion algorithm

Page 20: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Time complexity analysis of policy equivalence

algorithm component time complexity comments

cannonicalise policy O(n) n = policy countconstruct line digraph O(n2)derive SPs O(n2)check partitions are equal O(m2) m = equiv class countevaluate mappings O(

∏mi=1 ci !) ci = |ei |

Worse case time complexity: O(n!), best case: O(n2)

Page 21: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Semantic partitions

Definition

The semantic partition SP of a set of policies P is given bySP = {em} where P = ∪mem and the em ⊂ P are the minimalnumber of equivalence classes, i.e., for all pi , pj ∈ em we havepi ≡ pj .

Definition (plain)

[SP Equivalence and Inclusion] The semantic partitions SP1 andSP2 of policies P1 and P2, respectively, are equivalent iff|SP1| = |SP2| and ∀e1 ∈ SP1, ∃e2 ∈ SP2 such that for any p1 ∈ e1

and p2 ∈ e2, we have p1 ≡ p2. We denote this by SP1 ≡ SP2.Semantic partition SP1 includes SP2 iff ∀e2 ∈ SP2 ∃e1 ∈ SP1 s.t.e2 ⊂ e1. We denote this by SP2 ⊂ SP1.

Page 22: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Semantic difference

Definition

The semantic difference between policies pX and pY is given bypX − pY = (pX ⊕ pY )⊗ (pX ⊗ pY )c , where(pA)c = pAc and Ac is A’s complement.

Page 23: Malachite: Firewall Policy Comparison · Malachite: Firewall Policy Comparison ... Comparison of network policy: a simple example ... (2008), pp. 1237{1251.

Example SUC Zone-Conduit model