layer 2 security – no longer ignored security possibilities at layer 2

27
Layer 2 Security – No Longer Layer 2 Security – No Longer Ignored Ignored Security Possibilities at Layer 2 Security Possibilities at Layer 2 Allan Alton, Allan Alton, BSc CISA CISSP BSc CISA CISSP NetAnalyst NetAnalyst UBC UBC October 18, 2007 October 18, 2007

Upload: isaiah-myers

Post on 30-Dec-2015

17 views

Category:

Documents


0 download

DESCRIPTION

Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2. Allan Alton, BSc CISA CISSP NetAnalyst UBC October 18, 2007. Caveats and Assumptions. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

Layer 2 Security – No Longer IgnoredLayer 2 Security – No Longer IgnoredSecurity Possibilities at Layer 2Security Possibilities at Layer 2

Allan Alton, Allan Alton, BSc CISA CISSP NetAnalystBSc CISA CISSP NetAnalyst

UBCUBC

October 18, 2007October 18, 2007

Page 2: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

Caveats and AssumptionsCaveats and Assumptions

Opinions expressed are my own and do not Opinions expressed are my own and do not represent the views of UBC, my employer, represent the views of UBC, my employer, any vendor, or any organization to which I any vendor, or any organization to which I am associatedam associated

Internet Protocol (IP) implementation in a Internet Protocol (IP) implementation in a switched environment is assumedswitched environment is assumed

Familiarity with basic networking assumedFamiliarity with basic networking assumed

Control of user traffic, not management of Control of user traffic, not management of the network devicethe network device– Secure management of the switch is assumedSecure management of the switch is assumed

Page 3: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

Caveats and AssumptionsCaveats and Assumptions

Concepts are from a context of Cisco Concepts are from a context of Cisco Systems equipment, but sufficiently general Systems equipment, but sufficiently general to apply to other network hardware vendorsto apply to other network hardware vendors

Switch features are not available on all Switch features are not available on all product lines – check with your vendorproduct lines – check with your vendor

Remediations presented are possibilities not Remediations presented are possibilities not necessarily recommended best practisenecessarily recommended best practise

Test before implementation as bugs may be Test before implementation as bugs may be presentpresent

Page 4: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

AssertionAssertion

Intelligence built into the new Intelligence built into the new

generation of switches will generation of switches will

permit greater control of data permit greater control of data

as it enters your networkas it enters your network

Page 5: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

Application

Presentation

Session

Transport

Network

Data Link

Physical

Application

Presentation

Session

Transport

Network

Data Link

Physical

transmit

receive

GET /home.html HTTP/1.1 1024 TCP 80 192.168.1.100

10.11.12.13 00:04:05:06:07:0800:1A:1B:C3:87:25

OSI LayersOSI Layers

Page 6: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

Traditional Network SecurityTraditional Network Security

OSI Layers 3 and 4 where most network OSI Layers 3 and 4 where most network controls are implementedcontrols are implemented– e.g.,192.168.1.2 can only be contacted on e.g.,192.168.1.2 can only be contacted on

TCP port 80 from subnets beginning with TCP port 80 from subnets beginning with 172.16.172.16.

Firewall rules and router access listsFirewall rules and router access lists

Specialized devices now looking at layer 7Specialized devices now looking at layer 7

Page 7: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

Traditional Network SecurityTraditional Network Security

192.168.1.2 on TCP port 80

192.168.1.2 on TCP port 99

Fu

ll Access

Full

Acc

ess

Full Access

Fu

ll Access

Not Involved

Page 8: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

VulnerabilityVulnerabilityAttack within subnetAttack within subnet

Compromised machines can access Compromised machines can access others on the same VLAN by defaultothers on the same VLAN by default

Limited Access

Full Access

Full Access

Page 9: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

RemediationRemediationPrivate VLANsPrivate VLANs

PromiscuousPromiscuous:: talks to any porttalks to any port

IsolatedIsolated:: talks only to promiscuoustalks only to promiscuous

CommunityCommunity:: talks only to same community or talks only to same community or promiscuouspromiscuous

promiscuouspromiscuous isolatedisolated community Acommunity A community Bcommunity B

promiscuouspromiscuous YesYes YesYes YesYes YesYesisolatedisolated YesYes NoNo NoNo NoNocommunity Acommunity A YesYes NoNo YesYes NoNocommunity Bcommunity B YesYes NoNo NoNo YesYes

Page 10: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

