Releases: bgpkit/monocle
V0.4.1 Update Parser
What's new
- update
bgpkit-parser
version to0.9.2
to fix the RIB parsing issue (bgpkit/bgpkit-parser#105). Thanks @anuragbhatia for bringing this to our attention!
Full Changelog: v0.4.0...v0.4.1
V0.4.0 RPKI Goodies
V0.4.0
adds a bunch of RPKI-related utility subcommands to monocle.
Install or upgrade this version by cargo install monocle
.
monocle rpki
:
Check RPKI validity for given prefix-ASN pair and provide utility to read ROA and ASPA files from the RPKI archive.
We use Cloudflare RPKI validator as our data source.
➜ monocle rpki --help
RPKI utilities
Usage: monocle rpki <COMMAND>
Commands:
read-roa parse a RPKI ROA file
read-aspa parse a RPKI ASPA file
check validate a prefix-asn pair with a RPKI validator
list list ROAs by ASN or prefix
summary summarize RPKI status for a list of given ASNs
help Print this message or the help of the given subcommand(s)
monocle rpki check
Check RPKI validity for given prefix-ASN pair. We use RIPE NCC's routinator instance as the data source.
➜ monocle rpki check --help
validate a prefix-asn pair with a RPKI validator
Usage: monocle rpki check --asn <ASN> --prefix <PREFIX>
Options:
-a, --asn <ASN>
-p, --prefix <PREFIX>
-h, --help Print help
-V, --version Print version
➜ monocle rpki check --asn 400644 --prefix 2620:AA:A000::/48
RPKI validation result:
| asn | prefix | validity |
|--------|-------------------|----------|
| 400644 | 2620:aa:a000::/48 | valid |
Covering prefixes:
| asn | prefix | max_length |
|--------|-------------------|------------|
| 400644 | 2620:aa:a000::/48 | 48 |
➜ monocle rpki check --asn 400644 --prefix 2620:AA:A000::/49
RPKI validation result:
| asn | prefix | validity |
|--------|-------------------|----------|
| 400644 | 2620:aa:a000::/49 | invalid |
Covering prefixes:
| asn | prefix | max_length |
|--------|-------------------|------------|
| 400644 | 2620:aa:a000::/48 | 48 |
monocle rpki roa
Parse a given RPKI ROA file and display the prefix-ASN pairs with max length. (powered by rpki-rs
)
➜ monocle rpki read-roa https://spaces.bgpkit.org/parser/bgpkit.roa
| asn | prefix | max_len |
|--------|-------------------|---------|
| 393949 | 192.67.222.0/24 | 24 |
| 393949 | 192.195.251.0/24 | 24 |
| 393949 | 2620:98:4000::/44 | 48 |
monocle rpki aspa
Parse a given RPKI ASPA file and display the allowed upstreams. (powered by rpki-rs
)
➜ monocle rpki read-aspa https://spaces.bgpkit.org/parser/as945.asa
| asn | allowed_upstream |
|-----|------------------|
| 945 | 1299 |
| | 6939 |
| | 7480 |
| | 32097 |
| | 50058 |
| | 61138 |
monocle rpki list
List signed ROAs for a given ASN or prefix.
➜ monocle rpki list 13335
| asn | prefix | max_length |
|-------|---------------------|------------|
| 13335 | 197.234.240.0/22 | 22 |
| 13335 | 197.234.240.0/24 | 24 |
| 13335 | 197.234.241.0/24 | 24 |
| 13335 | 197.234.242.0/24 | 24 |
| 13335 | 197.234.243.0/24 | 24 |
| 13335 | 2c0f:f248::/32 | 32 |
| 13335 | 210.17.44.0/24 | 24 |
| 13335 | 103.22.200.0/23 | 23 |
...
➜ monocle rpki list 1.1.1.0/24
| asn | prefix | max_length |
|-------|------------|------------|
| 13335 | 1.1.1.0/24 | 24 |
monocle rpki summary
Summarize RPKI status for a list of given ASNs.
➜ rpki summary 701 13335 15169 400644
| asn | signed | routed_valid | routed_invalid | routed_unknown |
|--------|--------|--------------|----------------|----------------|
| 701 | 956 | 890 | 35 | 361 |
| 13335 | 1184 | 1000 | 4 | 221 |
| 15169 | 1372 | 989 | 0 | 5 |
| 400644 | 1 | 0 | 0 | 0 |
NOTE: due to Cloudflare API's current limitation, the maximum number of entries per routed_
category is 1000
.
V0.3.1
What's Changed
- apply clippy fixes by @digizeph in #30
- better handle search results with missing data by @digizeph in #36
- allow floating point number timestamp by @digizeph in #37
- order search results by AS number by @digizeph in #38
- change default table to concise markdown by @digizeph in #39
- add
--psv
flag to output to PSV format by @digizeph in #40
Full Changelog: v0.2.1...v0.3.1
V0.2.1
V0.1.0
Bumped bgpkit-parser
version to 0.8.1
for parsing fixes and the improved JSON output.
Full Changelog: v0.0.5...v0.1.0
V0.0.5 Multi-query whois; Humanized time string
Quick glance
Search ASes and organizations with a single command call:
➜ monocle whois 13335 bgpkit
╭────────┬───────────────┬──────────────────┬──────────────┬─────────────┬──────────╮
│ asn │ as_name │ org_name │ org_id │ org_country │ org_size │
├────────┼───────────────┼──────────────────┼──────────────┼─────────────┼──────────┤
│ 13335 │ CLOUDFLARENET │ Cloudflare, Inc. │ CLOUD14-ARIN │ US │ 5 │
│ 400644 │ BGPKIT-LLC │ BGPKIT LLC │ BL-1057-ARIN │ US │ 1 │
╰────────┴───────────────┴──────────────────┴──────────────┴─────────────┴──────────╯
Show humanized string for time since the queried time:
➜ monocle time 2022-01-01T00:00:00Z
╭────────────┬───────────────────────────┬──────────────╮
│ unix │ rfc3339 │ human │
├────────────┼───────────────────────────┼──────────────┤
│ 1640995200 │ 2022-01-01T00:00:00+00:00 │ 6 months ago │
╰────────────┴───────────────────────────┴──────────────╯
What's Changed
- allow search for multiple entries with
whois
by @digizeph in #18 - Add humanized time difference string by @digizeph in #19
Full Changelog: v0.0.4...v0.0.5
V0.0.4 AS Info Lookup
New Features
monocle whois
This pull request adds a new subcommand monocle whois
that allows querying AS and organization information with ASN or name text.
This function has the following features:
- one bootstrap and offline use forever
- 1 minute bootstrap time
- "smart query": search based on input,
400644
-> search by ASN,bgpkit
-> search by AS name- can always fall back for force searching by ASN or name
- output to table and order entries by organizations' sizes
- SQLite as storage backend, so users can always run queries directly on the database
- The database is stored at
~/.monocle/monocle-data.sqlite3
by default
- The database is stored at
➜ ~ monocle whois --help
monocle-whois 0.0.4
ASN and organization lookup utility
USAGE:
monocle whois [OPTIONS] <QUERY>
ARGS:
<QUERY> Search query, an ASN (e.g. "400644") or a name (e.g. "bgpkit")
OPTIONS:
-a, --asn-only Search by ASN only
-h, --help Print help information
-n, --name-only Search AS and Org name only
-u, --update Refresh local as2org database
-V, --version Print version information
Example queries:
➜ ~ monocle whois 400644
+--------+------------+------------+--------------+-------------+----------+
| asn | as_name | org_name | org_id | org_country | org_size |
+--------+------------+------------+--------------+-------------+----------+
| 400644 | BGPKIT-LLC | BGPKIT LLC | BL-1057-ARIN | US | 1 |
+--------+------------+------------+--------------+-------------+----------+
➜ ~ monocle whois bgpkit
+--------+------------+------------+--------------+-------------+----------+
| asn | as_name | org_name | org_id | org_country | org_size |
+--------+------------+------------+--------------+-------------+----------+
| 400644 | BGPKIT-LLC | BGPKIT LLC | BL-1057-ARIN | US | 1 |
+--------+------------+------------+--------------+-------------+----------+
Monocle Configration
This pull request also adds the initial support for configuring Monocle's behavior. There are two ways to pass configuration values to the function:
- by environment variable with prefix
MONOCLE_
- by changing TOML configuration file at
~/.monocle/monocle.toml
Currently, we have one supported variable:
data_dir
: the directory where the Monocle's SQLite datafile will be stored
Users can configure data_dir
to ~/DATA
in two ways: set environment variable MONOCLE_DATA_DIR=~/DATA
or have a data_dir="~/DATA"
in the ~/.monocle/monocle.toml file like below
### monocle configuration file
### directory for cached data used by monocle
data_dir="~/.monocle"
Pull Requests and Full Changelog
- enable app-level configuration using toml file by @digizeph in #9
- Feature AS inforomation lookup by @digizeph in #10
Full Changelog: v0.0.3...v0.0.4
V0.0.3 Time subcommand
New subcommand monocle time
monocle time
prints out the UNIX timestamp and the corresponding RFC3339 time string. You can provide it a timestamp, a time string, or nothing.
➜ monocle time
+------------+---------------------------+
| unix | rfc3339 |
+------------+---------------------------+
| 1657850362 | 2022-07-15T01:59:22+00:00 |
+------------+---------------------------+
➜ monocle time 0
+------+---------------------------+
| unix | rfc3339 |
+------+---------------------------+
| 0 | 1970-01-01T00:00:00+00:00 |
+------+---------------------------+
➜ monocle time 2022-01-01T00:00:00Z
+------------+---------------------------+
| unix | rfc3339 |
+------------+---------------------------+
| 1640995200 | 2022-01-01T00:00:00+00:00 |
+------------+---------------------------+
➜ monocle time 2022-01-01T00:00:00
Input time must be either Unix timestamp or time string compliant with RFC3339
Enhanced RFC3339 support
It now validates and enforces RFC3339 everywhere when time string is used.
Issues closed
Pull requests and full changelog
Full Changelog: v0.0.2...v0.0.3
V0.0.2 Time string parsing!
RFC3339 EVERYWHERE
You can do queries using rfc3339 time strings now:
monocle search --dry-run --start-ts 2022-01-01T00:00:00 --end-ts 2022-01-01T00:01:00
What's Changed
Full Changelog: v0.0.1...v0.0.2