Skip to main content

scitex-security

SciTeX

Security checks for the SciTeX ecosystem: GitHub alerts (Dependabot, secret scanning, code scanning), a bandit / shellcheck / pip-audit sweep, and a look-alike domain watch.

Full Documentation · uv pip install scitex-security[all]

PyPI Python Tests Coverage Docs License: AGPL v3


Installation

pip install scitex-security

Architecture

src/scitex_security/
├── __init__.py     # public re-exports
├── github.py       # GitHub alert collection (Dependabot / secret / code scanning)
├── cli.py          # `scitex-security check` / `show-latest`
├── __main__.py     # python -m scitex_security
└── _skills.py      # bundled agent skills

Runtime flow:
  scitex-security check <owner/repo>
        │
        ▼
  github.check_github_alerts()
        │ subprocess
        ▼
  gh api repos/<owner>/<repo>/{dependabot,secret-scanning,code-scanning}/alerts
        │
        ▼
  format_alerts_report() → save_alerts_to_file(.scitex/security/runtime/)

scitex-security shells out to gh (GitHub CLI) and never touches your tokens directly — GH_TOKEN / GITHUB_TOKEN are read by the gh subprocess from the environment, not from this package.

2 Interfaces

Python API (primary)
from scitex_security import (
    check_github_alerts,
    save_alerts_to_file,
    format_alerts_report,
    GitHubSecurityError,
)

alerts = check_github_alerts(repo="ywatanabe1989/myrepo")
print(format_alerts_report(alerts))
save_alerts_to_file(alerts, output_dir=".scitex/security/runtime")
CLI
scitex-security check ywatanabe1989/myrepo
scitex-security show-latest --security-dir ~/.scitex/security/runtime

Look-alike domain watch

Finds registered typo / homograph (e.g. Cyrillic с for Latin c) / TLD-swap / affix look-alikes of a domain you own, with their MX records (can they send mail as you?), Certificate Transparency certificates and RDAP registration dates. Remembers what it saw and alerts only on new registrations, new MX records and new certificates.

scitex-security domains list-candidates example.org          # offline: what would be checked
scitex-security domains watch example.org example.net   # table of registered look-alikes
scitex-security domains watch example.org --notify      # + mail new events (pip install 'scitex-security[notify]')
from scitex_security.domains import watch_domains

result = watch_domains(["example.org"])
for report in result["reports"]:
    print(report.domain, [(h["risk"], h["name"], h["mx"]) for h in report.hits])

Daily systemd user units: examples/systemd/.

Password store

A GPG store encrypted to every recipient host's public key. stdout is the secret only (byte-exact), every diagnostic goes to stderr, and a secret never appears on a command line.

printf '%s' "$X" | scitex-security secret encrypt -t service.gpg   # or -f FILE (chmod 600)
PW="$(scitex-security secret decrypt -t service.gpg)"
scitex-security secret decrypt -t service -o ~/.private/service.secret  # fresh 0600 file
scitex-security secret list [PATTERN] [-a]
scitex-security secret list-recipients

Store: $PW_DIR (exclusive) or ~/.pw; recipients: $PW_REPO/src/.gnupg.d/<host>/fingerprint. See the 09_password-store skill.

Just-in-time grants

A restricted secret is encrypted only to a keeper's key, not to the host keys. An agent asks for it with a reason and a duration, the operator approves by a verified reply carrying a one-time code, and the keeper releases it to that caller until the grant expires. Every step is audited.

printf '%s' "$X" | scitex-security secret encrypt --restricted -t dns-admin.gpg
scitex-security secret request dns-admin --reason "rotate the MX record" --ttl 30m
scitex-security secret grant-status
scitex-security secret read-granted dns-admin | consumer --token-stdin
scitex-security secret revoke dns-admin

The keeper is scitex-security secret serve-grants, run as a dedicated account (examples/systemd/). Without it the caller is its own keeper, which records and expires grants but is not a barrier. See the 10_secret-grants skill for limits, approval channels and what this does not protect against.

Demo

flowchart LR
    user["scitex-security check\nywatanabe1989/myrepo"] --> api["check_github_alerts()"]
    env["GH_TOKEN /\nGITHUB_TOKEN"] -.-> gh["gh CLI subprocess"]
    api --> gh
    gh --> dep["Dependabot alerts"]
    gh --> sec["secret-scanning alerts"]
    gh --> code["code-scanning alerts"]
    dep --> report["format_alerts_report()"]
    sec --> report
    code --> report
    report --> stdout[("terminal report")]
    report --> save["save_alerts_to_file()"]
    save --> json[(".scitex/security/runtime/<ts>.txt")]

Quick Start

See the Python API block above for the minimal end-to-end example.

Environment Variables

Variable Purpose Default
SCITEX_SECURITY_CONFIG Path to a YAML config file (overrides ~/.scitex/security/config.yaml). unset
SCITEX_SECURITY_DIR Override the alerts output directory (overrides project/user scope). unset (uses <project>/.scitex/security/runtime/ or ~/.scitex/security/runtime/)
SCITEX_DIR Relocate the user-scope root (e.g. /mnt/fast-ssd/scitex). ~/.scitex
GH_TOKEN / GITHUB_TOKEN Auth token used by the underlying gh CLI subprocess. unset

Config precedence: explicit path → $SCITEX_SECURITY_CONFIG → ~/.scitex/security/config.yaml → built-in defaults. Alert output precedence: --output-dir / --security-dir → $SCITEX_SECURITY_DIR → project scope → user scope (respects $SCITEX_DIR).

Status

Standalone fork of scitex.security. Runtime deps: click, dnspython, scitex-logging (+ gh CLI; scitex-notification for [notify]). Umbrella scitex.security import path is preserved via a sys.modules-alias bridge.

Part of SciTeX

scitex-security is part of SciTeX. Install via the umbrella with pip install scitex[security] to use as scitex.security (Python) or scitex security ... (CLI).

Four Freedoms for Research

  1. The freedom to run your research anywhere — your machine, your terms.
  2. The freedom to study how every step works — from raw data to final manuscript.
  3. The freedom to redistribute your workflows, not just your papers.
  4. The freedom to modify any module and share improvements with the community.

AGPL-3.0 — because we believe research infrastructure deserves the same freedoms as the software it runs on.

License

AGPL-3.0-only (see LICENSE).


SciTeX

Metadata

Release files for scitex-security 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scitex-security 0.6.0
File Size Uploaded Provenance Actions
scitex_security-0.6.0.tar.gz 172.3 kB Without provenance Details for scitex_security-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scitex-security 0.6.0
File Interpreter ABI Platform Actions
scitex_security-0.6.0-py3-none-any.whl Python 3 none any Details for scitex_security-0.6.0-py3-none-any.whl

Total release size: 382.3 kB

Release files / scitex_security-0.6.0.tar.gz

Download URL scitex_security-0.6.0.tar.gz
Size 172.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d4aab7fc93ae715a026181a712f53335ff5c164a342c9c4bc1a052a5e41d7ee2
BLAKE2b-256 checksum
How to use checksums
c3f5b705a82280ac1be14395cdf27205f38464712bedd1f9d255ecbe42a26c5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / scitex_security-0.6.0-py3-none-any.whl

Download URL scitex_security-0.6.0-py3-none-any.whl
Size 210.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f20fba4061ff97c0a8441882a6a21cc1a94413e832c33056adda8b154ceb7ff8
BLAKE2b-256 checksum
How to use checksums
54b99ee474b6dcdca29f3dfb41022233c22598c5cdc92c6d0189a369db9a6a6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.14

Security for scitex-security 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page