RemediationRemediationProtected PortsProtected Ports

Simpler form of a Private VLANSimpler form of a Private VLAN– Protected:Protected: similar to Isolatedsimilar to Isolated– Not protected:Not protected: similar to Promiscuoussimilar to Promiscuous

Only applicable to the local switch howeverOnly applicable to the local switch however

protectedprotected not protectednot protected

protectedprotected NoNo YesYes

not protectednot protected YesYes YesYes

Page 11: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

RemediationRemediation Private VLANs or Protected PortsPrivate VLANs or Protected Ports

promiscuousor not protected

isolated or protected

Limited Access No Access

No Access

Page 12: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

VulnerabilityVulnerabilityBroadcast StormBroadcast Storm

All devices in VLAN / subnet must handle All devices in VLAN / subnet must handle broadcasts, consuming resources.broadcasts, consuming resources.

OS or application bugs may produce constant OS or application bugs may produce constant broadcasts. May also be malicious.broadcasts. May also be malicious.

broadcast storm

broadcastbusy handling

broadcasts

Page 13: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

RemediationRemediationStorm ControlStorm Control

Can apply to broadcasts, multicasts, or Can apply to broadcasts, multicasts, or unicastsunicasts

Set threshold as percentage of bandwidth Set threshold as percentage of bandwidth over a 1 second periodover a 1 second period

If threshold is exceeded, drop this type of If threshold is exceeded, drop this type of packet for next 1 second periodpacket for next 1 second period

Page 14: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

VulnerabilityVulnerabilityFlooding for Data Capture or Performance HitFlooding for Data Capture or Performance Hit

Switches flood to all ports when MAC unknownSwitches flood to all ports when MAC unknown

Switches learn MAC addresses at each portSwitches learn MAC addresses at each port

Table of addresses is a finite sizeTable of addresses is a finite size

Normal

starts macof or dsniff

address table full flood floodfloodnew

sourceMAC

Page 15: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

VulnerabilityVulnerabilityDHCP Denial of ServiceDHCP Denial of Service

Attacker requests new addresses for bogus MACsAttacker requests new addresses for bogus MACs

Finite number of DHCP addresses in a subnetFinite number of DHCP addresses in a subnet

PCs coming on the network can not get addressPCs coming on the network can not get address

startsDHCP Gobbler

no moreaddresses

no address

request

offer

Page 16: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

RemediationRemediationPort SecurityPort Security

Limits the source MAC addresses on a portLimits the source MAC addresses on a port

Can specify static addresses or maximum numberCan specify static addresses or maximum number

Violations on ports canViolations on ports can– disable portdisable port– send trap and syslogsend trap and syslog– continue forwarding; drop frames with new MACscontinue forwarding; drop frames with new MACs– continue forwarding; age out MAC entries from inactivitycontinue forwarding; age out MAC entries from inactivity

Page 17: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

VulnerabilityVulnerabilityDHCP Rogue ServerDHCP Rogue Server

Attacker uses rogue DHCP server to provide false Attacker uses rogue DHCP server to provide false settings (e.g., DNS, default gateway, etc.)settings (e.g., DNS, default gateway, etc.)

starts rogue DHCP server

provides true DHCP

bad DHCP information

badoffer

goodoffer

request

Page 18: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

RemediationRemediationDHCP SnoopingDHCP Snooping

Define trusted ports for DHCP responsesDefine trusted ports for DHCP responses

Trusted DHCPUntrusted DHCP

starts rogue DHCP server

badoffer

request

goodoffer gets good DHCP

information

Page 19: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

RemediationRemediationDHCP Snooping – other vulnerabilities coveredDHCP Snooping – other vulnerabilities covered

Comparison of MAC address in layers 2 and 7Comparison of MAC address in layers 2 and 7

– hardware address must match “chaddr” (client hardware hardware address must match “chaddr” (client hardware address) field in DHCP packet from untrusted portsaddress) field in DHCP packet from untrusted ports

– recall DHCP Gobbler attack and Port Securityrecall DHCP Gobbler attack and Port Security

Switch keeps track of the DHCP bindings to Switch keeps track of the DHCP bindings to prevent DoS release attacksprevent DoS release attacks

– DHCP releases or declines must have the hardware DHCP releases or declines must have the hardware address match the original bound addressaddress match the original bound address

Page 20: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

VulnerabilityVulnerabilitySpanning Tree Root HijackSpanning Tree Root Hijack

