Skip to main content

A Python library of utility classes for SentinelIQ analyzers and responders

Project description

Open in Dev Containers Open in GitHub Codespaces

Sentineliqsdk

Modern Python library of utility classes for SentinelIQ analyzers and responders.

Note: This SDK now exposes only the modern API (Python 3.13). Legacy helper aliases such as getData, getParam, checkTlp, and notSupported were removed. Migrate to get_data, get_param, and rely on automatic TLP/PAP enforcement in Worker.

Installing

To install this package, run:

pip install sentineliqsdk

Using

Example usage:

from sentineliqsdk import Analyzer, Responder, Worker, Extractor, runner


class EchoAnalyzer(Analyzer):
    def run(self) -> None:
        data = self.get_data()
        self.report({"echo": data})


if __name__ == "__main__":
    runner(EchoAnalyzer)

Internal structure (for maintainers):

  • src/sentineliqsdk/core/worker.py
  • src/sentineliqsdk/analyzers/base.py
  • src/sentineliqsdk/responders/base.py
  • src/sentineliqsdk/extractors/regex.py (Extractor uses stdlib validators: ipaddress, urlparse)

Extractor

The Extractor detects common IOC types using Python's standard library instead of complex regular expressions:

  • ip: ipaddress.ip_address
  • url/uri: urllib.parse.urlparse
  • mail: email.utils.parseaddr
  • hash: length + hex digits check
  • domain/fqdn/registry/user‑agent: simple heuristics aligned with the test suite

Migration (Breaking Changes)

  • Import from the top-level package only:
    • Before: from sentineliqsdk.analyzer import Analyzer
    • After: from sentineliqsdk import Analyzer
  • Removed legacy helpers: getData, getParam, checkTlp, notSupported, unexpectedError.
  • Removed legacy config key: config.auto_extract_artifacts (use config.auto_extract).
  • Removed legacy module paths: sentineliqsdk.analyzer, sentineliqsdk.responder, sentineliqsdk.worker, sentineliqsdk.extractor (all exported at top-level instead).

Contributing

Prerequisites
  1. Generate an SSH key and add the SSH key to your GitHub account.

  2. Configure SSH to automatically load your SSH keys:

    cat << EOF >> ~/.ssh/config
    
    Host *
      AddKeysToAgent yes
      IgnoreUnknown UseKeychain
      UseKeychain yes
      ForwardAgent yes
    EOF
    
  3. Install Docker Desktop.

  4. Install VS Code and VS Code's Dev Containers extension. Alternatively, install PyCharm.

  5. Optional: install a Nerd Font such as FiraCode Nerd Font and configure VS Code or PyCharm to use it.

Development environments

The following development environments are supported:

  1. ⭐️ GitHub Codespaces: click on Open in GitHub Codespaces to start developing in your browser.

  2. ⭐️ VS Code Dev Container (with container volume): click on Open in Dev Containers to clone this repository in a container volume and create a Dev Container with VS Code.

  3. ⭐️ uv: clone this repository and run the following from root of the repository:

    # Create and install a virtual environment
    uv sync --python 3.13 --all-extras
    
    # Activate the virtual environment
    source .venv/bin/activate
    
    # Install the pre-commit hooks
    pre-commit install --install-hooks
    
  4. VS Code Dev Container: clone this repository, open it with VS Code, and run Ctrl/⌘ + + PDev Containers: Reopen in Container.

  5. PyCharm Dev Container: clone this repository, open it with PyCharm, create a Dev Container with Mount Sources, and configure an existing Python interpreter at /opt/venv/bin/python.

Developing
  • This project follows the Conventional Commits standard to automate Semantic Versioning and Keep A Changelog with Commitizen.
  • Run poe from within the development environment to print a list of Poe the Poet tasks available to run on this project.
  • Run tests with coverage: poe test (writes reports/coverage.xml and shows a summary).
  • Run uv add {package} from within the development environment to install a run time dependency and add it to pyproject.toml and uv.lock. Add --dev to install a development dependency.
  • Run uv sync --upgrade from within the development environment to upgrade all dependencies to the latest versions allowed by pyproject.toml. Add --only-dev to upgrade the development dependencies only.
  • Run cz bump to bump the package's version, update the CHANGELOG.md, and create a git tag. Then push the changes and the git tag with git push origin main --tags.
Security and privacy
  • Error payloads sanitize config keys containing any of: key, password, secret, token.
  • You can override or extend this list via the secret_phrases parameter to Worker(...).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sentineliqsdk-0.1.0.tar.gz (75.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sentineliqsdk-0.1.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file sentineliqsdk-0.1.0.tar.gz.

File metadata

  • Download URL: sentineliqsdk-0.1.0.tar.gz
  • Upload date:
  • Size: 75.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.15

File hashes

Hashes for sentineliqsdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 69adfb5b7051aa24f8fffa86ccddc191951a33e9358274e9cfc52a86fb24e0b5
MD5 b37395f88b744f18d645e0093e5f44f5
BLAKE2b-256 106cb6b033db8166d879da2d4b93c25c7f76509138d82ae421e6725e45183adb

See more details on using hashes here.

File details

Details for the file sentineliqsdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sentineliqsdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b288931b1143a3f46c390f42d9cfd2f49060557103cddea23ea2f55bd223502
MD5 8e758c4aee2598c9cf04d60da67816a5
BLAKE2b-256 bbb3cf8ae602939e697a933a577d13bdb4e9bdd6013103319bac3e9026dcadb3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page