
Research
/Security News
60 Malicious Ruby Gems Used in Targeted Credential Theft Campaign
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Informational Badges:
Some Linting Badges (Where I could find them):
This package contains a trie of prefixes for fast lookups
trie = IPv4CIDRTrie()
cidrs = [ip_network(x) for x in ["1.2.0.0/16", "1.2.3.0/24", "1.2.3.4"]]
for cidr in cidrs:
# for mypy
assert isinstance(cidr, IPv4Network)
trie.insert(cidr)
for cidr in cidrs:
assert isinstance(cidr, IPv4Network)
assert cidr in trie
node = trie.get_most_specific_trie_supernet(cidr)
assert node is not None and node.prefix == cidr
invalid_cidrs = [ip_network(x) for x in ["1.0.0.0/8", "255.255.255.255"]]
for invalid_cidr in invalid_cidrs:
# for mypy
assert isinstance(invalid_cidr, IPv4Network)
assert invalid_cidr not in trie
assert trie.get_most_specific_trie_supernet(invalid_cidr) is None
assert IPv4Network("1.2.4.0/24") in trie
assert IPv4Network("1.2.0.255") in trie
assert IPv4Network("1.3.0.0/16") not in trie
Install python and pip if you have not already. Then run:
pip3 install lib_cidr_trie
This will install the package and all of it's python dependencies.
If you want to install the project for development:
git clone https://github.com/jfuruness/lib_cidr_trie.git
cd lib_cidr_trie
pip3 install -e .[test]
pre-commit install
To test the development package: Testing
To test the package after installation:
cd lib_cidr_trie
pytest lib_cidr_trie
ruff check lib_cidr_trie
ruff format lib_cidr_trie
mypy lib_cidr_trie
You can run isolated builds across multiple environments with:
cd lib_cidr_trie
tox --skip-missing-interpreters
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
1.2.8 Removed windows classifier from pyproject.toml
1.2.7 Updated dependencies and ruff rules
1.2.6 Fixed a bug in the pyproject.toml that screwed up non-local installs
1.2.5 Updated README
1.2.4 Updated docs and test deps
1.2.3 Updated package metadata and fixed some formatting for linters
1.1.2 Python version updates
1.1.1 Dependency updates
1.1.0 Removed a few type ignores for mypy, added PrefixType to dunder init
1.0.0 Added linters, updated package structure, fixed typing issues
0.0.3 Made it easier to subclass CIDRTrie
0.0.2 README update
0.0.1 First working version
BSD License (see license file)
FAQs
Contains a trie of prefixes for fast lookups
We found that lib-cidr-trie demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.