Let’s talk about routing security
How secure is our routing infrastructure in 2019?
Fundamentals of global routing
2
Fundamentals of global routing...
3
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Internet - Network of ASNs...
4
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Internet - Network of ASNs...
5
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Internet - Network of ASNs...(+ DNS!)
6
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
So how “trust” in the BGP works?
7
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Trust in the BGP...
8
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Filtering chain...
9
AS 1
AS 2
Upstream Provider
Customer Provider
I have 203.0.113.0/24!
Accept 203.0.113.0/24
ip prefix-list Customer-AS2 permit 203.0.113.0/24
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Filtering chain...
10
AS 1
AS 2
I have 203.0.113.0/24!
Accept 203.0.113.0/24 + 203.0.114.0/24
AS 3
I have 203.0.114.0/24!
ip prefix-list Customer-AS2 permit 203.0.113.0/24�ip prefix-list Customer-AS2 permit 203.0.114.0/24
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Trust in the BGP...
As per research data by Mr Geoff Huston (Scientist at APNIC) average AS path length in IPv4 world is around 5.7 and hence for a case like AS 1 <- AS2 <- AS3 <- AS4 <- AS5 it’s very hard for AS1 to what to allow for AS4 (learnt via AS2).
11
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
How does filtering works at the “Internet scale” ?
12
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
IRR
13
IRR - Internet Routing Registries
14
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
IRR - Route Object Example
whois -h whois.radb.net 216.218.128.0/17
route: 216.218.128.0/17�descr: Hurricane Electric� 55 South Market St� San Jose, CA�origin: AS6939�notify: noc@he.net�changed: noc@he.net 20170407�mnt-by: HE-NOC�source: RADB
15
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
IRR - Route Object Example
whois -h whois.radb.net 216.218.128.0/17
route: 216.218.128.0/17 <- Prefix �descr: Hurricane Electric� 55 South Market St� San Jose, CA�origin: AS6939 <- Origin AS�notify: noc@he.net�changed: noc@he.net 20170407�mnt-by: HE-NOC�source: RADB
16
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
IRR - AS SET Example
whois -h whois.radb.net AS-ACT
as-set: AS-ACT�descr: ACT-AS�country: IN�members: AS55577, AS131269, AS131219, AS18209,AS45196,AS24309,AS13335,AS138318�tech-c: TB103-AP�admin-c: AB208-AP�mnt-by: MAINT-IN-BEAMTELECOM�mnt-lower: MAINT-IN-BEAMTELECOM�last-modified: 2019-01-23T18:04:59Z�source: APNIC
17
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
More on Internet Routing Registries
18
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Query to RADB...
whois -h whois.radb.net 59.145.135.0/24
route: 59.145.135.0/24�descr: BHARTI-IN�descr: Bharti Airtel Limited�descr: Class A ISP in INDIA .�descr: 234 , OKHLA PHASE III ,�descr: NEW DELHI�descr: INDIA�country: IN�origin: AS9498�mnt-by: MAINT-IN-BBIL�changed: rar.data@airtel.in 20070814�source: APNIC
19
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Query to RADB...
whois -h whois.radb.net 59.145.135.0/24
route: 59.145.135.0/24�descr: BHARTI-IN�descr: Bharti Airtel Limited�descr: Class A ISP in INDIA .�descr: 234 , OKHLA PHASE III ,�descr: NEW DELHI�descr: INDIA�country: IN�origin: AS9498�mnt-by: MAINT-IN-BBIL�changed: rar.data@airtel.in 20070814�source: APNIC <- Shows the source database
20
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
bgpq3 - Tool for generating filters
21
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
bgpq3 - in action
bgpq3 -l Anurag AS58901 -6�no ipv6 prefix-list Anurag�ipv6 prefix-list Anurag permit 2402:b580::/32�ipv6 prefix-list Anurag permit 2402:b580:1::/48�ipv6 prefix-list Anurag permit 2402:b580:2::/48�ipv6 prefix-list Anurag permit 2402:b580:3::/48
bgpq3 -J -l Anurag AS58901 -6� policy-options {� replace:� prefix-list Anurag {� 2402:b580::/32;� 2402:b580:1::/48;� 2402:b580:2::/48;� 2402:b580:3::/48;� }� }
22
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
bgpq3 - in action
bgpq3 -l Anurag AS58901 -6�no ipv6 prefix-list Anurag�ipv6 prefix-list Anurag permit 2402:b580::/32�ipv6 prefix-list Anurag permit 2402:b580:1::/48�ipv6 prefix-list Anurag permit 2402:b580:2::/48 <- Cisco iOS style syntax�ipv6 prefix-list Anurag permit 2402:b580:3::/48
bgpq3 -J -l Anurag AS58901 -6� policy-options {� replace:� prefix-list Anurag {� 2402:b580::/32;� 2402:b580:1::/48; <- JunOS syntax� 2402:b580:2::/48;� 2402:b580:3::/48;� }� }
23
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
It’s querying RADB and formatting
whois -h whois.radb.net '!6as58901'�A66�2402:b580:1::/48 2402:b580:3::/48 2402:b580:2::/48 2402:b580::/32�C
More on this on RADB here: https://www.radb.net/query/help
24
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
So how well IRR based filtering works?
25
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
So how well IRR based filtering works? <- Not so well!
26
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Present statistics
27
Filtering Statistics across the Internet
28
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Indian Networks IRR Status
29
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Is there a real world problem here?
30
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Last “few” route leaks/hijacks
31
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Challenges with IRR based filtering
32
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Future
33
Some of developments in routing security...
34
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
RPKI in action...
router bgp 58901
address-family ipv4 unicast� neighbor 1.2.3.4 route-map Customer-IN in� bgp bestpath prefix-validate allow-invalid�!�route-map Customer-IN permit 10� match rpki invalid� set local-preference 50�!�route-map Customer-IN permit 20� match rpki not-found� set local-preference 100�!�route-map Customer-IN permit 30� match rpki valid� set local-preference 200�!�route-map Customer-IN permit 40
35
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
RPKI in action...
router bgp 58901
address-family ipv4 unicast� neighbor 1.2.3.4 route-map Customer-IN in� bgp bestpath prefix-validate allow-invalid�!�route-map Customer-IN permit 10� match rpki invalid� set local-preference 50 <- Low localpref on route if RPKI check is invalid (Remember: High localpref wins)�!�route-map Customer-IN permit 20� match rpki not-found� set local-preference 100 <- Mid level localpref on route is no ROA is present�!�route-map Customer-IN permit 30� match rpki valid� set local-preference 200 <- High localpref when RPKI check is valid and route is preferred�!�route-map Customer-IN permit 40
36
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Easy way to check IRR as well as RPKI for prefixes...
37
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Check for IRR / RPKI ROA validation
38
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Check for IRR / RPKI ROA validation
39
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Check for IRR / RPKI ROA validation
40
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Contribute in the cleanup!
41
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
How can you contribute?
42
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
References��
43
Anurag Bhatia - Hurricane Electric - Let’s talk about routing security - Rootconf 2019, Bangalore, India
Questions/Comments?
Anurag Bhatia, �Hurricane Electric (AS6939)�anurag@he.net�Twitter: @anurag_bhatia�Web: https://he.net