SlideShare a Scribd company logo
Jimmy Lim TWNOG 3
jhalim@cloudflare.com Taipei, 21 June 2019
BGP filtering best practice
Cloudflare in a glance
Protect and accelerate any website online
● Direct visitors to nearest entry point
○ Fast
■ Lesser hops
■ Reduced latency
● Save bandwidth
○ Lesser requests to origin
○ Mitigate DDoS
● Resiliency
○ 150+ locations
BGP filtering best practice
AS Path vs Prefix filtering
Different type of inbound filtering
● No filtering?
○ No inbound policy filtering
○ Not acceptable
● AS path filtering
○ Filtering based on AS path - a series of autonomous system (AS) numbers
with originator’s AS number at the end of the path
○ Using regular expression
● Prefix filtering
○ Filtering based on the matching prefixes defined in the prefix list or route
filter
Many local IXPs are still doing AS path filtering
● Allow all prefixes that are originated by the ASN
○ No proper validation
● Prone to accidental/wrong announcement
● High risk of prefix hijacking and blackholing
Sample of bad thing about AS Path filtering
ISP/IXP
AS65501
Originate 10.0.0.0/24
AS_PATH _65501$
Send packet to 10.0.0.1
Hijacking routerLegitimate router
AS65001
Originate 10.0.0.0/23
Sample of bad thing about AS Path
● What is so bad about the previous example?
permit _65501$
● That implies accept any prefixes that are originated by AS65501
○ High chance to create accidental hijacking
○ High risk to hijack or blackhole maliciously
Another sample of bad thing about AS Path
filtering
● RTBH feature by ISP/IXPs
○ Allow customers or participants to
remotely trigger blackhole to prefixes
under their own ASN
■ eBGP multihop blackhole peering with ISPs
■ Direct transit BGP session
■ Using ISP/IXPs blackhole BGP community
○ Accept up to /32
Internet ISPCustomer router
ISPCustomer router
eBGP multihop
IXP
Participants
Why AS Path filtering still exist?
● Difficult to maintain prefix filter
○ Troublesome to validate
● No expertise to configure, too complex?
● IXPs reluctant to do strict filtering
○ Not able to attract all traffic
■ Participants do not update filter regularly/properly
Prefix list filtering
● Prefix based filtering
○ More validation is done
● Allow up to /24 for IPv4 prefix
● Allow up to /48 for IPv6 prefix
● Automatic update via IRR database
IRR and RPKI
Internet Routing Registry
● Globally distributed routing information database
○ Ensure stability and consistency of Internet-wide routing
○ Sharing information between network operators
● Why use IRR?
○ Route filtering
○ Network troubleshooting
○ Router configuration
○ Global view of Internet routing
● List of IRRs
○ http://www.irr.net/docs/list.html
AS-SET information in IRR
as-set: AS-CLOUDFLARE
descr: Cloudflare, Inc
members: AS13335
members: AS3557, AS21556
members: AS132892, AS133877
members: AS202623, AS203898
members: AS394536, AS395747, AS14789
mnt-by: MNT-CLOUD14
source: ARIN
Route object information in IRR
route: 1.1.1.0/24
descr: Cloudflare, Inc.
origin: AS13335
mnt-by: MNT-CLOUD14
notify: rir@cloudflare.com
remarks: ---------------
remarks: All Cloudflare abuse reporting can be done via
remarks: https://www.cloudflare.com/abuse
remarks: ---------------
source: ARIN
Automation to generate prefix filter
IRRs have a very loose security model
● Some database maintainers do not check the authenticity of
the entry
○ Records exist within IRRs can be wrong and/or missing
● There are lots of IRRs
○ Mirrors are not always up to date
● No cryptographic signing of records
● Let’s talk about RPKI
Resource Public Key Infrastructure
● Cryptographic method of signing records
● Regional Internet Registry (RIR) has a root certificate
○ Generate a signed certificate for Local Internet Registry (network operator)
■ All resources they are assigned with (IPs and ASNs)
● LIR then signs the prefix containing origin AS that they intend to
use
○ ROA (Route Object Authorization) is created
Resource Public Key Infrastructure
Resource Public Key Infrastructure
Signing prefixes
● Each LIRs own and manage Internet resources has access to
RIR portal
○ Signing their prefixes through the portal or API of their RIR is the easisest
way to start with RPKI
● Cloudflare has resources in each of the 5 RIR regions
○ About 800 pefixes announcement over different ASNs
○ We need to ensure the first step is done
Automation to create ROA
Enforcing validated prefixes
● Signing the prefixes is one thing
● Ensuring the prefixes we receive match their certificates is
another
● Validation is done by synchronizing the RIR databases of ROAs
○ Check the signature of every ROA against the RIR’s certification public key
○ Once valid records are known, it is sent to the routers
● Major vendors support a protocol called RPKI to Router
Protocol (RTR)
○ A simple protocol for passing a list of valid prefixes with their origin ASN and
expected mask length
RPKI to Router Protocol is insecure
● Vendors implement
the insecure
transport methods
● Routes sent in clear
text over TCP can be
tampered with
Introducing GoRTR
● A lightweight local RTR
server
● Distribute it via our own
Content Delivery Network
● Fetch the cache file over
HTTPS and pass the routes
over RTR
Cloudflare enforcing validated prefixes
Cloudflare enforcing validated prefixes
Summary
Wrapping up
● No filtering and AS Path filtering is not acceptable
● Prefix filtering via IRR automation is required
○ Challenge to have this applied in all IXPs
● RPKI is not a replacement yet for IRR
○ Not many has signed their prefixes
○ Not many has enforced validating the prefixes
● Implementing RPKI is achivable
○ Plenty of efforts are needed
○ It is not a bullet proof solution on securing the routing in Internet, but the
impact of BGP attacks will be greatly reduced
Q&A
BGP filtering best practice

