Este documento describe cómo implementar RPKI (Resource Public Key Infrastructure) para mejorar la seguridad de las redes BGP. RPKI ayuda a prevenir el secuestro de rutas BGP mediante la validación criptográfica de los anuncios de prefijos. Se explican los pasos para configurar RPKI, incluyendo la creación de ROAs (Route Origin Authorizations), la instalación de un validador RPKI y la configuración de validación de origen de rutas (ROV) en los routers BGP.
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
Fundamentos de RPKI y BGP
1. SEGURIDAD PARA TODOS:
IMPLEMENTANDO RPKI CON REDES BGP
• Paulo Colomés F. (pcolomes)
• Ingeniero en Redes y Ciberseguridad
• NIS Chile – ww.nis.cl
2. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
TERMINOLOGÍA RELEVANTE
BGP: Border Gateway Protocol
AS: Autonomous System
ASN: Autonomous System Number
Prefijo: Bloque IP
RPKI: Resource Public Key Infrastructure
IXP: Interconnection Point
RFC: Request For Comments
ROA: Route Origination Authorization
ROV: Route Origination Validation
ISP: Internet Service Provider
RIR: Regional Internet Registry
4. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
EL PROBLEMA: SECUESTRO DE RUTAS BGP (BGP Hijacking / Route Hijacking)
* BGP fue definido en 1989 (RFC 1105) y la actual versión del protocolo (v4) fue publicada en 2006 bajo el RFC 4271
El diseño intrínseco de BGP se basa en que un AS en particular publique (envíe) a los demás AS la información
respecto a cuales son los prefijos de direcciones IP públicas que existen dentro de su infraestructura,
permitiéndole a los demás routers de Internet crear una asociación entre ASN y prefijo. Ejemplo:
1.1.1.0/24 – AS13335 (Cloudflare, US)
166.114.0.0/16 – AS52250 (Ag para el Desarrollo de la Sociedad de la Inf en Bolivia - ADSIB, BO)
164.77.192.0/19 – AS27651 (Entel Chile S.A., CL)
El problema radica en que internamente BGP no tiene ningún método para validar que un prefijo en particular provenga
efectivamente desde el AS que le corresponde y no desde otro.
Cuando un ISP publica (intencionalmente o no) un prefijo asignado a otro AS, se produce la condición conocida como
Secuestro de Rutas BGP (BGP Hijacking)
5. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
AS65001
AS65002
AS65003 AS65004
100.4.0.0/24
100.4.0.100/24
100.1.0.0/24
100.2.0.0/24
AS PATH:
100.4.0.0/24: 65003 – 65004
100.2.0.0/24: 65002
6. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
AS65001
AS65002
AS65003 AS65004
100.4.0.0/24
100.4.0.100/24
100.1.0.0/24
100.4.0.0/24
AS PATH:
100.4.0.0/24: 65003 – 65004
100.4.0.0/24: 65002
100.4.0.100/24
DNS SERVER
MALICIOSO
7. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
Algunos casos notables ocurridos en Internet:
Mayo 2005: Caída de los servicios de Google
Febrero 2008: Caída mundial de YouTube debido al intento de Pakistán de bloquear el servicio dentro del país
Abril 2010: China Telecom intencionalmente redirige tráfico mundial a sus redes
Abril 2018: eNet secuestra 1300 IPs de AWS, haciendo que múltiples ISP propaguen el anuncio
8. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
Algunos casos notables ocurridos en Internet:
Mayo 2005: Caída de los servicios de Google
Febrero 2008: Caída mundial de YouTube debido al intento de Pakistán de bloquear el servicio dentro del país
Abril 2010: China Telecom intencionalmente redirige tráfico mundial a sus redes
Abril 2018: eNet secuestra 1300 IPs de AWS, haciendo que múltiples ISP propaguen el anuncio
ESTOS EVENTOS SUCEDEN POR:
1. ERRORES DE CONFIGURACIÓN EN LOS ROUTERS BGP
2. INTENCIONALMENTE CON EL OBJETIVO DE ESPIAR DATOS O PROVOCAR CAÍDAS
9. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
https://twitter.com/bgpstream
10. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
LA SOLUCIÓN: RPKI (Resource Public Key Infrastructure)
11. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
PASOS PARA IMPLEMENTAR RPKI:
1. Poseer un ASN propio y bloques IP asignados por el RIR respectivo
2. Tener sesiones BGP con otros proveedores (Upstream, tránsito, downstream, etc)
3. Crear los Route-Origin-Authorization (ROAs) en el panel de control del RIR
4. Disponer de un servidor Linux para instalar el validador RPKI dentro de la red
5. Descargar los ROAs en el validador
6. Configurar la conexión RTR entre los routers y el validador RPKI
7. Configurar ROV (Route Origin Validation) en los routers para descartar los prefijos
inválidos
12. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
EJEMPLO DE GENERACIÓN DE ROAs en LACNIC
13. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
CONFIGURACIÓN DE RTR EN ROUTERS
router bgp 65500
nsr
bgp router-id 10.10.10.1
rpki server 10.10.10.53
transport tcp port 8323
refresh-time 120
bgp log neighbor changes detail
bgp origin-as validation time 30
address-family ipv4 unicast
bgp bestpath origin-as use validity
network 200.200.200.0/24
routing-options {
autonomous-system 65500;
validation {
group rpki-validator {
session 10.10.10.53
local-address 10.10.10.1;
}
}
}
}
CISCO IOS-XR JUNIPER
14. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
CONFIGURACIÓN DE ROV EN ROUTERS
route-policy validacion-rpki
if validation-state is invalid then
drop
if validation-state is unknown then
pass
if validation-state is valid then
pass
endif
end-policy
route-policy EBGP-ISP1
apply validacion-rpki
..
..
policy-statement rpki {
term reject_invalid {
from {
protocol bgp;
validation-database invalid;
}
then {
validation-state invalid;
reject;
}
}
term mark_valid {
from {
protocol bgp;
validation-database valid;
}
then {
validation-state valid;
next policy;
}
}
then {
validation-state unknown;
next policy;
}
}
CISCO IOS-XR
JUNIPER
15. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
VALIDADORES RPKI GRATUITOS
https://github.com/NICMx/FORT-validator https://github.com/cloudflare/cfrpki#octorpki
https://www.nlnetlabs.nl https://www.rpki-client.org
FORT (NIC.MX) OctoRPKI (Cloudflare)
Routinator (NLnet Labs) RPKI Client (OpenBSD)
16. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
¿Cómo validar que RPKI está correctamente implementado?
https://isbgpsafeyet.com
17. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
https://www.manrs.org
Antes de finalizar…
18. SEGURIDAD PARA TODOS: IMPLEMENTANDO RPKI CON REDES BGP – PAULO COLOMÉS
www.nis.cl
MUCHAS GRACIAS POR SU ATENCIÓN