Skip to main content
Loss of provenance

A previous release had provenance metadata, but this release does not. View details.

StayAwakeBot

Supply-chain worm hunting for developer machines and CI.

PyPI Python versions License

Sponsor saw on GitHub

saw is free and open source. If it protects your machines, your repositories or your organisation, consider sponsoring its development.


A single compromised dependency is how one package becomes an organisation-wide incident. Self-propagating packages spread through installs, builds and merges — arriving with code you asked for, and running before you ever read it.

saw hunts them where they land: repositories, lockfiles, installed packages, and the machine's start-up surface. It runs offline, out of the box. It removes what it confirms, opens the fix as a pull request, hardens the host and gates the merge.

Detect saw scan — repositories, lockfiles and installed dependency trees; read-only. saw hook — each clone, pull, switch, rebase and push. saw audit — this machine and a repository's branch protection, ending with a rotation-safety verdict.
Remediate saw fix — clears a confirmed infection from your checkout and prepares the cleanup branch; --pr opens it as a pull request. saw fix amend replaces past commits that still carry the payload. saw discard undoes the branch.
Prevent saw harden — protections on this machine, each checked once it is written. saw guard — the CI gate that blocks an infected merge.
Advisories saw db — the offline advisory corpus for CVE and malicious-package matching.

Quick start

Prerequisites: Python 3.11+ — see Your first scan.

pip install stayawakebot

Or the latest from source:

pip install "stayawakebot @ git+https://github.com/Ndevu12/stayAwakeBot@main"

Then hunt. Each of these stands alone:

Scan every repository under your home folder:

saw scan

Or only the folder you are in:

saw scan .

Or sweep every repository under a path:

saw scan ~/dev

Scan with your own allowlist, rather than the packaged defaults:

saw scan --config config/security.yml

Check the machine itself, not a repository — credential hygiene and start-up entries:

saw audit

New here? saw intro is a 60-second tour, and saw search "…" finds the command you want.

The distribution is published as stayawakebot; the security CLI is the terse saw command (see the CLI reference).

Gate the merge

saw guard writes the CI gate, keeps it pinned, and proves branch protection requires it.

Every repository you own should refuse an infected merge. saw guard writes that GitHub Actions workflow, keeps it pinned, and proves it is enforced — for one repository or a whole organisation. Each command below stands alone; reach for the one you need.

Set it up. Writes the gate here, for you to review and commit:

saw guard setup

Or raise it as a pull request:

saw guard setup --pr

Check that a repository is actually guarded — present, SHA-pinned, current, and required:

saw guard check

Check a whole organisation, failing if any repository lacks a required gate:

saw guard check --org your-org -f

saw guard setup surgically pin-bumps a gate that already exists rather than replacing it, and never clobbers a workflow installed by some other means. saw guard check goes further than "is the file there" — it verifies branch protection actually requires the check, because a gate that is not required is decoration.

Both sweep many repositories at once (--remote / --user / --org), like saw scan and saw fix. See the CLI reference.

The workflow, by hand

A minimal equivalent, if you would rather write it yourself than run saw guard setup. The installed file is not identical — it also carries a weekly pin-drift job and prefers a GH_SECURITY_TOKEN secret — so run saw guard setup --dry-run to see exactly what it would write. Save it as .github/workflows/worm-scan.yml:

name: Worm scan

on:
  push:
    branches: [main]
  pull_request:

permissions:
  contents: read
  pull-requests: write
  security-events: write

jobs:
  saw-guard:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          fetch-depth: 0

      - uses: Ndevu12/SAW_GUARD@7d3ef571f0094c223902fcfc500838abc46e1d7b
        with:
          version: '0.17.2'
          pr-comment: true
          upload-sarif: true

The scan only reads: pull-requests: write lets it say what it found on the pull request (pr-comment), and security-events: write lets it put the findings in the Security tab (upload-sarif). saw guard setup puts remediation in a second job, so write access exists only on a run that already found something; see the CLI reference for the shape it installs. fetch-depth: 0 is required, because the scan reads the full history.

About the pins

Ndevu12/SAW_GUARD ("SAW Guard") is the public Action — a thin wrapper that installs the published stayawakebot scanner from PyPI.

Pin every action by commit SHA, including this one: a tag can be moved to point at different code after you have reviewed it, a SHA cannot. Here 7d3ef571… is SAW Guard v0.2.0 and 3d3c42e5… is actions/checkout v7.0.1. In production pin version: as well: it selects the stayawakebot release from PyPI, 0.17.2 here, and otherwise tracks whatever is latest at run time.

Other inputs: config-file to supply your own allowlist, fail-on to choose the verdict that fails the build (default infected), and upload-sarif to send findings to code scanning. See Harden a repository.

Run via Docker

Scan a mounted repository from the published image:

docker run --rm -v "$PWD:/repo:ro" ghcr.io/ndevu12/stayawakebot \
  saw scan /repo

To keep the report file too, mount a writable dir and run as your own user so the bind-mount is writable:

docker run --rm --user "$(id -u):$(id -g)" -v "$PWD:/repo" \
  ghcr.io/ndevu12/stayawakebot \
  saw scan /repo --reports-dir /repo/reports

Tags: :latest, :X.Y.Z, :X.Y, and :sha-<commit>. The image runs as a non-root user, is built from the same wheel published to PyPI, and ships SLSA provenance + SBOM attestations.

Also in the package

stayawakebot additionally ships a health sentinel — a URL/uptime availability monitor (HTTP status, latency, TLS and keyword checks) run with stayawake-health-check. It is independent of saw and shares only the packaging. See Configuration.

stayawake-health-check --config config/urls.yml

Documentation

saw-docs.ndevuspace.com — the full documentation, searchable and versioned.

License

stayAwakeBot is open-source software licensed under the Apache License, Version 2.0 — free for any use, including in closed-source and commercial products, provided you preserve the copyright and license notices. See LICENSE for the full text and NOTICE for attribution.

Metadata

Release files for stayawakebot 0.17.2

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

Loss of provenance

These files do not have provenance metadata, despite files in a prior release including this data.

We recommend further investigation before installing these files. View details.

Source distribution (sdist)

Source distribution for stayawakebot 0.17.2
File Size Uploaded Provenance Actions
stayawakebot-0.17.2.tar.gz 1.6 MB Without provenance Details for stayawakebot-0.17.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for stayawakebot 0.17.2
File Actions
stayawakebot-0.17.2-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for stayawakebot-0.17.2-py3-none-manylinux_2_17_x86_64.whl
stayawakebot-0.17.2-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for stayawakebot-0.17.2-py3-none-manylinux_2_17_aarch64.whl
stayawakebot-0.17.2-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for stayawakebot-0.17.2-py3-none-macosx_11_0_x86_64.whl
stayawakebot-0.17.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for stayawakebot-0.17.2-py3-none-macosx_11_0_arm64.whl

Total release size: 15.3 MB

Release files / stayawakebot-0.17.2.tar.gz

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL stayawakebot-0.17.2.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
8f415995c7800641010dd1b2b49c902896df237dc07f7c1f7791e9a88928be37
BLAKE2b-256 checksum
How to use checksums
80eb38a77e42d25afc56feb22c7675c7db5f293ec9b5c49a43b4cd4acdec9007
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / stayawakebot-0.17.2-py3-none-manylinux_2_17_x86_64.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL stayawakebot-0.17.2-py3-none-manylinux_2_17_x86_64.whl
Size 3.6 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
1eb0f35a915e14d7066a80c0f5c03324c84b9120bf903e9eb13907c2c3e2e41d
BLAKE2b-256 checksum
How to use checksums
35fe286a6cb01c00d65ab6e4c33fad4e1e244480c02942d70caa8a7875937b5d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / stayawakebot-0.17.2-py3-none-manylinux_2_17_aarch64.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL stayawakebot-0.17.2-py3-none-manylinux_2_17_aarch64.whl
Size 3.6 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
169a4e75abe4aaa069570ade098dc18c7c1a25c5abcc42ad6a8b67139aa9d7bc
BLAKE2b-256 checksum
How to use checksums
113b973d0083308ae3f3362b7eb5a237929d34b50931a7acb81ad137a218f591
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / stayawakebot-0.17.2-py3-none-macosx_11_0_x86_64.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL stayawakebot-0.17.2-py3-none-macosx_11_0_x86_64.whl
Size 3.3 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
8cf794cd161d43642356a1ef60b2a807992aaed83e906ace331dd77997e8ee23
BLAKE2b-256 checksum
How to use checksums
b389508147d946aaf4be9a01d004e99410b663f3c77409a7ee7e4229dec725cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / stayawakebot-0.17.2-py3-none-macosx_11_0_arm64.whl

Loss of provenance

This file belongs to a release without provenance metadata, despite a prior release including this data.

We recommend further investigation before installing this file. View details.

Download URL stayawakebot-0.17.2-py3-none-macosx_11_0_arm64.whl
Size 3.3 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3bbf48d8537c41a0c8265b4970be4ae0d016e24ca9f22f95f1f1633a60baca76
BLAKE2b-256 checksum
How to use checksums
e3191108c585f1454034a58f70d19fb1511d01e56c4483532a2d1b4a81169632
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for stayawakebot 0.17.2

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.

Loss of provenance

A previous release of these files had provenance metadata, but this release does not.

While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.

Release comparison

  • Removed 0.16.0 5 files With provenance
  • Added 0.17.2 5 files Without provenance

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.

Release history Release notifications | RSS feed

This release

0.17.2 This release

5 release files Loss of provenance

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