More Related Content

PDF
BSides: BGP Hijacking and Secure Internet Routing
PDF
RPKI Overview, Case Studies, Deployment and Operations
PDF
Route Hijaking and the role of RPKI
PDF
BKNIX Peering Forum 2017: Community tools to fight DDoS
PDF
PacNOG 29: Routing security is more than RPKI
PDF
VNIX-NOG 2021: IPv6 Deployment Update
PDF
SANOG 34: Securing Internet Routing
BSides: BGP Hijacking and Secure Internet Routing
RPKI Overview, Case Studies, Deployment and Operations
Route Hijaking and the role of RPKI
BKNIX Peering Forum 2017: Community tools to fight DDoS
PacNOG 29: Routing security is more than RPKI
VNIX-NOG 2021: IPv6 Deployment Update
SANOG 34: Securing Internet Routing

What's hot (20)

PDF
mnNOG 1: Securing internet Routing
PDF
A week with analysing RPKI status
PDF
IDNOG 6: RQC and RPKI
PDF
Resource Public Key Infrastructure (RPKI)
PDF
BGPalerter: BGP prefix monitoring
PDF
Rolling the Root Zone DNSSEC Key Signing Key
PDF
IPv6 Deployment Case on a Korean Governmental Website
PDF
RPKI Deployment Status in Bangladesh
PDF
Prefix Filtering BCP
PDF
Route Origin Validation With Routinator - A MANRS Approach for Operators
PDF
SANOG 34: Internet number registry services - the next generation
PDF
RPKI Deployment Status in Bangladesh
PPTX
Proof of Transit: Securely Verifying a Path or Service Chain
PDF
Community tools to fight against DDoS
PDF
RPKI (Resource Public Key Infrastructure)
PDF
The Next Generation Internet Number Registry Services
PDF
pfSense firewall workshop guide
PPTX
32nd TWNIC IP OPM: ROA+ROV deployment & industry development
PDF
Community tools to fight against DDoS, SANOG 27
PPTX
Part 10 : Routing in IP networks and interdomain routing with BGP
mnNOG 1: Securing internet Routing
A week with analysing RPKI status
IDNOG 6: RQC and RPKI
Resource Public Key Infrastructure (RPKI)
BGPalerter: BGP prefix monitoring
Rolling the Root Zone DNSSEC Key Signing Key
IPv6 Deployment Case on a Korean Governmental Website
RPKI Deployment Status in Bangladesh
Prefix Filtering BCP
Route Origin Validation With Routinator - A MANRS Approach for Operators
SANOG 34: Internet number registry services - the next generation
RPKI Deployment Status in Bangladesh
Proof of Transit: Securely Verifying a Path or Service Chain
Community tools to fight against DDoS
RPKI (Resource Public Key Infrastructure)
The Next Generation Internet Number Registry Services
pfSense firewall workshop guide
32nd TWNIC IP OPM: ROA+ROV deployment & industry development
Community tools to fight against DDoS, SANOG 27
Part 10 : Routing in IP networks and interdomain routing with BGP
Ad

