Skip to main content

Audit your website across four pillars: Privacy, Security, Accessibility, and Performance.

Project description

Polaris

A single CLI that audits your website across four pillars: Privacy, Security, Accessibility, and Performance.

pip install polaris-audit
polaris scan https://example.com
  POLARIS SCAN REPORT — example.com
  ──────────────────────────────────────────────

  Privacy        72/100  ██████████████░░░░░░  3 issues
  Security       89/100  █████████████████░░░  1 issue
  Accessibility  61/100  ████████████░░░░░░░░  7 issues
  Performance    84/100  ████████████████░░░░  2 issues

  Overall        76/100

  Critical: 2  |  Warning: 8  |  Info: 3

  → Full report: polaris-report-example.com.json

Most audit tools do one thing. Lighthouse does performance. pa11y does accessibility. Various GDPR scanners check cookies. Polaris checks all four in one pass — because in practice, you need to know about all of them before you ship.


What it actually checks

Privacy & GDPR Compliance

  • Cookie consent detection — finds consent banners, checks for pre-consent cookie violations (cookies set before the user clicks "accept")
  • Consent Management Platforms — detects Cookiebot, OneTrust, CookiePro, TrustArc, Usercentrics, CookieYes, Klaro
  • Third-party service classification — identifies 50+ services and categorizes them by GDPR consent requirements:
    • Essential (no consent needed): Cloudflare, CDNs, reCAPTCHA
    • Analytics (basic consent): Google Analytics, Plausible, Matomo, Hotjar, Clarity, FullStory
    • Marketing (explicit consent required): Facebook Pixel, Google Ads, LinkedIn Insight, Twitter Pixel, TikTok Pixel
    • Fonts (privacy concern — IP tracking): Google Fonts, Adobe Fonts
  • Privacy policy analysis — detects privacy policy links in 8 languages, validates content for required GDPR elements (data retention, subject rights, processing basis)
  • Consent quality — checks for pre-ticked boxes, withdrawal mechanisms, granularity of consent categories
  • Data subject rights — detects implementation of right to erasure, data portability, rectification, access
  • Data processing scope — identifies contact forms, login/registration, e-commerce, and assesses GDPR applicability

Security

  • HTTPS & SSL — validates certificate, checks expiry, detects TLS version, flags HTTP-to-HTTPS redirect issues
  • Security headers — checks for Strict-Transport-Security (HSTS), Content-Security-Policy (CSP), X-Frame-Options, X-Content-Type-Options, X-XSS-Protection, Referrer-Policy, Permissions-Policy
  • Mixed content — finds HTTP images, scripts, and stylesheets loaded on HTTPS pages
  • Cookie security — validates Secure, HttpOnly, and SameSite flags on cookies
  • Form security — detects forms POSTing sensitive data (passwords, emails) over HTTP

Accessibility (WCAG)

  • Document structure — page title, language attribute, heading hierarchy (skipped levels, multiple H1s)
  • Landmarks — semantic HTML (<main>, <nav>, <header>, <footer>) and ARIA roles
  • Images — missing or empty alt attributes on content images, SVG accessibility (<title>, <desc>)
  • Forms — inputs without labels, missing ARIA labeling, required field indicators, fieldset/legend structure, autocomplete attributes
  • Media — video without captions/controls, audio without transcripts, figures without figcaptions
  • Navigation — skip links, keyboard focus management, breadcrumbs
  • Color — color-only error/success indicators, contrast issues
  • Tables — missing headers, scope attributes, captions

Performance

  • Compression — checks for gzip/brotli content encoding
  • Caching — validates Cache-Control, Expires, ETag, Last-Modified headers on static resources
  • Images — flags unoptimized formats (PNG/JPG without WebP/AVIF alternatives)
  • JavaScript — counts render-blocking scripts (missing async/defer), detects unminified bundles
  • CSS — flags excess stylesheets, unminified CSS, large inline styles
  • Resource hints — checks for preload, prefetch, dns-prefetch on critical resources
  • Page weight — measures total page size, flags pages over 500KB

Usage

# Scan a single URL
polaris scan https://example.com

# Scan multiple URLs from a file
polaris scan --input urls.txt

# Choose output format
polaris scan https://example.com --format json
polaris scan https://example.com --format json -o report.json

# Enable JavaScript rendering (uses Playwright)
polaris scan https://example.com --js

# Verbose output with per-issue details
polaris scan https://example.com -v

# CI-friendly: exit with non-zero code if score is below threshold
polaris scan https://example.com --fail-under 80

Output formats

Terminal (default) — colored summary with scores and top issues.

JSON — full structured report with every check, suitable for CI pipelines and custom dashboards.

Installation

pip install polaris-audit

For JavaScript-rendered pages (SPAs, React apps, etc.):

pip install polaris-audit[js]
playwright install chromium

Requires Python 3.10+.


Why this exists

I built a full SaaS platform around this scanner — authentication, billing, dashboards, the works. Then I realized the scanner itself was the most useful part. So I stripped everything else away and released it as a CLI.

The privacy/GDPR checker in particular fills a gap. Most tools either do surface-level keyword matching ("does the page mention GDPR?") or cost hundreds per month. Polaris actually classifies your third-party services by consent tier, detects pre-consent violations, and validates consent mechanisms — the stuff that actually matters for compliance.

Non-goals

  • This is not a penetration testing tool. The security checks cover headers, SSL, and common misconfigurations. It won't find SQL injection or XSS vulnerabilities.
  • This is not Lighthouse. The performance checks are header and markup-based. It doesn't measure Core Web Vitals (LCP, FID, CLS) — use Lighthouse for that.
  • This is not a legal compliance certificate. The GDPR checks are technical indicators, not legal advice.

Use in CI/CD

# GitHub Actions example
- name: Audit website
  run: |
    pip install polaris-audit
    polaris scan https://staging.example.com --fail-under 75 --format json -o audit.json
# GitLab CI example
audit:
  script:
    - pip install polaris-audit
    - polaris scan $STAGING_URL --fail-under 75
  artifacts:
    paths:
      - polaris-report-*.json

Development

git clone https://github.com/polaris-audit/polaris-audit.git
cd polaris-audit
pip install -e ".[dev]"
polaris scan https://example.com

Contributing

Issues and PRs welcome. The checker architecture is modular — each pillar is a self-contained module, so adding new checks is straightforward.

License

MIT

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

polaris_audit-0.1.0.tar.gz (111.9 kB view details)

Uploaded Source

Built Distribution

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

polaris_audit-0.1.0-py3-none-any.whl (125.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: polaris_audit-0.1.0.tar.gz
  • Upload date:
  • Size: 111.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.6

File hashes

Hashes for polaris_audit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ca12dcc93122be63ea0295d3bf43fac6bd9675667edc5db3924ce93519bd81d1
MD5 8953248bb0589f6c65b40d10fdcdaaf5
BLAKE2b-256 0d775c615db4cb74d6b57c43dd803c8afb94a3e0090f7c374537b363d439333a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: polaris_audit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 125.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.6

File hashes

Hashes for polaris_audit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73f4da2ca5b515e0c8cf94f8a40e32d3316c4dd110f0eb271cb4231779cf1f65
MD5 c1ee8751ffd5b665abefb67cd60b606a
BLAKE2b-256 3dcab44c9c382e108b09216078656e8f0f2462b125287855d213fd44013b6d60

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