Skip to main content

🛡️ SafeScope

A safe, non-intrusive web security posture scanner.

Check HTTPS, TLS certificates, security headers, cookies and information leaks in seconds — from your terminal, your CI pipeline, a web page or Python code. Zero dependencies.

CI Real-world scans Python Dependencies License: MIT

🌐 Try it live: safescope-one.vercel.app

Quick start · Usage · Checks · Web app · CI · Limits · Docs · العربية

SafeScope HTML report

Why SafeScope?

Most small teams and solo developers ship websites without checking the basics: is HTTP redirected? Is HSTS on? Are session cookies HttpOnly? Is the server leaking PHP/7.4.3?

SafeScope answers those questions with passive checks only: a handful of normal GET requests and TLS handshakes, exactly like a browser. No fuzzing, no payloads, no exploitation — safe to run against production and easy to put in CI.

  • Actionable — every finding says why it matters and how to fix it, with references.
  • Honest — a test that could not run is reported as skipped, never as a pass; heuristic findings say confidence: medium.
  • Graded — a 0–100 score and an A+ → F grade (how it's computed).
  • Five output formats — console, JSON, Markdown, self-contained HTML and SARIF.
  • Many sites at once — scan a list of targets in parallel.
  • CI-ready — --fail-on medium exit codes and a ready-made GitHub Action.
  • Web app included — hardened against SSRF and DNS rebinding; deploy your own on Vercel.
  • Zero dependencies — pure Python standard library.

🚀 Quick start

Requires Python 3.10 or newer.

Linux / macOS

python3 -m venv .venv && source .venv/bin/activate
pip install git+https://github.com/Karim-Bazooka/SafeScope.git
safescope scan example.com

Windows (PowerShell)

python -m venv .venv
.venv\Scripts\activate
pip install git+https://github.com/Karim-Bazooka/SafeScope.git
safescope scan example.com

Try every finding safely against the bundled, deliberately misconfigured demo server:

git clone https://github.com/Karim-Bazooka/SafeScope.git && cd SafeScope
python examples/vulnerable_demo_server.py &          # http://127.0.0.1:8000
safescope scan http://127.0.0.1:8000 --skip tls
SafeScope v0.2.0
Target : http://127.0.0.1:8000/
Grade  :  F   score 5/100  (0.0s)

TRANSPORT
  FAIL HTTPS is not available [high]
       ↳ Serve the site over HTTPS (free certificates are available from
         Let's Encrypt).
HEADERS
  WARN CSP allows unsafe script sources [medium]
       · default-src * 'unsafe-inline' 'unsafe-eval'
  ...
Issues : 0 critical  1 high  6 medium  5 low  1 info

🧰 Usage

safescope scan example.com                                  # coloured console report
safescope scan example.com -f html -o report.html           # shareable HTML report
safescope scan example.com -f json -o scan.json             # machine readable
safescope scan example.com -f sarif -o safescope.sarif      # SARIF 2.1.0 (code scanning)
safescope scan a.com b.com --targets-file sites.txt         # several sites, 4 in parallel
safescope scan example.com --only headers,cookies           # run a subset of checks
safescope scan staging.example.com --fail-on medium         # exit 1 on medium+ findings
safescope scan example.com --max-time 20 --timeout 5        # time limits
safescope scan example.com --public-only                    # refuse private/internal targets
safescope report scan.json -f html -o report.html           # re-render a saved scan
safescope checks                                            # list the checks
safescope serve                                             # web UI on http://127.0.0.1:8000
Exit code Meaning
0 Scan finished, nothing at or above --fail-on
1 Findings at or above --fail-on
2 Usage error (bad URL, unknown check, bad report file…)
3 A target was unreachable (the others are still reported)

From Python:

from safescope import scan

result = scan("example.com")
print(result.grade, result.score)
for finding in result.problems:
    print(finding.severity.label, finding.id, finding.recommendation)

🔍 What it checks

Check ID Looks at
HTTPS & HSTS transport HTTPS availability, HTTP→HTTPS redirect, HTTPS→HTTP downgrade, HSTS presence, max-age, includeSubDomains
TLS & certificate tls Trusted chain and host name, expiry (warns at 30 days), negotiated protocol, TLS 1.0/1.1 still accepted, legacy-only servers
Security headers headers CSP (incl. unsafe-inline/unsafe-eval/wildcards), clickjacking protection, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, deprecated X-XSS-Protection
Cookie security cookies Secure, HttpOnly (session-like cookies), SameSite, SameSite=None without Secure
Information disclosure disclosure Version banners, CORS * with credentials, /.well-known/security.txt

Every finding has a stable ID such as headers.csp.missing. The full list, with severities, is in the check catalogue.

🌐 Web app

A public instance runs at https://safescope-one.vercel.app (it scores A+ when it scans itself). Run your own with safescope serve, or:

Deploy with Vercel

GET /api/scan?target=example.com              → JSON result
GET /api/scan?target=example.com&format=html  → full HTML report
GET /api/health                               → {"status": "ok"}

Because it accepts URLs from anyone, the web service is hardened: SSRF guard with DNS pinning on every connection and redirect, web ports only, 6 s per request and 25 s per scan, 4 concurrent scans per instance, 10 scans per minute per client, strict CSP and no CORS. Details and limits: security model, deployment.

⚙️ Use it in CI

# .github/workflows/security.yml
name: Security posture
on:
  schedule: [{ cron: "0 6 * * 1" }]   # every Monday
  workflow_dispatch:
jobs:
  safescope:
    runs-on: ubuntu-latest
    steps:
      - uses: Karim-Bazooka/SafeScope@v0.2.0
        with:
          target: https://staging.example.com
          fail-on: medium

The action writes a Markdown summary to the job page, exposes grade and score outputs and uploads the HTML and JSON reports as an artifact. For GitHub code scanning, see the SARIF example.

⚠️ What SafeScope is not

  • Not proof of security. A good grade means the passive checks passed — nothing more.
  • Not a penetration test. SafeScope does not look for application vulnerabilities such as XSS, SQL injection or broken authentication, and never sends attack payloads.
  • Only for authorised targets. Scan sites you own or have explicit permission to test (acceptable use).

📚 Documentation

Document What's inside
Check catalogue Every finding ID, status, severity and meaning
Architecture How the modules fit together, lifecycle of a scan
Security model SSRF and DNS rebinding protection, service limits, what is not promised
Scoring How the score and grade are computed
FAQ Common errors and how-tos
Writing a check Step-by-step guide for contributors
Deployment Vercel and self-hosting
Acceptable use Rules for scanning
Changelog What changed in each release

🗺️ Roadmap

  • v0.1 — five passive checks, four report formats, CLI, GitHub Action, web app
  • v0.2 — DNS-rebinding-safe web service, honest skipped results, confidence levels, multi-target scanning, SARIF, saved-report re-rendering, stricter CI
  • v0.3 — config file (safescope.toml) to accept known findings, baseline diff between scans
  • v0.4 — more passive checks: mixed content, subresource integrity, DNS (CAA), email (SPF/DMARC)
  • v1.0 — stable IDs and JSON schema, packages on PyPI, tracked grades over time

Ideas and votes are welcome in Issues.

🤝 Contributing

New checks, bug reports and docs improvements are welcome. The codebase is small, fully typed and has 150+ tests that run without internet. Start with CONTRIBUTING.md and issues labelled good first issue. To report a vulnerability in SafeScope itself, see SECURITY.md.

License

MIT © 2026 Karim

Metadata

Release files for safescope-scanner 0.2.1

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

Source distribution (sdist)

Source distribution for safescope-scanner 0.2.1
File Size Uploaded Provenance Actions
safescope_scanner-0.2.1.tar.gz 63.9 kB With provenance Details for safescope_scanner-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for safescope-scanner 0.2.1
File Interpreter ABI Platform Actions
safescope_scanner-0.2.1-py3-none-any.whl Python 3 none any Details for safescope_scanner-0.2.1-py3-none-any.whl

Total release size: 118.1 kB

Release files / safescope_scanner-0.2.1.tar.gz

Download URL safescope_scanner-0.2.1.tar.gz
Size 63.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b0ed4b02100b028cc9068f7311653ef75773189a8ce92422e75dbd01b10c2721
BLAKE2b-256 checksum
How to use checksums
436eee55f2dfd4c657734fbf3a2c51fffbbdf78cfbcadce3954001bdf44f509c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / safescope_scanner-0.2.1-py3-none-any.whl

Download URL safescope_scanner-0.2.1-py3-none-any.whl
Size 54.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a05bbe8fce7ec88355f77db04514acdcaf88c4ffc678ef7188c0753545b9189
BLAKE2b-256 checksum
How to use checksums
e51ec53bfb9cbcb0bf4dea6dbb8030ca833a81b4b40cd4811de48d19a7f6ed03
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for safescope-scanner 0.2.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for safescope_scanner-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

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.2.1 This release

2 release files Full 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