Similar to BGP filtering best practice (20)

PDF
PCTA e-Tech Show 2021: Securing Internet Routing
PDF
IAA Life in Lockdown series: Securing Internet Routing
PPTX
Rpki -manrs_(7_september)
PDF
npNOG 5: Securing Internet Routing
PDF
Securing BGP with RPKI - Ondřej Caletka, RIPE NCC
PDF
HKNOG 9.0: (the trouble with) Securing Internet Routing
PDF
Routing Security Roadmap
PPTX
Resource Public Key Infrastructure - A Step Towards a More Secure Internet Ro...
PDF
Rpki with rpki.net tools
PDF
Routing Security
PDF
Introduction to RPKI by Sheryl (Shane) Hermoso
PDF
Introduction to RPKI - MyNOG
PDF
ThaiNOG Day 2021: Thailand's Route Validity
PDF
NZNOG 2022: Routing Security
PPTX
HKNOG 7.0: RPKI - it's time to start deploying it
PDF
VNIXNOG 2019: Securing Internet Routing
PDF
LkNOG 3: Securing Internet Routing
PPTX
ICANN APAC-TWNIC Engagement Forum: Internet Number Registry Services - The Ne...
PDF
PLNOG14: Quo Vadis RPKI - Andrzej Wolski
PDF
MANRS for Network Operators
PCTA e-Tech Show 2021: Securing Internet Routing
IAA Life in Lockdown series: Securing Internet Routing
Rpki -manrs_(7_september)
npNOG 5: Securing Internet Routing
Securing BGP with RPKI - Ondřej Caletka, RIPE NCC
HKNOG 9.0: (the trouble with) Securing Internet Routing
Routing Security Roadmap
Resource Public Key Infrastructure - A Step Towards a More Secure Internet Ro...
Rpki with rpki.net tools
Routing Security
Introduction to RPKI by Sheryl (Shane) Hermoso
Introduction to RPKI - MyNOG
ThaiNOG Day 2021: Thailand's Route Validity
NZNOG 2022: Routing Security
HKNOG 7.0: RPKI - it's time to start deploying it
VNIXNOG 2019: Securing Internet Routing
LkNOG 3: Securing Internet Routing
ICANN APAC-TWNIC Engagement Forum: Internet Number Registry Services - The Ne...
PLNOG14: Quo Vadis RPKI - Andrzej Wolski
MANRS for Network Operators
Ad

More from Jimmy Lim (6)

PDF
Managing Global Distributed Network
PDF
The bond between automation and network engineering
PDF
IDNOG3-Jimmy-CloudFlare
PDF
MY Orange Cloud - MyIX Peering Forum 2016
PDF
Unknown Unicast Storm Control in Internet Exchange
PPTX
Moving Away From OpenBGPd to BIRD?
Managing Global Distributed Network
The bond between automation and network engineering
IDNOG3-Jimmy-CloudFlare
MY Orange Cloud - MyIX Peering Forum 2016
Unknown Unicast Storm Control in Internet Exchange
Moving Away From OpenBGPd to BIRD?

