
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
irrc is a lightweight and flexible client of IRR / Whois Database to expand arbitrary as-set and route-set objects into a list of origin ASs and prefixes belonging to those ASs. It will concurrently queries multiple IRR / Whois Databases for performance.
For bundler:
gem 'irrc'
And then:
$ bundle
Otherwise:
$ gem install irrc
irrc privides a peval-like CLI interface.
Query JPIRR about AS-JPNIC and AS-OCN
$ irrc -h jpirr AS-JPNIC AS-OCN
Query JPIRR about AS-JPNIC with authoritative IRR (SOURCE:) based filter
$ irrc -h jpirr -s radb -s apnic AS-JPNIC
Query JPIRR about AS-JPNIC for IPv4 only
$ irrc -h jpirr -4 AS-JPNIC
You can load irrc as a library and use it easily in your own code.
require 'irrc'
client = Irrc::Client.new
client.query :jpirr, 'AS-JPNIC', source: :jpirr # queries JPIRR about AS-JPNIC with a SOURCE: filter
client.query :ripe, 'AS-RIPENCC', protocol: :ipv4 # queries RIPE Whoisd about AS-RIPENCC for IPv4 only
client.perform # returns the results in a Hash
$ irrc -h jpirr AS-JPNIC
will result in a YAML:
---
AS-JPNIC: # queried object
:ipv4:
AS2515: # AS-JPNIC has AS2515 as a origin AS
- 202.12.30.0/24 # 4 IPv4 prefixes belonging to AS2515
- 192.41.192.0/24 #
- 211.120.240.0/21 #
- 211.120.248.0/24 #
:ipv6:
AS2515:
- 2001:0fa0::/32
- 2001:dc2::/32
- 2001:DC2::/32
Successfully tested with 2.1.9, 2.2.6, 2.3.3 and 2.4.0.
irrc will send queries to multiple IRR / Whois servers simultaneously in multi-threads. Single-thread processing for each server by default.
To configure the number of threads per server:
$ irrc -h jpirr -t 2 AS-JPNIC AS-OCN # 2 threads to query JPIRR
client = Irrc::Client.new(2) # 2 threads per IRR / Whois server
irrc uses STDERR
printer for a logger by default, which reports more severe messages than INFO.
To display debug information including raw messages of IRR / Whois protocol:
$ irrc -h jpirr -d AS-JPNIC
To use modified Logger:
client = Irrc::Client.new {|c| c.logger = Irrc::Logging::Logger.new(STDERR) }
# For Rails,
client = Irrc::Client.new {|c| c.logger = Rails.logger }
Here is a quick performance comparison with peval and irrpt.
CLI command | user | system | cpu | total |
---|---|---|---|---|
peval -h jpirr.nic.ad.jp 'afi ipv4, ipv6 AS-OCN' | 0.15s | 0.04s | 3% | 4.959 |
irrpt_list_prefixes AS-OCN | 0.21s | 0.09s | 3% | 9.693 |
irrc -h jpirr AS-OCN | 0.42s | 0.12s | 5% | 9.622 |
irrc -h jpirr -t 4 AS-OCN | 0.39s | 0.13s | 19% | 2.754 |
Please fork it, fix and then send a pull request. :tada:
To run tests just type:
$ rake
Please report issues or enhancement requests to GitHub issues. For questions or feedbacks write to my twitter @codeout.
Copyright (c) 2019 Shintaro Kojima. Code released under the MIT license.
FAQs
Unknown package
We found that irrc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.