RPKI: Preventing BGP Hijacks and Securing Internet Routing

The internet, a global network of interconnected systems, relies on a complex system of protocols to route traffic efficiently. At its core lies the Border Gateway Protocol (BGP), the routing protocol that glues the internet together, enabling data to traverse autonomous systems (ASes) and reach its destination. While BGP has been instrumental in the internet’s growth, its fundamental trust-based architecture leaves it vulnerable to a critical threat: BGP hijacking. This article delves into the mechanics of BGP hijacking, introduces the Resource Public Key Infrastructure (RPKI) as a powerful defense mechanism, and explores how its increasing adoption is safeguarding the internet’s routing integrity.

The Unseen Vulnerability: BGP’s Trust Model and Hijacks

BGP operates on a principle of trust, where each autonomous system announces the IP prefixes it controls and the paths it can use to reach them. These announcements propagate across the internet, allowing routers to build comprehensive routing tables. However, this trust model is also BGP’s Achilles’ heel. Malicious actors, or even misconfigured networks, can exploit this by announcing IP prefixes they do not legitimately control, effectively “hijacking” traffic intended for another network.

A BGP hijack can manifest in several ways:

  • Origin Hijack: An AS falsely advertises that it is the legitimate origin of an IP prefix that belongs to another AS. This is the most common type and can divert vast amounts of traffic.
  • Path Hijack: An AS inserts itself into the advertised path to a legitimate prefix, often to intercept or inspect traffic before forwarding it.

The consequences of a BGP hijack can be severe, ranging from widespread internet outages and denial-of-service attacks to data interception and financial fraud. Past incidents have seen cryptocurrency exchanges drained, nation-state surveillance, and global internet slowdowns, all stemming from malicious or erroneous BGP announcements. For instance, in 2018, a BGP hijack affecting Amazon Route 53 diverted traffic for a cryptocurrency service, leading to significant financial losses. These incidents underscore the critical need for a robust mechanism to validate the authenticity of BGP advertisements.

Global network infrastructure
Photo by Dimitri Karastelev on Unsplash

Introducing RPKI: A Cryptographic Shield for Routing

The Resource Public Key Infrastructure (RPKI) emerges as a vital solution to the inherent vulnerabilities of BGP. RPKI is a framework that provides a way to cryptographically verify the ownership of IP address blocks and AS numbers, thereby allowing network operators to validate the legitimacy of BGP route origin advertisements. It introduces a layer of cryptographic attestation, moving beyond the traditional trust-based model of BGP.

At its core, RPKI establishes a hierarchy of trust, mirroring the existing system of IP address allocation. Regional Internet Registries (RIRs) are at the top, delegating IP addresses and AS numbers to Local Internet Registries (LIRs) and ultimately to end-users. RPKI leverages public key cryptography to allow resource holders (organizations that have been allocated IP addresses and ASNs) to digitally “sign” their routing intentions.

The key component in RPKI is the Route Origin Authorization (ROA). A ROA is a cryptographically signed object that specifies which Autonomous System (AS) is authorized to originate routes for a specific IP prefix or set of prefixes, and the maximum length of the prefix that AS is authorized to advertise. Each ROA contains:

  • The IP prefix(es) it covers.
  • The AS number authorized to originate routes for those prefixes.
  • A maxLength attribute, which defines the longest prefix that the AS is authorized to advertise. For example, a ROA for 192.0.2.0/24 with a maxLength of 26 means the AS can advertise 192.0.2.0/24, 192.0.2.0/25, or 192.0.2.0/26, but not 192.0.2.0/23.

These ROAs are stored in a distributed repository system that is publicly accessible. Network operators then use Route Origin Validation (ROV) to check incoming BGP announcements against these signed ROAs.

Implementing RPKI: From Creation to Validation

Implementing RPKI involves two primary aspects: creating ROAs and performing route origin validation.

