56
RPKI Introduction 1 APNIC Technical Workshop July 5-6, 2018 in Beijing, China. Hosted By:

RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

RPKI Introduction

1

APNIC Technical Workshop July 5-6, 2018 in Beijing, China.

Hosted By:

Page 2: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Content

• Why do we need RPKI• What is RPKI• How to deploy RPKI• Configuration case

Page 3: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Misdirection / Hijacking Incidents

• YouTube Incident– Occurred 24 Feb 2008 (for about

2 hours)– Pakistan Telecom announced YT

block

3

• Google (AS15169) services downed– Occurred 5 Nov 2012 (for 30 minutes)– Moratel Indonesia (AS23947)

https://blog.cloudflare.com/why-google-went-offline-today-and-a-bit-about/

Page 4: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Indonesia Hijacks

• On 3rd April 2014, Indosat (AS4761) leaked over 320,000*routes within a 2-hour period

• Disrupted Akamai• Self-inflicted DDoS attack

4

https://dyn.com/blog/indonesia-hijacks-world/

Page 5: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Telekom Malaysia

• On June 12, 2015, Telekom Malaysia (AS4788) tweets thisthen breaks the Internet

• It announced 179,000 prefixes to Level 3 (AS3549)

5

https://bgpmon.net/massive-route-leak-cause-internet-slowdown/

Page 6: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Cyber Criminals exploiting thevulnerability• BGP Hijacking for Cryptocurrency Profit (2014)

– http://www.secureworks.com/cyber-threat-

intelligence/threats/bgphijacking-for-cryptocurrency-profit/

• Spamhaus DDoS Attack (2013)

– http://www.bgpmon.net/looking-at-the-spamhouse-ddos-from-a-

bgpperspective/

• Detecting BGP Attacks in 2014

– https://pacsec.jp/psj14/PSJ2014_Guillaum_presentation.pdf

6

Page 7: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

How we address this…

• A network should only originate his own prefix– How do we verify & avoid false advertisement?

• A provider should filter prefixes they propagate fromcustomers– Transitive trust; BGP is a trust-based system– Check the legitimacy of address (LoA)– Passive Countermeasure

• Strict filter on Interconnection– BGP router can filter in UPDATE Messages– Useful filtering can be done by upstream provider

• Automate Filter Maintenance– Use the Route Object

7

Page 8: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

What is RPKI?

8

RPKI

• Resource Pubic Key Infrastructure

Page 9: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

What does it solve?

• Prevents route hijacking– A prefix originated by an AS without authorization due to malicious

intent

• Prevents mis-origination– A prefix that is mistakenly originated by an AS which does not own it– Also route leakage– due to configuration mistake or fat finger

9

Page 10: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

How does it work?

Is this AS number (ASN) authorized to announce this IP address range?

10

Page 11: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

RPKI Origin Validation

11

2001:db8::/32

Network Next Hop AS_PATH Age AttrsV*> 2001:db8::/32 2001:df2:ee00::1 65531 65533 65535 05:30:49 [{Origin: i}]

65530

65533

64512

65535

2001:db8:ab::1

655322001:db8::/32

I > 2001:db8::/32 2001:df2:ee11::1 65530 65420 06:30:49 [{Origin: i}]

65531

6542065534

Page 12: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

RPKI Implementation

• Two RPKI implementation type– Delegated: Each participating node becomes a CA and runs their

own RPKI repository, delegated by the parent CA.– Hosted: The RIR runs the CA functionality for interested participants.

Page 13: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Two Components

• Certificate Authority (CA)– Internet Registries (RIR, NIR, Large LIR)– Issue certificates for customers– Allow customers to use the CA’s GUI to issue ROAs for their prefixes

• Relying Party (RP)– Software which gathers data from CAs

Page 14: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Issuing Party

• Internet Registries (RIR, NIR, Large LIRs)

• Acts as a Certificate Authority and issues certificates for customers

