Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A library with utils for performing Skolemization on blank nodes (RDF)
W3C has a short intro to skolemization here: https://www.w3.org/2011/rdf-wg/wiki/Skolemisation
% pipx install poetry==1.1.6
% pipx install nox==2020.12.31
% pipx inject nox nox-poetry
% git clone https://github.com/Informasjonsforvaltning/skolemizer.git
% cd skolemizer
% pyenv install 3.9.4
% pyenv local 3.9.4
% poetry install
Remember before starting to always set the baseurl for skolemization, according to your organizations url. This can be done by setting the environment variable skolemizer_baseurl on your operation system. It can also e.g be done run time through Python's os package:
os.environ[Skolemizer.baseurl_key] = "https://www.someorganiztion.somedomain/"
If not set Skolemizer will use "http://example.com/" as base url. In order to invoke the skolemizer for ensuring identifier of rdf-nodes simply add
from skolemizer import Skolemizer
and then before rdf-serialization of a class:
if not getattr(self, "identifier", None):
self.identifier = Skolemizer.add_skolemization()
There should also be a skolemization check performed when serializing object properties. When creating unit tests of skolemized rdf nodes a uuid will be applied as a substring of the complete skolemization. Therefore, in order to create stable unit tests one can use the testsutils in order to mock a stable skolemization.
E.g pytest-mock's MockFixture permits mocking of the skolemizer:
from pytest_mock import MockFixture
from skolemizer import skolemization
catalog = Catalog()
mocker.patch(
"skolemizer.Skolemizer.add_skolemization",
return_value=skolemization
)
which outputs e.g:
@prefix dct: <http://purl.org/dc/terms/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
<http://wwww.digdir.no/.well-known/skolem/284db4d2-80c2-11eb-82c3-83e80baa2f94>
a dcat:Catalog .
% nox
% nox -rs tests
You can enter into Pdb by passing --pdb
to pytest:
nox -rs tests -- --pdb
You can set breakpoints directly in code by using the function breakpoint()
.
FAQs
A library with utils for performing Skolemization on blank nodes (RDF)
We found that skolemizer 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.