Recently uploaded (20)

PPTX
INTERNET------BASICS-------UPDATED PPT PRESENTATION
PDF
The New Creative Director: How AI Tools for Social Media Content Creation Are...
PDF
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PDF
Sims 4 Historia para lo sims 4 para jugar
PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PPTX
E -tech empowerment technologies PowerPoint
PPTX
international classification of diseases ICD-10 review PPT.pptx
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PPTX
Digital Literacy And Online Safety on internet
PPT
tcp ip networks nd ip layering assotred slides
PDF
RPKI Status Update, presented by Makito Lay at IDNOG 10
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
DOCX
Unit-3 cyber security network security of internet system
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
INTERNET------BASICS-------UPDATED PPT PRESENTATION
The New Creative Director: How AI Tools for Social Media Content Creation Are...
Slides PDF The World Game (s) Eco Economic Epochs.pdf
Sims 4 Historia para lo sims 4 para jugar
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
WebRTC in SignalWire - troubleshooting media negotiation
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
E -tech empowerment technologies PowerPoint
international classification of diseases ICD-10 review PPT.pptx
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
Decoding a Decade: 10 Years of Applied CTI Discipline
PptxGenJS_Demo_Chart_20250317130215833.pptx
Introuction about WHO-FIC in ICD-10.pptx
Digital Literacy And Online Safety on internet
tcp ip networks nd ip layering assotred slides
RPKI Status Update, presented by Makito Lay at IDNOG 10
Tenda Login Guide: Access Your Router in 5 Easy Steps
Unit-3 cyber security network security of internet system
Power Point - Lesson 3_2.pptx grad school presentation

