15
Firewalls Steven M. Bellovin https://www.cs.columbia.edu/~smb Matsuzaki ‘maz’ Yoshinobu <[email protected]> 1

firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

Firewalls

StevenM.Bellovinhttps://www.cs.columbia.edu/~smb

Matsuzaki ‘maz’Yoshinobu<[email protected]>

1

Page 2: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

What’saFirewall?

• Abarrierbetween“us”andtheInternet• Alltraffic,inboundoroutbound,mustpassthroughit

• Firewallsenforcepolicy:onlycertaintrafficisallowedtoflow

2

Page 3: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

insideandoutside

2-3-4.firewalls 3

• “good”users• thesamesecuritypolicy

• bad/untrustedusers

Inside OutsideFirewall

Page 4: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

WhyUseFirewalls?

• Firewallsareascalable solution:youdon’thavetomanagemanyboxes

• Firewallsareunderyourcontrol• Usualpurpose:keepattackersawayfrombuggycodeonhosts

• Generallyspeaking,firewallsarenot networksecuritydevices;they’rethenetwork’sresponsetobuggy,insecurehosts– Asuitablyhardenedhostisn’thelpedmuchbyafirewall

4

Page 5: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

Policies

• Firewallscanenforcepoliciesatanylayerofthenetworkstack

• Accept/rejectMACaddresses,IPaddresses,portnumbers,variousformsofapplicationcontent,etc.

• Policiesreflectorganizationalneeds– Generalphilosophy:accept“safe”,necessary traffic;rejectallelse

7 Application

6 Presentation

5 Session

4 Transport

3 Network

2 Link

1 Physical

5

Page 6: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

FirewallsImplementPolicy• Ifyoudonothaveasecuritypolicy,afirewallcan’thelpyou– Firewallsarenotmagicsecuritydevices– Simplyhavingonedoesn’tprotectyou;whatmattersisthepolicytheyenforce

• Ifthereisnosinglepolicyfortheentirenetwork,afirewalldoesn’tdomuchgood– Example:ISPnetworkscan’tbefirewalled,becauseeverycustomerhasdifferentsecurityneedsandpolicies

– But—theISP’sowncomputerscanbefirewalled

6

Page 7: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

failuremodels

2-3-4.firewalls 7

Firewall

• “good”and“bad”users• exceptionsandcomplexpolicy

Inside Outside

otherinternetconnections

Page 8: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

SomeSamplePolicyRules

• AllowinboundTCPport25(SMTP)destinedforthemailhost

• BlockandlogoutboundTCPport25unlessit’sfromtheauthorizedmailhost

• AllowoutboundTCPports80or443or…

AllowoutboundTCPports80or443onlyfromthedesignatedwebproxy

8

Page 9: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

CraftingPolicyRules

• Acomplexprocess:mustbalancebusinessneedsagainstnetworkthreats– Bothareconstantlychanging– Generally,nosinglepersonknowsbothwell

• It’seasytogetitwrong;boththepolicyanditsimplementationcanhaveerrors

• Iterativeprocess:deployasetofrules,andwatchforerrorsandcomplaints– Checkyourlogfilesandflowrecords!

9

Page 10: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

Topology

• Threeclassesofnets:untrusted(theoutside),trusted,andsemi-trusted(DMZ=“DemilitarizedZone”)

• Servicehosts—mail,DNS,web,etc.—gointheDMZ– Mostlyprotectedfromthe

outside,butnotfullytrustedbecauseofoutsideexposure

10

Inside

DMZ

Internet

Page 11: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

ImplementingFirewalls• AnyrouterorLinux/BSDhostcanfilteratlayers3and4

• Therealtroublesarehigherup:emailedviruses,infectedPDFs,webpageswithJavascript thatexploitsbrowserbugs,andmore

• Someprotocols,e.g.,FTPandSIP,can’tbehandledjustatthelowerlayers,becausetheyrequireotherportstobeopenedupdynamically

• Must haveapplicationproxiesformanyprotocols;eitherrulesormechanismsmustbeabletodiverttraffictotheseproxies

11

Page 12: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

TheTroublewithFirewalls

• Thereistoomuchconnectivitythatdoesn’tfitthesimplemodel– Speciallinkstocustomers,suppliers,jointventurepartners,contractors,etc.

– Verymanyconnectionstotheoutside– Branchoffices– Laptopsandsmartphones!

• Differentthreatmodels• Theclassicmodelofthefirewalldoesn’tworkthatwellanymoreforlargeorganizations

12

Page 13: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

MobileDevices

• Bydefinition,mobiledevicessometimesliveoutsidethefirewall

• Thisisnecessaryifpeoplearetogettheirjobsdone

• Buttheyhavetohaveinsideconnectivity(oratleastsensitiveinsidedata),too

• Risk:devicescanbecompromisedwhenoutside,andbringtheinfectionhome

• Risk:devicescanbestolen

13

Page 14: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

FirewallsandThreatModels

• Firewallsgenerally(butnotalways)deflectunskilledhackers

• Opportunistichackersmayormaynotbekeptout;theycanoftenpenetrateasingleinsidehostandworkfromthere

• Disgruntledemployeesarealreadyontheinside• Intelligenceagencieswon’tbekeptoutbysimpleschemes– TheNSAreputedlyhascannedtoolstoattackcommoncommercialfirewalls

14

Page 15: firewalls - start [APNIC TRAINING WIKI] · Firewalls Implement Policy •If you do not have a security policy, a firewall can’t help you –Firewalls are not magic security devices

WhattoDo?

• Multiplelayersofdefense– Large,enterprisefirewalltoprotectthecompany,completewithcentralservicehosts

– Departmentalfirewallstoisolateprinters,fileservers,etc.

– Hardenedhosts,plusautomatedtoolstomaintainthem

– Lotsofloggingandmonitoring

15