APNIC Securing INternet Routing With RPKI
APNIC Securing INternet Routing With RPKI
2 v1.0
Acknowledgement
3 v1.0
Headlines
• bgpstream.com
4 v1.0
Headlines
§ Good:
• Only 6 peers (AS36692, AS4844, AS4775, AS23947, http://bgpstream.com/event/268261
§ Bad:
• Why weren’t the above 6 peers filtering inbound?
• Why didn’t Twitter create ROAs for their prefixes?
§ More detailed analysis: https://www.manrs.org/2021/02/did-someone-try-to-hijack-twitter-yes/
5 v1.0
Headlines
https://protonmail.com/blog/bgp-hijacking-september-2020/
https://rpki.cloudflare.com/?view=bgp&prefix=&asn=1221&validState=Invalid
6 v1.0
Headlines
https://blog.qrator.net/en/how-you-deal-route-leaks_69/
7 v1.0
Headlines
https://twitter.com/atoonk/status/1143143943531454464/photo/1
8 v1.0
Headlines
104.16.16.0/20
AS33154
[DQE] AS3356
[Level3]
104.16.16.0/21
104.16.24.0/21
104.16.16.0/20
AS396531
[ATI] AS13335
104.16.16.0/21
104.16.24.0/21
AS701
Internet
[Verizon]
9 v1.0
Headlines
q Its peers, like AS6939 (HE), shared these routes with 100s of their
own peers…
q The motive?
§ During the period, DNS servers in the hijacked range only responded to queries
for myetherwallet.com
§ Responded with addresses associated with AS41995/AS48693
10 v1.0
Headlines
11 v1.0
Headlines
12 v1.0
Why do we keep seeing these?
13 v1.0
Why do we keep seeing these?
14 v1.0
Why do we keep seeing these?
• Routing is VARIABLE
q The view of the network depends on where you are
§ Different routing outcomes at different locations
15 v1.0
Why do we keep seeing these?
16 v1.0
Why do we keep seeing these?
17 v1.0
Why should we worry?
18 v1.0
How do we address these?
19 v1.0
Current practice
LOA Check
20 v1.0
Tools & Techniques
LOA Check
Whois Letter of
IRR (RPSL)
(manual) Authority
21 v1.0
Tools & Techniques
• Look up whois
q verify holder of a resource
22 v1.0
Tools & Techniques
23 v1.0
Tools & Techniques
24 v1.0
Tools & Techniques
• IRR
q Helps auto generate network
(prefix/as-path) filters using RPSL tools
§ Filter out route advertisements not
described in the registry
25 v1.0
Tools & Techniques
26 v1.0
Tools & Techniques
27 v1.0
Back to basics – identify GOOD
28 v1.0
How about trust?
29 v1.0
RPKI Chain of Trust
Trust Anchor
Allocation Certificate
Hierarchy
Cert
(CA)
ARIN AFRINIC APNIC LACNIC RIPE-NCC
Cert
Certificate (CA)
chain NIR
mirrors the
allocation
Cert Cert Cert
hierarchy (EE)
Cert
(EE) (EE) (EE)
ISP ISP ISP ISP
30 v1.0
RPKI Chain of Trust
31 v1.0
RPKI profile ~ Resource Certificates
CA
RFC 3779 extensions – binds a list
Signed by parent’s private key
X.509 CERT •
of resources (IPv4/v6,ASN) to the
RFC 3779 subject of the certificate (private
EXTENSION key holder)
IP RESOURCES
(ADDRESS & ASN) • SIA (subject information access)
contains a URI that identifies the
SIA
(URI WHERE THIS PUBLISHES)
publication point of the objects
signed by the subject of the cert.
OWNER’S PUBLIC KEY
32 v1.0
Resource Certificates
q The resource certificate proves the holder of the private key (B) is
the legitimate holder of the number resource!
33 v1.0
Route Origin Authorization (ROA)
34 v1.0
Route Origin Authorization (ROA)
35 v1.0
What can RPKI do?
• Authoritatively proof:
q Who is the legitimate owner of an address, and
q Identify which ASNs have the permission from the holder to
originate the address
• Can help:
q prevent route hijacks/mis-origination/misconfiguration
36 v1.0
RPKI Components
APNIC
publication
RPKI Repository
Engine
rpki.apnic.net
MyAPNIC GUI
37 v1.0
RPKI Components
rsync/RRDP
IANA Repo
rpki.apnic.net
rsync/RRDP
APNIC RIPE Repo
Repo
rsync/RRDP RP
(RPKI Validated
rsync/RRDP Validator) Cache
LIR Repo LIR Repo
38 v1.0
RPKI Service Models
• Hosted model:
q The RIR (APNIC) runs the CA functions on members’ behalf
§ Manage keys, repo, etc.
§ Generate certificates for resource delegations
• Delegated model:
q Member becomes the CA (delegated by the parent CA) and operates
the full RPKI system
§ JPNIC, TWNIC, CNNIC (IDNIC in progress)
39 v1.0
Route Origin Validation (ROV)
2406:6400::/48
2406:6400::/48
65553 65552
40 v1.0
Route Origin Validation (ROV)
Global
(RPKI)
Repository
65551 65550 17821
ROA
rs 2406:6400::/32-48
yn
c/ 17821
RR 2406:6400::/48
DP
RPKI-to-Router 2406:6400::/48 65551 65550 17821 i Valid
(RTR)
2406:6400::/48 65553 65552 i Invalid
2406:6400::/32-48
Validator
17821
2406:6400::/48
65553 65552
41 v1.0
Route Origin Validation
42 v1.0
Validation States
• Valid
q the prefix (prefix length) and AS pair found in the database.
• Invalid
q prefix is found, but origin AS is wrong, OR
q the prefix length is longer than the maximum length
• Not Found/Unknown
q No valid ROA found
§ Neither valid nor invalid (perhaps not created)
43 v1.0
Validation States
BGP Routes
44 v1.0
Acting on Validation states
• Tag
q If you have downstream customers or run a route server (IXP)
q Ex:
[Valid (ASN:65XX0), Not Found (ASN:65XX1), Invalid (ASN:65XX2)]
• Drop Invalids
IPv4 ~ 6K
IPv6 ~ 1.5K
45 v1.0
Are ROAs enough?
46 v1.0
AS keys (per-router keys)
CA
APNIC Training
202.125.96.0/24
AS45192
Public Key
Cert
(CA)
Cert
202.125.96.0/24 Public Key Public Key
(CA) AS45192 Encodes
APNIC Training ASN and
Public Key ROA router ID
Router EE
202.125.96.0/24 Router EE
Router EE
AS45192
AS45192
rtr-00
AS45192
rtr-00
AS45192 rtr-00
Public Key
Public Key
Public Key
47 v1.0
BGPsec (RFC8205)
AS1 -> AS2
(Signed AS1)
AS2->AS3
(signed AS2) AS3
AS1 AS2
AS1 -> AS2
AS1 -> AS2
(Signed AS1) (Signed AS1)
AS2->AS4 AS4
(signed AS2)
• More HW resources
q CPU - high crypto overhead to validate signatures, and
q Memory
§ Updates in BGPsec would be per prefix
§ New attributes carrying signatures and certs/key IDs for every AS in the AS
path
49 v1.0
ASPA - AS Provider Authorization
50 v1.0
ASPA Validation/Verification ~ simplified
§ Else, INVALID
51 v1.0
RPKI Further Reading
52 v1.0
Implementation
53 v1.0
1. sign & publish your ROA
• Login MyAPNIC
§ Need to activate the RPKI engine to create ROAs
§ Go to Resources à Resource certification à RPKI (see image below)
54 v1.0
Create & publish your ROA
https://www.apnic.net/wp-content/uploads/2017/12/ROUTE_MANAGEMENT_GUIDE.pdf
55 v1.0
Create (publish) your ROA
56 v1.0
Create (publish) your ROA
57 v1.0
Create (publish) your ROA
58 v1.0
Create (publish) your ROA
59 v1.0
Create (publish) your ROA
60 v1.0
Check your ROA
https://rpki-validator.ripe.net/roas
61 v1.0
Check your ROA
https://rpki.cloudflare.com/
62 v1.0
Check your ROA
https://bgp.he.net/
63 v1.0
Check your ROA
64 v1.0
Check your ROA
65 v1.0
ROA Considerations
• Max-length
q Make sure the value covers your BGP announcements
• minimal ROAs
q Reduce spoofed origin-AS attack surface
§ https://tools.ietf.org/html/draft-ietf-sidrops-rpkimaxlen-03
§ ROAs should cover only those prefixes announced in BGP
66 v1.0
Rise (fall & rise) of Invalids L
ML - Invalids AS - Invalids
6000 2500
5000 2000
4000
1500
3000
1000
2000
1000 500
0 0
19
20
20
20
20
20
20
20
20
21
21
21
0
19
20
20
20
20
20
20
20
20
21
21
21
0
'2
'2
c'
n'
b'
y'
g'
p'
t'
v'
c'
n'
b'
r'
c'
n'
b'
y'
g'
p'
t'
v'
c'
n'
b'
r'
ly
ly
De
Ja
Fe
Ma
Au
Se
Oc
No
De
Ja
Fe
Ma
De
Ja
Fe
Ma
Au
Se
Oc
No
De
Ja
Fe
Ma
Ju
Ju
IPv4 IPv6 IPv4 IPv6
https://blog.apnic.net/2020/04/10/rise-of-the-invalids/
67 v1.0
2. Run (your own) RPKI Validator
• Lots of options:
q Dragon Research RPKI toolkit - https://github.com/dragonresearch/rpki.net
q Routinator - https://github.com/NLnetLabs/routinator/releases/tag/v0.8.3
68 v1.0
Validator considerations
69 v1.0
Validator considerations
70 v1.0
3. Router Configuration (IOS)
71 v1.0
Configuration (IOS)
72 v1.0
Configuration (IOS)
73 v1.0
3. Router Configuration (JunOS)
routing-options {
autonomous-system 131107;
validation {
group rpki-validator {
session <validator-IP> {
refresh-time 120;
port <323/3323/8282>;
local-address X.X.X.253;
}
}
}
}
74 v1.0
Configuration (JunOS)
75 v1.0
Router Configuration (JunOS)
protocols {
bgp {
group external-peers { group external-peers-v6 {
#output-ommitted #output-ommitted
neighbor X.X.X.1 { neighbor X6:X6:X6:X6::1 {
import ROUTE-VALIDATION; import ROUTE-VALIDATION;
family inet { family inet6 {
unicast; unicast;
} }
} }
} }
}
76 v1.0
RPKI Verification (IOS)
77 v1.0
RPKI Verification (IOS)
78 v1.0
RPKI Verification (IOS)
79 v1.0
Check routes (IOS)
#sh bgp ipv4 unicast 202.144.128.0/19
BGP routing table entry for 202.144.128.0/19, version 3814371
Paths: (1 available, best #1, table default)
Advertised to update-groups:
2
Refresh Epoch 15
4826 17660
49.255.232.169 from 49.255.232.169 (114.31.194.12)
Origin IGP, metric 0, localpref 110, valid, external, best
Community: 4826:5101 4826:6570 4826:51011 24115:17660
path 7F50C7CD98C8 RPKI State valid
rx pathid: 0, tx pathid: 0x0
80 v1.0
RPKI Verification (JunOS)
81 v1.0
RPKI Verification (JunOS)
----------
2001:200::/32-32 2500 202.125.96.46 valid
2001:200:136::/48-48 9367 202.125.96.46 valid
2001:200:900::/40-40 7660 202.125.96.46 valid
2001:200:8000::/35-35 4690 202.125.96.46 valid
2001:200:c000::/35-35 23634 202.125.96.46 valid
2001:200:e000::/35-35 7660 202.125.96.46 valid
82 v1.0
RPKI Verification (JunOS)
IPv4 records: 2
IPv6 records: 1
83 v1.0
Check routes (JunOS)
84 v1.0
Propagating RPKI states to iBGP peers
0x4300:0:0
0x4300:0:1
0x4300:0:2
§ Sender (one with RTR session) attaches the extended community to Updates, and receiver derives
the validation states from it
§ Must be enabled on both sender and receiver!
85 v1.0
Propagating RPKI states (IOS)
86 v1.0
Propagating RPKI states (IOS)
§ If announce rpki state is not configured for the neighbor, all prefixes received
from the iBGP neighbor will be marked VALID!
87 v1.0
Propagating RPKI states (JunOS)
88 v1.0
Propagating RPKI states (JunOS)
policy-statement ROUTE-VALIDATION-1 {
term valid {
from community origin-validation-state-valid;
then validation-state valid;
}
term invalid {
from community origin-validation-state-invalid;
then validation-state invalid;
}
term unknown {
from community origin-validation-state-unknown;
then validation-state unknown;
}
89 v1.0
Operational Considerations
• Default routes?
q will match anything - Invalids
90 v1.0
Operational Considerations
91 v1.0
Other developments
92 v1.0
Other developments
• Prop-132:
q AS-0 ROA for unallocated/unassigned APNIC space
93 v1.0
IN Focus (as of 2021/03/30)
NOT FOUND
IPv6:
APNIC ARIN RIPE AFRINIC LACNIC IRINN CNNIC AS17488: 1376
AS38266: 784
AS9829: 485
IPv4 9778 997 160 22 4 10819 1 IPv4:
~ 21779
AS17488: 1207
IPv6 1725 85 12 2196 ~ 4018 AS9498: 1185
AS24560: 1099
94 v1.0
https://www.apnic.net/community/security/resource-certification/#routing
95 v1.0
Any questions?
96 v1.0