for Data Capture or Performance Hitfor Data Capture or Performance Hit

Spanning Tree Protocol resolves loopsSpanning Tree Protocol resolves loops

Bridge Protocol Data Units sent from switchesBridge Protocol Data Units sent from switches

Loops broken based on root selectionLoops broken based on root selection

sends BPDU root frames

becomes root bridge

STP block

connects to both switches

BPDU BPDU

Page 21: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

RemediationRemediationBPDU GuardBPDU Guard

BPDUs should not be received on an access portBPDUs should not be received on an access port

BPDU receipt may indicate unauthorized switch or BPDU receipt may indicate unauthorized switch or hub, or an attackhub, or an attack

BPDU receipt puts port into error disabled modeBPDU receipt puts port into error disabled mode

Page 22: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

VulnerabilityVulnerabilityARP Table PoisoningARP Table Poisoning

ARPs (Address Resolution Protocol) associate ARPs (Address Resolution Protocol) associate layer 3 addresses to layer 2 (IP to MAC)layer 3 addresses to layer 2 (IP to MAC)Requests are broadcastRequests are broadcastResponses unauthenticated and can be sent Responses unauthenticated and can be sent without a request (gratuitous)without a request (gratuitous)

Normal

starts ettercap

hijack

hijack

I am alsoRouterI amPC A

ARP tables poisoned

Page 23: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

RemediationRemediationDynamic ARP InspectionDynamic ARP Inspection

Validates against DHCP Snooping binding table (if Validates against DHCP Snooping binding table (if DHCP Snooping used)DHCP Snooping used)

Can build access lists of MAC and IP pairs for Can build access lists of MAC and IP pairs for non-DHCP environments or set port to be trustednon-DHCP environments or set port to be trusted

Can limit the rate of ARPs to prevent DoS attacksCan limit the rate of ARPs to prevent DoS attacks

Page 24: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

VulnerabilityVulnerabilityIP Address SpoofingIP Address Spoofing

Attacker sends packet with spoofed source IP Attacker sends packet with spoofed source IP addressaddressVictim’s response packet dies or goes to wrong Victim’s response packet dies or goes to wrong source (another victim)source (another victim)

source192.168.1.

1

dest. 192.168.1.1

Page 25: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

RemediationRemediationIngress Access ListIngress Access List

RFC 2827 normally done by router can be done RFC 2827 normally done by router can be done at layer 2 device closer to end deviceat layer 2 device closer to end device

Helps protect other devices on subnetHelps protect other devices on subnet

Source IP address should always be 0.0.0.0 for Source IP address should always be 0.0.0.0 for DHCP request or within subnet (DHCP request or within subnet (e.g., 207.206.205.xe.g., 207.206.205.x))

– Vulnerability: Attacker could still use another IP Vulnerability: Attacker could still use another IP address within that subnetaddress within that subnet

Page 26: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

RemediationRemediationIP Source GuardIP Source Guard

Based on DHCP Snooping — source IP address Based on DHCP Snooping — source IP address must be must be the onethe one listed in DHCP Snooping table. listed in DHCP Snooping table.

Can add static mappings for non-DHCP devicesCan add static mappings for non-DHCP devices

Can also check MAC address sourceCan also check MAC address source

source192.168.1.1

Page 27: Layer 2 Security – No Longer Ignored Security Possibilities at Layer 2

ConclusionConclusionAttack within subnetAttack within subnet

Broadcast stormBroadcast storm

MAC FloodingMAC Flooding

DHCP DoSDHCP DoS

DHCP rogueDHCP rogue

Spanning Tree hijackSpanning Tree hijack

ARP table poisoningARP table poisoning

IP address spoofingIP address spoofing

Private VLANsPrivate VLANs

Protected PortsProtected Ports

Storm ControlStorm Control

Port SecurityPort Security

DHCP SnoopingDHCP Snooping

BPDU GuardBPDU Guard

Dynamic ARP InspectionDynamic ARP Inspection

Anti-spoofing access listsAnti-spoofing access lists

IP Source GuardIP Source Guard

Further Reading: SAFE Layer 2 Security In-depth Version 2Further Reading: SAFE Layer 2 Security In-depth Version 2http://www.cisco.com/warp/public/cc/so/cuso/epso/sqfr/sfblu_wp.pdfhttp://www.cisco.com/warp/public/cc/so/cuso/epso/sqfr/sfblu_wp.pdf