1. Creating ROAs: Resource holders (organizations with IP address allocations and ASNs) are responsible for creating ROAs for their prefixes. This process typically occurs through their respective RIR’s portal or via specialized RPKI management tools. When creating a ROA, the resource holder specifies the AS number(s) authorized to originate routes for their IP prefixes and the maximum prefix length. Once created, the ROA is cryptographically signed and published to the RPKI repository system. This act essentially declares to the internet which AS is legitimately allowed to announce specific IP routes.

2. Performing Route Origin Validation (ROV): Network operators wishing to protect their networks from BGP hijacks deploy RPKI validating software (also known as “relying party” software) such as rpki-client or Routinator. This software periodically fetches the RPKI repository data, including all published ROAs, and validates the cryptographic signatures. The result is a local cache of valid origin authorizations.

When a BGP router receives a route announcement, it consults this local RPKI validation cache. Each incoming BGP route is evaluated against the ROA records, resulting in one of three validation states:

  • Valid: The AS number and IP prefix in the BGP announcement exactly match a valid ROA, or the prefix is more specific than a ROA-covered prefix within its maxLength. This route is considered legitimate.
  • Invalid: The AS number in the BGP announcement is not authorized to originate the advertised IP prefix according to a valid ROA, or the advertised prefix length exceeds the maxLength specified in a matching ROA. This indicates a potential hijack or misconfiguration.
  • Unknown: No ROA exists for the IP prefix in the BGP announcement. While not necessarily malicious, it means the origin cannot be cryptographically verified.

RPKI validation process flow
Photo by GuerrillaBuzz on Unsplash

Network operators can then configure their BGP routers to take action based on these validation states. A common practice is to treat “Invalid” routes as untrustworthy, either by assigning them a lower local preference, marking them for further inspection, or, in stricter implementations, outright dropping them. This prevents hijacked routes from being propagated within and through their network, effectively containing the damage of a BGP hijack.

The Impact and Future of RPKI

The adoption of RPKI has been steadily increasing, signifying a growing recognition of its importance in securing global internet routing. According to statistics from various sources, the percentage of IPv4 prefixes with a valid ROA has surpassed 50% globally, with some regions showing even higher adoption rates. This widespread adoption directly translates into a more resilient internet. As more ASes validate routes, the “attack surface” for BGP hijacks shrinks, making it harder for malicious announcements to propagate and affect users.

The benefits of RPKI are tangible:

  • Reduced BGP Hijacks: By providing a verifiable source of truth for route origins, RPKI significantly mitigates the risk and impact of origin hijacks.
  • Improved Internet Resilience: Networks implementing ROV can automatically filter out invalid routes, preventing them from being used and improving the overall stability of internet routing.
  • Enhanced Trust: RPKI introduces a cryptographic layer of trust into a historically trust-based protocol, moving towards a more secure and verifiable internet.

Despite its successes, RPKI still faces challenges, primarily related to full global adoption and operational complexities for smaller networks. Some operators may find the initial setup and maintenance of ROAs daunting, or they may be hesitant to drop “Invalid” routes due to concerns about legitimate misconfigurations. However, the benefits far outweigh these challenges, and the ecosystem of tools and resources for RPKI deployment continues to mature.

While RPKI primarily addresses origin validation, the future of routing security also involves protocols like BGPsec, which aims to cryptographically secure the entire BGP path. However, BGPsec’s deployment is significantly more complex than RPKI’s. RPKI serves as an essential, foundational step, providing immediate and significant improvements to routing security with a more manageable deployment overhead.

In conclusion, RPKI is not just a technical enhancement; it is a critical defense mechanism saving us from the pervasive threat of BGP hijacks. Its continued adoption and the proactive participation of network operators are vital for building a more secure, resilient, and trustworthy internet for everyone.

References

  1. Cloudflare (2020). A Brief History of BGP Hijacks.
  2. APNIC (2023). RPKI Adoption Statistics.
  3. NLnet Labs (2024). RPKI Statistics.

Thank you for reading! If you have any feedback or comments, please send them to [email protected].