
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
This package provides a simple way to load, save, and interact with SARIF files.
The SARIF file, once loaded, can be interacted with like a normal Python object.
Nearly all of the code has been automatically generated from the SARIF JSON Schema using a modified version of Microsoft's jschema-to-python package. The modified version can be found in generator.
pip install pysarif
from pysarif import load_from_file, save_to_file
sarif = load_from_file("/path/to/sarif.sarif")
for rule in sarif.runs[0].tool.driver.rules:
print(rule.name)
save_to_file(sarif, "/path/to/new/sarif.sarif")
Microsoft offers the sarif-om package. Sadly, they do not provide any way to load an existing SARIF file into their object model, nor do they provide a way to serialize the object model into a SARIF file. As such, I believe there is currently no (easy) way to work with SARIF files in Python, other than working with it as a dict.
FAQs
Package to work with SARIF files as Python objects
We found that pysarif 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.