• Provides a web interface to issue ROAs for customer prefixes

• Publishes the ROA records

APNIC RPKI Engine

publication

MyAPNIC GUI

rpki.apnic.netRepository

Page 15: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Relying Party (RP)

IANA Repo

APNIC Repo

RIPE Repo

LIR Repo

LIR Repo

RP Cache(gather) Validated

Cache

RPKI-Rtr Protocol

rpki.ripe.net

Software which gathers data from CAsAlso called RP cache or validator

rpki.apnic.net

Page 16: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

RPKI Building Blocks

1. Trust Anchors (RIR’s)2. Route Origination Authorizations (ROA)3. Validators

Page 17: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

1. PKI & Trust Anchors

Page 18: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Public Key Concept

• Private key: This key must be known only by its owner.• Public key: This key is known to everyone (it is public)• Relation between both keys: What one key encrypts, the

other one decrypts, and vice versa. That means that if you encrypt something with my public key (which you would know, because it's public :-), I would need my private key to decrypt the message.

• Same alike http with SSL aka https

Page 19: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

RPKI Profile

Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of IP resources

(IPv4 addresses, IPv6 addresses and AS Numbers) [RFC3779]

X.509 Cert

RFC 3779Extension

Describes IPResources (Addr & ASN)

SIA – URI for where this Publishes

Owner’s Public Key

CA

Sig

ne

db

y P

are

nt’s P

riva

te K

ey

X.509 Certificates 3779 EXT

Page 20: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Trust Anchor

Source : http://isoc.org/wp/ietfjournal/?p=2438

IANA

AFRINIC RIPE NCC ARIN APNIC LACNIC

NIR NIR

ISP ISP ISP ISP ISP

Trust Anchor CertificateResourceAllocationHierarchy

Issued Certificates

matchallocation actions

Page 21: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

RPKI Chain of Trust

• The RIRs hold a self-signed root certificate for all the resources that they have in the registry– They are the trust anchor for the system

• That root certificate is used to sign a certificate that lists your resources

• You can issue child certificates for those resources to your customers– When making assignments or sub allocations

Page 22: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

2. ROA

Page 23: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Route Origination Authorizations (ROA)• A ROA is a digitally signed object that provides a means

of verifying that an IP address block holder has authorized an Autonomous System (AS) to originate routes to one or more prefixes within the address block.

• With a ROA, the resource holder is attesting that the origin AS number is authorized to announce the prefix(es). The attestation can be verified cryptographically using RPKI.

Page 24: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Route Origination Authorizations (ROA)• Next to the prefix and the ASN which is allowed to

announce it, the ROA contains:– A minimum prefix length– A maximum prefix length– An expiry date– Origin ASN

• Multiple ROAs can exist for the same prefix• ROAs can overlap

Page 25: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Create ROA

25

Page 26: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

3. Validators

Page 27: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Origin Validation

• Router gets ROA information from the RPKI Cache– RPKI verification is done by the RPKI Cache

• The BGP process will check each announcement with the ROA information and label the prefix

Validated RPKI Cache

RPKI to RTR protocol

Page 28: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Result of Check

• Valid – Indicates that the prefix and AS pair are found in the database.

• Invalid – Indicates that the prefix is found, but either the corresponding AS received from the EBGP peer is not the AS that appears in the database, or the prefix length in the BGP update message is longer than the maximum length permitted in the database.

• Not Found / Unknown– Indicates that the prefix is not among the prefixes or prefix ranges in the database.

Valid > Unknown > Invalid

Page 29: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

ROA Example – IPv4

Prefix: 10.0.0.0/16ASN: 65420

ROA 65420 10.0.0.0/16 /18

Origin AS Prefix Max Length

VALID AS65420 10.0.0.0/16

VALID AS65420 10.0.128.0/17

INVALID AS65421 10.0.0.0/16

INVALID AS65420 10.0.10.0/24

UNKNOWN AS65430 10.0.0.0/8

Page 30: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Local Policy

• You can define your policy based on the outcomes– Do nothing– Just logging– Label BGP communities– Modify preference values– Rejecting the announcement

Page 31: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

ROV Deployment - CRIX

• First stage -> Only tagging valid, invalid and not found prefixes with BGP communities

• Currently (since 2015):– Discarding invalids at route server.– IX members only get valid and not found prefixes.

– Not found prefixes are marked with a BGP community.

– Periodic manual checks of invalid prefixes, letting members know when they are announcing an invalid route so that they fix it.

– Quarantine for new members (before traffic is enabled in the production environment) involves announced prefixes revision to make sure the corresponding ROAs have been created.

31

Page 32: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

RPKI Caveats

• When RTR session goes down, the RPKI status will be not found for all the bgp route after a while – Invalid => not found – we need several RTR sessions or care your filtering policy

• In case of the router reload, which one is faster, receiving ROAs or receiving BGP routes? – If receiving BGP is much faster than ROA, the router propagate the

invalid route to others – We need to put our Cache validator within our IGP scope

Page 33: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

In summary

• As an announcer/LIR– You choose if you want certification– You choose if you want to create ROAs– You choose AS, max length

• As a Relying Party– You can choose if you use the validator– You can override the lists of valid ROAs in the cache, adding or

removing valid ROAs locally– You can choose to make any routing decisions based on the results

of the BGP Verification (valid/invalid/unknown)

Page 34: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

ROV Deployment

• NAP.Ec (the Ecuatorian IXP)– Doing ROV and discarding invalid routes (Since 2 or 3 years ago)

• CRIX (The Costarican IXP)– Doing ROV since 2015

• RENATA (Colombian Academic Network)– They have recently set up ROV– Just tagging traffic and not making any routing decision yet as they

are seeing too many invalid routes

34

Page 35: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

RPKI Further Reading

• RFC 5280: X.509 PKI Certificates• RFC 3779: Extensions for IP Addresses and ASNs

• RFC 6481-6493: Resource Public Key Infrastructure

Page 36: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

RPKI Configuration

Page 37: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

RPKI Configuration

• Resources:– AS : 131107 [APNICTRAINING-DC]– IPv4 : 202.125.96.0/24– IPv6: 2001:df2:ee00::/48

• Process– Create ROA– Setup cache validation server– Validate the ROA

Page 38: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Implementation Scenario

• {bgp4} Routers validate updates from other BGP peers

• {rtr} Caches feeds routers using RTR protocol with ROA information

• {rsync} Caches retrieves and cryptographically validates certificates & ROAs from repositories

ASBR

{rtr}

DNS

Trust Anchors

DNS

Trust AnchorsDNS

Trust Anchors

DNS

RPKI Cache Validator

{rsync}{bgp4}

repository

upstream

Page 39: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Phase I: Create ROA

• APNIC member– Create ROA in MyAPNIC

• CNNIC member– Create ROA in your member portal

39

Page 40: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Phase I - Check your ROA

# whois -h whois.bgpmon.net 2001:df2:ee00::/48

Prefix: 2001:df2:ee00::/48Prefix description: APNICTRAINING-DCCountry code: AUOrigin AS: 131107Origin AS Name: ASN for APNICTRAINING LAB DCRPKI status: ROA validation successfulFirst seen: 2016-06-30Last seen: 2017-01-03Seen by #peers: 160

Page 41: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Phase I - Check your ROA

# whois -h whois.bgpmon.net " --roa 131107 2001:df2:ee00::/48"

0 – Valid------------------------ROA Details------------------------Origin ASN: AS131107Not valid Before: 2016-09-07 02:10:04Not valid After: 2020-07-30 00:00:00 Expires in 3y208d1h39m28.7999999821186sTrust Anchor: rpki.apnic.netPrefixes: 2001:df2:ee00::/48 (max length /48) 202.125.96.0/24 (max length /24)

Page 42: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Phase I – Global ROA Stats

42

http://certification-stats.ripe.net/ 20180622

Page 43: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Phase II - RPKI Validator

• Two options:

A. RIPE NCC RPKI Validator• https://www.ripe.net/manage-ips-and-asns/resource-

management/certification/tools-and-resources

B. Dragon Research Labs RPKI Toolkit• https://github.com/dragonresearch/rpki.net

Page 44: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Phase II - RPKI Validator

A. RIPE NCC RPKI Validator• Download RPKI Validator

– http://www.ripe.net/lir-services/resource-management/certification/tools-and-resources

• Installation# tar -zxvf rpki-validator-app-2.24-dist.tar.gz# cd rpki-validator-app-2.24# ./rpki-validator.sh start

Page 45: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Phase II - RPKI Validator

A. RIPE NCC RPKI Validatorhttp://rpki-validator.apnictraining.net:8080/

Page 46: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Phase II - RPKI Validator

B. Dragon Research Labs RPKI Toolkit

• Installation process in Ubuntu Xenial 16.04– https://github.com/dragonresearch/rpki.net/blob/master/doc/quickstart

/xenial-rp.md• Installation

# wget -q -O /etc/apt/sources.list.d/rpki.list https://download.rpki.net/APTng/rpki.xenial.list# wget -q -O /etc/apt/trusted.gpg.d/rpki.asc https://download.rpki.net/APTng/apt-gpg-key.asc# apt update# apt install rpki-rp

Page 47: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Phase II - RPKI Validator

B. Dragon Research Labs RPKI Toolkit

http://rpki-dragonresearch.apnictraining.net/rcynic/

Page 48: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Phase III - Router Configuration (JunOS)

http://pastebin.com/50bmnv9F

Page 49: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Phase III - Router Configuration (IOS)

http://pastebin.com/p30nWu0R

Page 50: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Phase III - Router Configuration (GoBGP)

http://pastebin.com/DwQbdq7A

Page 51: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Check your prefix

rpki-junos>show route protocol bgp 202.125.96.46/24

202.125.96.0/24 *[BGP/170] 3w5d 16:57:33, MED 0, localpref 110AS path: 3333 4608 131107 I, validation-state: verified

> to 193.0.19.254 via xe-1/3/0.0

• Junos

Page 52: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Check your prefix

rpki-ios>show ip bgp 202.125.96.0/24

BGP routing table entry for 202.125.96.0/24, version 70470025Paths: (2 available, best #2, table default)

Not advertised to any peerRefresh Epoch 13333 1273 4637 1221 4608 131107

193.0.19.254 from 193.0.3.5 (193.0.0.56)Origin IGP, localpref 110, valid, externalCommunity: 83449328 83450313path 287058B8 RPKI State valid

• IOS

Page 53: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Check your prefix

fakrul@gobgp:~$ gobgp global rib 202.125.96.0/24

Network Next Hop AS_PATH Age Attrs

V*> 202.125.96.0/24 202.12.29.113 4608 1221 4826 131107 00:13:29 [{Origin: i} {Med: 0} {LocalPref: 110} {Communities: 4608:11101}]

• GoBGP

Page 54: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Commands

• Check session status of cache validator server

show validation session detail

show bgp ipv4 unicast rpki servers

gobgp rpki server

JunOS

IOS

GoBGP

show validation database

show bgp ipv4 unicast rpki table

gobgp rpki table

JunOS

IOS

GoBGP

• Full validation database

Page 55: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Acknowledgements

• Fakrul Alam• Tom Harrison (APNIC)• Sofia Silva Berenguer (APNIC)

55

Page 56: RPKI · 2018. 6. 22. · RPKI Profile Certificates are X.509 certificates that conform to the PKIX profile [PKIX]. They also contain an extension field that lists a collection of

Thank you!

56