BGP filtering best practice

  • 1. Jimmy Lim TWNOG 3 jhalim@cloudflare.com Taipei, 21 June 2019 BGP filtering best practice
  • 3. Protect and accelerate any website online ● Direct visitors to nearest entry point ○ Fast ■ Lesser hops ■ Reduced latency ● Save bandwidth ○ Lesser requests to origin ○ Mitigate DDoS ● Resiliency ○ 150+ locations
  • 5. AS Path vs Prefix filtering
  • 6. Different type of inbound filtering ● No filtering? ○ No inbound policy filtering ○ Not acceptable ● AS path filtering ○ Filtering based on AS path - a series of autonomous system (AS) numbers with originator’s AS number at the end of the path ○ Using regular expression ● Prefix filtering ○ Filtering based on the matching prefixes defined in the prefix list or route filter
  • 7. Many local IXPs are still doing AS path filtering ● Allow all prefixes that are originated by the ASN ○ No proper validation ● Prone to accidental/wrong announcement ● High risk of prefix hijacking and blackholing
  • 8. Sample of bad thing about AS Path filtering ISP/IXP AS65501 Originate 10.0.0.0/24 AS_PATH _65501$ Send packet to 10.0.0.1 Hijacking routerLegitimate router AS65001 Originate 10.0.0.0/23
  • 9. Sample of bad thing about AS Path ● What is so bad about the previous example? permit _65501$ ● That implies accept any prefixes that are originated by AS65501 ○ High chance to create accidental hijacking ○ High risk to hijack or blackhole maliciously
  • 10. Another sample of bad thing about AS Path filtering ● RTBH feature by ISP/IXPs ○ Allow customers or participants to remotely trigger blackhole to prefixes under their own ASN ■ eBGP multihop blackhole peering with ISPs ■ Direct transit BGP session ■ Using ISP/IXPs blackhole BGP community ○ Accept up to /32 Internet ISPCustomer router ISPCustomer router eBGP multihop IXP Participants
  • 11. Why AS Path filtering still exist? ● Difficult to maintain prefix filter ○ Troublesome to validate ● No expertise to configure, too complex? ● IXPs reluctant to do strict filtering ○ Not able to attract all traffic ■ Participants do not update filter regularly/properly
  • 12. Prefix list filtering ● Prefix based filtering ○ More validation is done ● Allow up to /24 for IPv4 prefix ● Allow up to /48 for IPv6 prefix ● Automatic update via IRR database
  • 14. Internet Routing Registry ● Globally distributed routing information database ○ Ensure stability and consistency of Internet-wide routing ○ Sharing information between network operators ● Why use IRR? ○ Route filtering ○ Network troubleshooting ○ Router configuration ○ Global view of Internet routing ● List of IRRs ○ http://www.irr.net/docs/list.html
  • 15. AS-SET information in IRR as-set: AS-CLOUDFLARE descr: Cloudflare, Inc members: AS13335 members: AS3557, AS21556 members: AS132892, AS133877 members: AS202623, AS203898 members: AS394536, AS395747, AS14789 mnt-by: MNT-CLOUD14 source: ARIN
  • 16. Route object information in IRR route: 1.1.1.0/24 descr: Cloudflare, Inc. origin: AS13335 mnt-by: MNT-CLOUD14 notify: rir@cloudflare.com remarks: --------------- remarks: All Cloudflare abuse reporting can be done via remarks: https://www.cloudflare.com/abuse remarks: --------------- source: ARIN
  • 17. Automation to generate prefix filter
  • 18. IRRs have a very loose security model ● Some database maintainers do not check the authenticity of the entry ○ Records exist within IRRs can be wrong and/or missing ● There are lots of IRRs ○ Mirrors are not always up to date ● No cryptographic signing of records ● Let’s talk about RPKI
  • 19. Resource Public Key Infrastructure ● Cryptographic method of signing records ● Regional Internet Registry (RIR) has a root certificate ○ Generate a signed certificate for Local Internet Registry (network operator) ■ All resources they are assigned with (IPs and ASNs) ● LIR then signs the prefix containing origin AS that they intend to use ○ ROA (Route Object Authorization) is created
  • 20. Resource Public Key Infrastructure
  • 21. Resource Public Key Infrastructure
  • 22. Signing prefixes ● Each LIRs own and manage Internet resources has access to RIR portal ○ Signing their prefixes through the portal or API of their RIR is the easisest way to start with RPKI ● Cloudflare has resources in each of the 5 RIR regions ○ About 800 pefixes announcement over different ASNs ○ We need to ensure the first step is done
  • 24. Enforcing validated prefixes ● Signing the prefixes is one thing ● Ensuring the prefixes we receive match their certificates is another ● Validation is done by synchronizing the RIR databases of ROAs ○ Check the signature of every ROA against the RIR’s certification public key ○ Once valid records are known, it is sent to the routers ● Major vendors support a protocol called RPKI to Router Protocol (RTR) ○ A simple protocol for passing a list of valid prefixes with their origin ASN and expected mask length
  • 25. RPKI to Router Protocol is insecure ● Vendors implement the insecure transport methods ● Routes sent in clear text over TCP can be tampered with
  • 26. Introducing GoRTR ● A lightweight local RTR server ● Distribute it via our own Content Delivery Network ● Fetch the cache file over HTTPS and pass the routes over RTR
  • 30. Wrapping up ● No filtering and AS Path filtering is not acceptable ● Prefix filtering via IRR automation is required ○ Challenge to have this applied in all IXPs ● RPKI is not a replacement yet for IRR ○ Not many has signed their prefixes ○ Not many has enforced validating the prefixes ● Implementing RPKI is achivable ○ Plenty of efforts are needed ○ It is not a bullet proof solution on securing the routing in Internet, but the impact of BGP attacks will be greatly reduced
  • 31. Q&A