implementing-bgp-security-with-rpki
它能做什么
这项功能帮你的网络防范那些试图窃取或篡改互联网流量的攻击。它通过一套叫 RPKI 的验证体系,检查你对外宣告的路由信息是否合法。
适用场景
- ✓当你想防止别人劫持你的网络流量时。
- ✓当你需要确保路由信息可信时。
- ✓当你要让网络安全配置符合特定合规要求时。
技能链接
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-bgp-security-with-rpki/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“为我的网络设置 RPKI 安全防护。”
每周 5 个新技能,1 分钟读完。
工作原理
首先,你需要创建授权记录(称为 ROA),说明网络的哪些部分可以宣告哪些 IP 地址。然后,安装检查这些授权的软件,并配置路由器,只接受带有有效授权的流量。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Implementing BGP Security with RPKI
Overview
Resource Public Key Infrastructure (RPKI) provides cryptographic validation of BGP route origins to prevent route hijacking and accidental route leaks. RPKI enables network operators to create Route Origin Authorizations (ROAs) that declare which Autonomous Systems (ASes) are authorized to originate specific IP prefixes. BGP routers validate received route announcements against RPKI data through Route Origin Validation (ROV), rejecting routes with invalid origins. This skill covers creating ROAs through Regional Internet Registries (RIRs), deploying RPKI validator software, configuring ROV on Cisco IOS-XE and Juniper Junos routers, and implementing BGP filtering policies based on RPKI validation state.
When to Use
- When deploying or configuring implementing bgp security with rpki capabilities in your environment
- When establishing security controls aligned to compliance requirements
- When building or improving security architecture for this domain
- When conducting security assessments that require this implementation
Prerequisites
- IP address space allocated from an RIR (ARIN, RIPE, APNIC, AFRINIC, LACNIC)
- RIR member portal access for ROA creation
- BGP routers (Cisco IOS-XE 16.x+, Juniper Junos 12.2+, or similar)
- Linux server for RPKI validator/cache (Routinator, FORT, or OctoRPKI)
- Understanding of BGP routing and AS path concepts
Core Concepts
RPKI Architecture
┌──────────────────────────────────────────────┐
│ Regional Internet Registries │
│ (ARIN, RIPE, APNIC, AFRINIC, LACNIC) │
│ │
│ ┌─────────────────────────────────────────┐ │
│ │ Trust Anchor (Root CA Certificate) │ │
│ │ ├── CA Certificate (ISP/Organization) │ │
│ │ │ ├── ROA: AS64512 → 198.51.100.0/24 │ │
│ │ │ └── ROA: AS64512 → 2001:db8::/32 │ │
│ │ └── CA Certificate (Another Org) │ │
│ │ └── ROA: AS64513 → 203.0.113.0/24 │ │
│ └─────────────────────────────────────────┘ │
└──────────────────────────────────────────────┘
│ rsync/RRDP
▼
┌──────────────────────┐
│ RPKI Validator/Cache │ (Routinator, FORT, OctoRPKI)
│ Validates ROAs │
│ Serves VRPs to RTR │
└──────────────────────┘
│ RTR Protocol (TCP 8323)
▼
┌──────────────────────┐
│ BGP Router │
│ Performs ROV │
│ Applies policy: │
│ Valid → Accept │
│ Invalid → Reject │
│ NotFound → Accept │
└──────────────────────┘
RPKI Validation States
| State | Meaning | Recommended Action |
|---|---|---|
| Valid | ROA exists, origin AS and prefix match | Accept route (prefer) |
| Invalid | ROA exists, but origin AS or prefix length mismatch | Reject route |
| NotFound | No ROA covers this prefix | Accept (but lower preference) |
Route Origin Authorization (ROA)
A ROA is a signed object that states:
- Prefix: The IP address range (e.g., 198.51.100.0/24)
- Origin AS: The AS authorized to originate this prefix (e.g., AS64512)
- Max Length: Maximum prefix length that can be announced (e.g., /24)
Workflow
Step 1: Create ROAs at Your RIR
ARIN (North America):
- Log into ARIN Online portal
- Navigate to Routing Security > Route Origin Authorizations
- Create ROA:
- Prefix: 198.51.100.0/24
- Origin AS: AS64512
- Max Length: /24 (set equal to prefix length to prevent sub-prefix hijacking)
- Sign and submit
RIPE NCC (Europe):
- Log into RIPE NCC LIR Portal
- Navigate to Certification (RPKI) > ROAs
- Create ROA with prefix, origin AS, and max prefix length
Step 2: Deploy RPKI Validator (Routinator)
# Install Routinator on Ubuntu
sudo apt install -y routinator
# Or install via Cargo (Rust)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install routinator
# Initialize Routinator (accept TALs)
routinator init --accept-arin-rpa
# Start Routinator in RTR server mode
routinator server \
--rtr 0.0.0.0:8323 \
--http 0.0.0.0:8080 \
--refresh 600 \
--retry 60 \
--expire 7200
# Run as systemd service
cat > /etc/systemd/system/routinator.service << 'SYSTEMD'
[Unit]
Description=Routinator RPKI Validator
After=network.target
[Service]
…
常见问题
什么是 RPKI?
RPKI 全称 Resource Public Key Infrastructure(资源公钥基础设施)。它利用密码学技术,确保网络路由信息真实可靠,没有被篡改。
什么是 ROA?
ROA 全称 Route Origin Authorization(路由源授权)。它是一份经过数字签名的声明,指定哪个自治系统(AS)被允许宣告某个 IP 地址段。
什么是 ROV?
ROV 全称 Route Origin Validation(路由源验证)。路由器会把收到的路由宣告与现有的 ROA 进行比对,以确认其是否有效。
详情
作者的原始描述
Implement RPKI-based BGP route origin validation by creating Route Origin Authorizations (ROAs) at RIRs (ARIN, RIPE, APNIC, AFRINIC, LACNIC), deploying validator software (Routinator, FORT, OctoRPKI), and configuring RPKI-to-Router protocol and ROV accept/reject policies on Cisco IOS-XE and Juniper Junos routers. Use when hardening BGP against route hijacking or leaks, or when configuring ROV filt
热度
- GitHub 星标
- 35k
- 排名
- #8006
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/31
评论
- …
同一仓库的更多技能
abusing-dpapi-for-credential-access
35k为你的 AI 智能体提供针对特定任务的现成指令,让它完成得更好、更快。
abusing-shadow-credentials-for-privesc
35k教你的 AI 智能体写出清晰、结构良好的文本。
achieving-cmmc-level-2-compliance
35k帮助你的智能体搭建符合 CMMC Level 2 合规要求的环境。它会落实安全要求,并管理必要的文档。
acquiring-disk-image-with-dd-and-dcfldd
35k帮助你的智能体创建硬盘的精确副本。这能确保调查过程中信息不丢失、不被篡改。