universal-dev-security 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. universal_dev_security-1.0.0/CHANGELOG.md +88 -0
  2. universal_dev_security-1.0.0/CODE_OF_CONDUCT.md +9 -0
  3. universal_dev_security-1.0.0/CONTRIBUTING.md +36 -0
  4. universal_dev_security-1.0.0/DEVELOPMENT_STATUS.md +86 -0
  5. universal_dev_security-1.0.0/LICENSE +163 -0
  6. universal_dev_security-1.0.0/MANIFEST.in +9 -0
  7. universal_dev_security-1.0.0/PKG-INFO +128 -0
  8. universal_dev_security-1.0.0/README.md +96 -0
  9. universal_dev_security-1.0.0/SECURITY.md +33 -0
  10. universal_dev_security-1.0.0/docs/architecture.md +55 -0
  11. universal_dev_security-1.0.0/docs/commands.md +89 -0
  12. universal_dev_security-1.0.0/docs/dashboard-design-system.md +56 -0
  13. universal_dev_security-1.0.0/docs/installation.md +90 -0
  14. universal_dev_security-1.0.0/docs/integrations.md +109 -0
  15. universal_dev_security-1.0.0/docs/release.md +32 -0
  16. universal_dev_security-1.0.0/docs/scanners.md +70 -0
  17. universal_dev_security-1.0.0/docs/security-model.md +46 -0
  18. universal_dev_security-1.0.0/policies/GLOBAL_SECURITY_POLICY.md +78 -0
  19. universal_dev_security-1.0.0/pyproject.toml +56 -0
  20. universal_dev_security-1.0.0/scripts/install.ps1 +74 -0
  21. universal_dev_security-1.0.0/scripts/install.sh +52 -0
  22. universal_dev_security-1.0.0/scripts/release.py +94 -0
  23. universal_dev_security-1.0.0/setup.cfg +4 -0
  24. universal_dev_security-1.0.0/src/universal_dev_security/__init__.py +3 -0
  25. universal_dev_security-1.0.0/src/universal_dev_security/__main__.py +4 -0
  26. universal_dev_security-1.0.0/src/universal_dev_security/cli.py +376 -0
  27. universal_dev_security-1.0.0/src/universal_dev_security/cli_extra.py +244 -0
  28. universal_dev_security-1.0.0/src/universal_dev_security/config.py +171 -0
  29. universal_dev_security-1.0.0/src/universal_dev_security/detector.py +201 -0
  30. universal_dev_security-1.0.0/src/universal_dev_security/engine.py +203 -0
  31. universal_dev_security-1.0.0/src/universal_dev_security/findings.py +199 -0
  32. universal_dev_security-1.0.0/src/universal_dev_security/fixes.py +138 -0
  33. universal_dev_security-1.0.0/src/universal_dev_security/gitguard.py +269 -0
  34. universal_dev_security-1.0.0/src/universal_dev_security/history.py +149 -0
  35. universal_dev_security-1.0.0/src/universal_dev_security/initializer.py +112 -0
  36. universal_dev_security-1.0.0/src/universal_dev_security/integrations/__init__.py +46 -0
  37. universal_dev_security-1.0.0/src/universal_dev_security/integrations/agents.py +45 -0
  38. universal_dev_security-1.0.0/src/universal_dev_security/integrations/claude_code.py +192 -0
  39. universal_dev_security-1.0.0/src/universal_dev_security/integrations/github.py +149 -0
  40. universal_dev_security-1.0.0/src/universal_dev_security/integrations/vscode.py +44 -0
  41. universal_dev_security-1.0.0/src/universal_dev_security/policy.py +384 -0
  42. universal_dev_security-1.0.0/src/universal_dev_security/projectfiles.py +80 -0
  43. universal_dev_security-1.0.0/src/universal_dev_security/recovery.py +168 -0
  44. universal_dev_security-1.0.0/src/universal_dev_security/redaction.py +132 -0
  45. universal_dev_security-1.0.0/src/universal_dev_security/reports.py +466 -0
  46. universal_dev_security-1.0.0/src/universal_dev_security/scanner.py +36 -0
  47. universal_dev_security-1.0.0/src/universal_dev_security/scanners/__init__.py +36 -0
  48. universal_dev_security-1.0.0/src/universal_dev_security/scanners/base.py +269 -0
  49. universal_dev_security-1.0.0/src/universal_dev_security/scanners/gitleaks.py +132 -0
  50. universal_dev_security-1.0.0/src/universal_dev_security/scanners/osv.py +156 -0
  51. universal_dev_security-1.0.0/src/universal_dev_security/scanners/semgrep.py +130 -0
  52. universal_dev_security-1.0.0/src/universal_dev_security/scanners/trivy.py +139 -0
  53. universal_dev_security-1.0.0/src/universal_dev_security/testing.py +100 -0
  54. universal_dev_security-1.0.0/src/universal_dev_security/updates.py +84 -0
  55. universal_dev_security-1.0.0/src/universal_dev_security.egg-info/PKG-INFO +128 -0
  56. universal_dev_security-1.0.0/src/universal_dev_security.egg-info/SOURCES.txt +76 -0
  57. universal_dev_security-1.0.0/src/universal_dev_security.egg-info/dependency_links.txt +1 -0
  58. universal_dev_security-1.0.0/src/universal_dev_security.egg-info/entry_points.txt +2 -0
  59. universal_dev_security-1.0.0/src/universal_dev_security.egg-info/requires.txt +3 -0
  60. universal_dev_security-1.0.0/src/universal_dev_security.egg-info/top_level.txt +1 -0
  61. universal_dev_security-1.0.0/tests/fakes.py +12 -0
  62. universal_dev_security-1.0.0/tests/fixtures/osv-scanner-2.7.1.json +590 -0
  63. universal_dev_security-1.0.0/tests/fixtures/trivy-0.76.2.json +364 -0
  64. universal_dev_security-1.0.0/tests/test_cli.py +115 -0
  65. universal_dev_security-1.0.0/tests/test_config.py +56 -0
  66. universal_dev_security-1.0.0/tests/test_detector.py +67 -0
  67. universal_dev_security-1.0.0/tests/test_exposure.py +110 -0
  68. universal_dev_security-1.0.0/tests/test_gitguard.py +133 -0
  69. universal_dev_security-1.0.0/tests/test_history.py +69 -0
  70. universal_dev_security-1.0.0/tests/test_initializer.py +19 -0
  71. universal_dev_security-1.0.0/tests/test_integrations.py +213 -0
  72. universal_dev_security-1.0.0/tests/test_policy.py +156 -0
  73. universal_dev_security-1.0.0/tests/test_recovery_fixes.py +165 -0
  74. universal_dev_security-1.0.0/tests/test_redaction.py +37 -0
  75. universal_dev_security-1.0.0/tests/test_redos.py +53 -0
  76. universal_dev_security-1.0.0/tests/test_reports.py +169 -0
  77. universal_dev_security-1.0.0/tests/test_scanner.py +383 -0
  78. universal_dev_security-1.0.0/tests/test_scanner_fixtures.py +47 -0
@@ -0,0 +1,88 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
5
+ Semantic Versioning (PEP 440 pre-release suffixes).
6
+
7
+ ## [1.0.0] — 2026-11-14
8
+
9
+ First stable release. Includes everything in 1.0.0rc1 plus improvements from the
10
+ first live scan of a real Next.js project and live verification of the Claude Code hook.
11
+
12
+ ### Added
13
+ - Secret findings record Git exposure (`tracked_in_git`): committed and shared, or local only.
14
+ Recommendations and the dashboard (`in Git` / `local only` tags) distinguish them; only
15
+ committed or unknown secrets are reported as urgent rotations.
16
+ - Scan comparisons warn when the scan scope (exclusions) changed, because findings shown as
17
+ "resolved" may have been excluded rather than fixed (`scope_fingerprint`).
18
+
19
+ ### Changed
20
+ - Findings are ordered by priority: committed secrets first, then severity (critical → unclassified).
21
+ - Secret scanning excludes framework caches and dev-server builds (`.next/cache`, `.next/dev`,
22
+ `.turbo`, `.parcel-cache`, `.angular/cache`); deployable output (`.next/static`,
23
+ `.next/server`) is still scanned. On the test project this removed 97% of noise (708 → 29).
24
+
25
+ ### Fixed
26
+ - The scanner coverage table showed `0` findings for scanners that did not run; it now shows `—`.
27
+ - `uds integrate claude-code --python-path` printed a note saying the hook runs `uds` from PATH.
28
+
29
+ ### Verified
30
+ - Claude Code hook verified in live Claude Code 2.1.323 sessions; documented that Claude Code
31
+ runs project hooks only in trusted workspaces.
32
+ - CI: Windows, Linux and macOS × Python 3.11–3.14 plus real-scanner integration.
33
+
34
+ ## [1.0.0rc1] — 2026-11-14 (GitHub pre-release)
35
+
36
+ ### Added
37
+ - **Policy engine** (`policy.py`): immutable global rules returning allow / ask / deny with risk
38
+ and reasons; project configuration can only add restrictions; strict mode; `uds policy show|check`.
39
+ - **Configuration loader** with validation and warnings; mandatory settings cannot be disabled;
40
+ Gitleaks cannot be disabled.
41
+ - **Scanner adapters** for Semgrep, OSV-Scanner (v1 and v2 CLI) and Trivy alongside Gitleaks, with
42
+ executable discovery, version detection, compatibility checks, applicability detection, and the
43
+ states clean / findings / not_installed / not_applicable / skipped / error.
44
+ - **Unified findings schema** with severity provenance (`severity_source`), CVSS qualitative scale
45
+ mapping, stable fingerprints and http(s)-only references.
46
+ - **Reports:** JSON schema 2.0, SARIF 2.1.0, and a redesigned dark dashboard with severity cards,
47
+ recommendations, scanner coverage, privacy notes, searchable/filterable finding details,
48
+ scan history, scan comparison and JSON/HTML export; hash-based Content-Security-Policy.
49
+ - **Scan history and comparison** (`uds history`, `uds compare`, `uds report`, `uds dashboard`).
50
+ - **Technology detection** for Python, JavaScript, TypeScript, Node.js, React, Next.js, PHP,
51
+ WordPress, WooCommerce, Java, .NET, Go, Rust, Ruby, Docker, Terraform and Kubernetes, with
52
+ evidence and scanner/rule-pack profiles; nested projects supported.
53
+ - **Git protection:** `uds hooks install|uninstall|status`; fail-closed pre-commit and pre-push
54
+ hooks using Gitleaks with a built-in fallback; foreign hooks and `core.hooksPath` respected.
55
+ - **Claude Code integration:** `PreToolUse` hook (Bash, PowerShell, Write, Edit, MultiEdit,
56
+ NotebookEdit, Read) that never auto-approves and fails closed; settings merge/removal.
57
+ - **Generic agent protocol:** `uds guard` (JSON in, decision out, documented exit codes).
58
+ - **GitHub integration:** generated least-privilege PR workflow with checksum-verified scanners
59
+ and SARIF upload. **VS Code** tasks integration.
60
+ - **Recovery engine:** checkpoints, atomic writes, rollback that preserves later user edits.
61
+ - **Automatic fixes:** risk-tiered, reversible, verified by baseline and post-change test runs
62
+ with automatic rollback. **Testing engine** for pytest, npm, .NET, Maven, Gradle, Go, Cargo, PHPUnit.
63
+ - **Update manager:** explicit, HTTPS-only update checks; scanner version status.
64
+ - **Release tooling:** `scripts/release.py`, user-level installers with checksum verification
65
+ (`scripts/install.ps1`, `scripts/install.sh`).
66
+ - Cross-platform CI matrix (Windows, Linux, macOS × Python 3.11–3.14) and a real-scanner job.
67
+
68
+ ### Changed
69
+ - `uds scan` runs all enabled, applicable scanners and prints a readable summary (`--json` for
70
+ machine output). Exit codes: 0 success, 1 threshold reached, 2 error / not scanned.
71
+ - Reports use project-relative paths and are written with LF line endings.
72
+ - `pyproject.toml` uses an SPDX license expression and a single-sourced version.
73
+
74
+ ### Fixed
75
+ - .NET projects were never detected (`.sln`/`.csproj` were compared with whole file names).
76
+ - Scan and checkpoint ids now include microseconds so rapid successive scans keep their order.
77
+ - Security audit: unbounded regular expressions allowed catastrophic backtracking (ReDoS) on
78
+ crafted input; all patterns are now bounded and oversized commands require approval.
79
+
80
+ ### Security
81
+ - Raw scanner output and secret values never reach output, reports, history or hook messages.
82
+ - Windows batch-file scanner wrappers are refused (argument injection risk).
83
+
84
+ ## [0.4.1] and earlier
85
+
86
+ No changelog was kept before 1.0.0rc1. Version 0.4.1 provided the CLI (`doctor`, `detect`,
87
+ `init`, `status`, `scan`), marker-based detection, safe initialization, the global policy
88
+ document, a Gitleaks directory-scan adapter, sanitized JSON reports and the dark HTML report.
@@ -0,0 +1,9 @@
1
+ # Code of Conduct
2
+
3
+ We are committed to a welcoming, respectful, and harassment-free community.
4
+ Be respectful, assume good faith, focus on constructive technical discussion,
5
+ accept responsibility for mistakes, and prioritize user safety and privacy.
6
+
7
+ Harassment, discrimination, doxxing, threats, and publishing private
8
+ information without permission are unacceptable. Maintainers may remove
9
+ content or restrict participation for violations.
@@ -0,0 +1,36 @@
1
+ # Contributing
2
+
3
+ Thanks for your interest in Universal Dev Security.
4
+
5
+ ## Ground rules
6
+
7
+ - Discuss substantial changes in an issue before implementing them.
8
+ - Never include real credentials, tokens, private keys, customer data or production data.
9
+ - Secret fixtures must be clearly fake **and assembled at runtime** (see `tests/fakes.py`) so
10
+ that secret scanners running on this repository do not flag the test suite.
11
+ - Do not weaken mandatory global security policies. Policy changes need a test that shows the
12
+ intended decision and must keep every existing global rule at least as strict.
13
+ - Never invent severities or scores. Map severity only from scanner data or a published standard,
14
+ and record the provenance in `severity_source`.
15
+ - Never print, log or persist raw scanner output or secret values.
16
+ - Run external programs only through `scanners.base.run_tool()` (argument list, no shell).
17
+ - Keep regular expressions bounded; add a case to `tests/test_redos.py` for new patterns.
18
+
19
+ ## Development setup
20
+
21
+ ```bash
22
+ python -m venv .venv
23
+ .venv/bin/python -m pip install -e ".[dev]" # Windows: .venv\Scripts\python
24
+ .venv/bin/python -m pytest -q
25
+ ```
26
+
27
+ Tests that need Git or Gitleaks are skipped automatically when those tools are absent; CI runs
28
+ them with real scanners on Linux.
29
+
30
+ ## Pull requests
31
+
32
+ Explain the problem, affected modules, test results and security implications. Add tests for new
33
+ behavior and for every bug fix (regression test). Do not modify tests to hide implementation bugs,
34
+ and do not claim a scan or test passed unless it was actually run.
35
+
36
+ All contributions are licensed under Apache-2.0.
@@ -0,0 +1,86 @@
1
+ # Development Status
2
+
3
+ **Current version:** `1.0.0` — first stable release (tag `v1.0.0`). Previous: `1.0.0rc1` GitHub pre-release.
4
+ **Last updated:** 2026-11-14
5
+ **Previous version:** 0.4.1 (original source archived at `dist/uds-0.4.1-original-source-backup.zip`, git-ignored)
6
+
7
+ ## Milestones
8
+
9
+ | # | Milestone | Status | Acceptance evidence |
10
+ |---|---|---|---|
11
+ | 1 | Core foundation and policy engine | ✅ Complete | `test_policy.py`, `test_config.py`, `test_redaction.py` |
12
+ | 2 | Scanner integrations | ✅ Complete (see known issue 1) | `test_scanner.py`; real Gitleaks 8.30.1, OSV-Scanner 2.7.1, Trivy 0.76.2 runs; `test_scanner_fixtures.py` from real output |
13
+ | 3 | Unified findings schema and reporting | ✅ Complete | `test_reports.py` (schema, SARIF, escaping, CSP hash, no secrets) |
14
+ | 4 | Dark dashboard and scan history | ✅ Complete (see known issue 4) | `test_reports.py`, `test_history.py`, end-to-end CLI test |
15
+ | 5 | Claude Code and AI integrations | ✅ Complete — live-verified | `test_integrations.py`; live Claude Code 2.1.323 sessions (see test results) |
16
+ | 6 | Git protection and GitHub Actions | ✅ Complete (see known issue 2) | `test_gitguard.py` incl. a real `git commit` blocked by the installed hook; workflow YAML validated |
17
+ | 7 | Automatic fixes, testing and recovery | ✅ Complete | `test_recovery_fixes.py`; real rollback used to remove the integration from a real project without conflicts |
18
+ | 8 | Technology profiles and compatibility | ✅ Complete | `test_detector.py` (17 technologies, nested projects, exclusions) |
19
+ | 9 | Installer, updates and release management | ✅ Complete | `scripts/release.py` run end-to-end; `install.ps1` install + tampered-checksum rejection tested |
20
+ | 10 | Cross-platform compatibility | ✅ Complete | GitHub Actions run 43534444713: all 12 matrix jobs (Windows/Linux/macOS × Python 3.11–3.14) passed |
21
+ | 11 | Production readiness / release preparation | ✅ Complete | Security audit below; 1.0.0rc1 pre-release, live verification, 1.0.0 built in `dist/1.0.0/` |
22
+
23
+ ## Test results (actually executed)
24
+
25
+ | Environment | Result |
26
+ |---|---|
27
+ | Windows 11, Python 3.15.2 (project `.venv`) | **196 passed, 1 skipped** (PyYAML has no Python 3.15 wheel; YAML test skipped) |
28
+ | Windows 11, Python 3.14.7 (separate tools venv) | **197 passed** |
29
+ | Real Gitleaks 8.30.1 | Integration tests ran (directory scan, staged, outgoing commits, hook end-to-end) |
30
+ | Real OSV-Scanner 2.7.1 / Trivy 0.76.2 | Run through UDS on a sample vulnerable project: 29 and 16 findings, correctly normalized |
31
+ | `scripts/release.py` | Tests ✓, self-scan ✓, sdist+wheel ✓, SHA256SUMS ✓, fresh-venv install + CLI smoke test ✓ |
32
+ | `scripts/install.ps1` | Installs with checksum verification ✓; tampered checksum rejected, nothing installed ✓ |
33
+ | Self-scan (`uds scan . --allow-network`) | Gitleaks, OSV-Scanner, Trivy: clean. Semgrep: not run (known issue 1) → status `incomplete` |
34
+ | Live scan of a real Next.js project (maintainer's own) | All scanners except Semgrep ran; 0 secrets in Git-tracked files; dashboard reviewed visually by the maintainer. Revealed 4 issues (noise from `.next` caches, alarmist rotation advice for local-only secrets, severity ordering, misleading `0` for scanners that did not run) and a 5th (scope changes shown as "resolved") — all fixed with regression tests (`test_exposure.py`) |
35
+ | Live Claude Code hook test (2.1.323, headless sessions in a throwaway repo, tools pre-allowed) | `git status` untouched; `git commit --no-verify` **denied** (`UDS: [git-hook-bypass]`); Write of a fake AWS key **denied** (`UDS: [secret-in-file]`, value not echoed); `git -C . push`, `rm -rf build`, Read `.env.*` **required approval** with UDS reasons; `git push` also stopped by the UDS `permissions.ask` rule; edits to `.claude/settings.local.json` stopped by Claude Code's own safety check first. No blocked action changed the repository. Pre-flight: hook command 16/16 in Git Bash and cmd. Finding: project hooks do not run in sessions with `CLAUDE_CODE_IGNORE_PERSISTED_TRUST` (documented) |
36
+ | GitHub Actions (commit 760cf4b) | **13/13 jobs passed**: Windows, Ubuntu, macOS × Python 3.11, 3.12, 3.13, 3.14, plus the real-scanner job (Gitleaks 8.30.1, OSV-Scanner 2.7.1, Trivy 0.76.2, Semgrep from PyPI; tests + `uds doctor` + self-scan with `--allow-network --fail-on high`) |
37
+
38
+ ## Security audit (1.0.0rc1)
39
+
40
+ | Check | Result |
41
+ |---|---|
42
+ | Exposed credentials / hardcoded secrets | Gitleaks clean on the repository; test secrets are assembled at runtime |
43
+ | Unsafe subprocess execution | Two call sites, both argument lists with `shell=False`, validated executables, timeouts; `.bat/.cmd` scanners refused |
44
+ | Command injection | Hook scripts embed only allow-listed interpreter paths; workflow generator validates every input; Git ranges/remotes validated |
45
+ | Path traversal | Recovery, history and scan ids validated; identical rejection rules on all OSes (fixed during audit) |
46
+ | Unsafe automatic fixes | Low risk only by default; checkpoint + baseline/post-change tests + automatic rollback |
47
+ | Dependency vulnerabilities | No runtime dependencies; OSV-Scanner and Trivy clean on the repository |
48
+ | Insecure report generation | Escaping, http(s)-only links, script-safe embedded JSON, hash-based CSP, no external resources |
49
+ | Missing permission checks | Mandatory policy settings cannot be disabled; security-control files require approval |
50
+ | Incomplete error handling | Fail-closed hooks; scanner errors become `error` state with suppressed output |
51
+ | **Found and fixed:** ReDoS | Unbounded regexes took > 10 minutes on crafted input; now < 1 s (regression tests in `test_redos.py`) |
52
+ | **Found and fixed:** HTTPS downgrade | Update check could follow redirects to HTTP; redirects are now HTTPS-only |
53
+
54
+ ## Known issues
55
+
56
+ 1. **Semgrep verified in CI only.** Semgrep could not be installed locally (PyPI network errors).
57
+ In CI it was installed and the self-scan (which runs Semgrep on this Python repository and fails
58
+ on scanner errors or high findings) passed. Its detailed output was not reviewed locally because
59
+ job logs and artifacts require GitHub authentication.
60
+ 2. **Generated user workflow not yet run on GitHub.** The project's own CI ran green; the
61
+ `uds integrate github` template is YAML-validated and mirrors the CI install steps, but has not
62
+ been run in a user repository.
63
+ 3. **Claude Code hook: live-verified in headless sessions only.** Interactive approval prompts were
64
+ not exercised (headless mode turns "ask" into a denial). The hook needs `uds` on PATH unless
65
+ `--python-path` is used, and runs only in workspaces Claude Code trusts.
66
+ 4. ~~Dashboard not visually reviewed~~ — reviewed by the maintainer on a real project (2026-11-14).
67
+ 5. `install.sh` is written for Linux/macOS and has not been executed.
68
+ 6. Python 3.15 is newer than some packages support (PyYAML, Semgrep wheels); UDS itself is
69
+ dependency-free and works on 3.11–3.15.
70
+ 7. `uds update check --source pypi` will only be meaningful once UDS is published under that name;
71
+ until then use `--source github:OWNER/REPO`.
72
+
73
+ ## Pending decisions (need maintainer approval)
74
+
75
+ - Publishing the `v1.0.0` GitHub release (tag pushed; assets uploaded by the maintainer).
76
+ - PyPI publication (not done).
77
+ - Private vulnerability reporting is enabled (verified via API); secret-scanning push protection
78
+ was enabled by the maintainer but cannot be verified without repository-admin authentication.
79
+
80
+ ## Next development tasks
81
+
82
+ 1. Review the CI self-scan artifact (Semgrep findings) and run the generated workflow in a sample repository.
83
+ 2. Exercise the interactive Claude Code approval prompt once (headless verification is done).
84
+ 3. Pin GitHub Actions to commit SHAs in both workflows.
85
+ 4. Optional offline mode for OSV-Scanner (local databases) to avoid sending package metadata.
86
+ 5. Hosted web dashboard consuming report schema 2.0 (with authentication and authorization).
@@ -0,0 +1,163 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the
13
+ copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other
16
+ entities that control, are controlled by, or are under common control with
17
+ that entity. For the purposes of this definition, "control" means (i) the
18
+ power, direct or indirect, to cause the direction or management of such
19
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent
20
+ (50%) or more of the outstanding shares, or (iii) beneficial ownership of
21
+ such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
24
+ permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation source,
28
+ and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical transformation
31
+ or translation of a Source form, including but not limited to compiled
32
+ object code, generated documentation, and conversions to other media types.
33
+
34
+ "Work" shall mean the work of authorship, whether in Source or Object form,
35
+ made available under the License, as indicated by a copyright notice that
36
+ is included in or attached to the work (an example is provided in the
37
+ Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object form,
40
+ that is based on (or derived from) the Work and for which the editorial
41
+ revisions, annotations, elaborations, or other modifications represent, as
42
+ a whole, an original work of authorship. For the purposes of this License,
43
+ Derivative Works shall not include works that remain separable from, or
44
+ merely link (or bind by name) to the interfaces of, the Work and Derivative
45
+ Works thereof.
46
+
47
+ "Contribution" shall mean any work of authorship, including the original
48
+ version of the Work and any modifications or additions to that Work or
49
+ Derivative Works thereof, that is intentionally submitted to Licensor for
50
+ inclusion in the Work by the copyright owner or by an individual or Legal
51
+ Entity authorized to submit on behalf of the copyright owner. For the
52
+ purposes of this definition, "submitted" means any form of electronic,
53
+ verbal, or written communication sent to the Licensor or its representatives,
54
+ including but not limited to communication on electronic mailing lists,
55
+ source code control systems, and issue tracking systems that are managed by,
56
+ or on behalf of, the Licensor for the purpose of discussing and improving
57
+ the Work, but excluding communication that is conspicuously marked or
58
+ otherwise designated in writing by the copyright owner as "Not a Contribution."
59
+
60
+ "Contributor" shall mean Licensor and any individual or Legal Entity on
61
+ behalf of whom a Contribution has been received by Licensor and subsequently
62
+ incorporated within the Work.
63
+
64
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
65
+ License, each Contributor hereby grants to You a perpetual, worldwide,
66
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
67
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
68
+ sublicense, and distribute the Work and such Derivative Works in Source or
69
+ Object form.
70
+
71
+ 3. Grant of Patent License. Subject to the terms and conditions of this
72
+ License, each Contributor hereby grants to You a perpetual, worldwide,
73
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
74
+ this section) patent license to make, have made, use, offer to sell, sell,
75
+ import, and otherwise transfer the Work, where such license applies only
76
+ to those patent claims licensable by such Contributor that are necessarily
77
+ infringed by their Contribution(s) alone or by combination of their
78
+ Contribution(s) with the Work to which such Contribution(s) was submitted.
79
+ If You institute patent litigation against any entity (including a
80
+ cross-claim or counterclaim in a lawsuit) alleging that the Work or a
81
+ Contribution incorporated within the Work constitutes direct or contributory
82
+ patent infringement, then any patent licenses granted to You under this
83
+ License for that Work shall terminate as of the date such litigation is filed.
84
+
85
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
86
+ Derivative Works thereof in any medium, with or without modifications, and
87
+ in Source or Object form, provided that You meet the following conditions:
88
+
89
+ (a) You must give any other recipients of the Work or Derivative Works a
90
+ copy of this License; and
91
+
92
+ (b) You must cause any modified files to carry prominent notices stating
93
+ that You changed the files; and
94
+
95
+ (c) You must retain, in the Source form of any Derivative Works that You
96
+ distribute, all copyright, patent, trademark, and attribution notices from
97
+ the Source form of the Work, excluding those notices that do not pertain to
98
+ any part of the Derivative Works; and
99
+
100
+ (d) If the Work includes a "NOTICE" text file as part of its distribution,
101
+ then any Derivative Works that You distribute must include a readable copy
102
+ of the attribution notices contained within such NOTICE file, excluding
103
+ those notices that do not pertain to any part of the Derivative Works, in
104
+ at least one of the following places: within a NOTICE text file distributed
105
+ as part of the Derivative Works; within the Source form or documentation,
106
+ if provided along with the Derivative Works; or, within a display generated
107
+ by the Derivative Works, if and wherever such third-party notices normally
108
+ appear. The contents of the NOTICE file are for informational purposes
109
+ only and do not modify the License. You may add Your own attribution notices
110
+ within Derivative Works that You distribute, alongside or as an addendum
111
+ to the NOTICE text from the Work, provided that such additional attribution
112
+ notices cannot be construed as modifying the License.
113
+
114
+ You may add Your own copyright statement to Your modifications and may
115
+ provide additional or different license terms and conditions for use,
116
+ reproduction, or distribution of Your modifications, or for any such
117
+ Derivative Works as a whole, provided Your use, reproduction, and
118
+ distribution of the Work otherwise complies with the conditions stated
119
+ in this License.
120
+
121
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
122
+ any Contribution intentionally submitted for inclusion in the Work by You
123
+ to the Licensor shall be under the terms and conditions of this License,
124
+ without any additional terms or conditions. Notwithstanding the above,
125
+ nothing herein shall supersede or modify the terms of any separate license
126
+ agreement you may have executed with Licensor regarding such Contributions.
127
+
128
+ 6. Trademarks. This License does not grant permission to use the trade
129
+ names, trademarks, service marks, or product names of the Licensor, except
130
+ as required for reasonable and customary use in describing the origin of
131
+ the Work and reproducing the content of the NOTICE file.
132
+
133
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to
134
+ in writing, Licensor provides the Work (and each Contributor provides its
135
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
136
+ ANY KIND, either express or implied, including, without limitation, any
137
+ warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or
138
+ FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining
139
+ the appropriateness of using or redistributing the Work and assume any
140
+ risks associated with Your exercise of permissions under this License.
141
+
142
+ 8. Limitation of Liability. In no event and under no legal theory, whether
143
+ in tort (including negligence), contract, or otherwise, unless required by
144
+ applicable law (such as deliberate and grossly negligent acts) or agreed to
145
+ in writing, shall any Contributor be liable to You for damages, including
146
+ any direct, indirect, special, incidental, or consequential damages of any
147
+ character arising as a result of this License or out of the use or inability
148
+ to use the Work (including but not limited to damages for loss of goodwill,
149
+ work stoppage, computer failure or malfunction, or any and all other
150
+ commercial damages or losses), even if such Contributor has been advised
151
+ of the possibility of such damages.
152
+
153
+ 9. Accepting Warranty or Additional Liability. While redistributing the
154
+ Work or Derivative Works thereof, You may choose to offer, and charge a fee
155
+ for, acceptance of support, warranty, indemnity, or other liability
156
+ obligations and/or rights consistent with this License. However, in
157
+ accepting such obligations, You may act only on Your own behalf and on
158
+ your sole responsibility, not on behalf of any other Contributor, and only
159
+ if You agree to indemnify, defend, and hold each Contributor harmless for
160
+ any liability incurred by, or claims asserted against, such Contributor
161
+ by reason of your accepting any such warranty or additional liability.
162
+
163
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,9 @@
1
+ include LICENSE README.md CHANGELOG.md SECURITY.md CONTRIBUTING.md CODE_OF_CONDUCT.md DEVELOPMENT_STATUS.md
2
+ recursive-include tests *.py *.json
3
+ recursive-include docs *.md
4
+ recursive-include policies *.md
5
+ recursive-include scripts *.py *.ps1 *.sh
6
+ prune .uds
7
+ prune .venv
8
+ prune dist
9
+ global-exclude __pycache__ *.py[cod]
@@ -0,0 +1,128 @@
1
+ Metadata-Version: 2.4
2
+ Name: universal-dev-security
3
+ Version: 1.0.0
4
+ Summary: One security system for every project: secrets, code, dependency and configuration scanning with a central policy engine, Git and AI-agent guards, and a local security dashboard.
5
+ License-Expression: Apache-2.0
6
+ Project-URL: Homepage, https://github.com/jet1x/Universal-Dev-Security
7
+ Project-URL: Repository, https://github.com/jet1x/Universal-Dev-Security.git
8
+ Project-URL: Issues, https://github.com/jet1x/Universal-Dev-Security/issues
9
+ Project-URL: Changelog, https://github.com/jet1x/Universal-Dev-Security/blob/main/CHANGELOG.md
10
+ Project-URL: Security, https://github.com/jet1x/Universal-Dev-Security/blob/main/SECURITY.md
11
+ Keywords: security,devsecops,gitleaks,semgrep,osv-scanner,trivy,sast,sca,claude-code,secrets
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: Microsoft :: Windows
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Operating System :: MacOS
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
24
+ Classifier: Topic :: Security
25
+ Classifier: Topic :: Software Development :: Quality Assurance
26
+ Requires-Python: >=3.11
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=8.0; extra == "dev"
31
+ Dynamic: license-file
32
+
33
+ # Universal Dev Security (UDS)
34
+
35
+ **One Security System. Every Project.**
36
+
37
+ UDS is an open-source, local-first security toolkit for developers. It runs
38
+ industry-standard scanners on any project, normalizes their results into one
39
+ schema, enforces a central security policy for Git and AI coding agents, and
40
+ produces a dark, self-contained HTML security dashboard.
41
+
42
+ > **Status:** `1.0.0` — first stable release. See
43
+ > [DEVELOPMENT_STATUS.md](DEVELOPMENT_STATUS.md) for verified functionality,
44
+ > known issues and test results. UDS reports what its scanners find; a clean
45
+ > result is never proof that a project is secure.
46
+
47
+ ## What it does
48
+
49
+ | Area | Capability |
50
+ |---|---|
51
+ | Secrets | [Gitleaks](https://github.com/gitleaks/gitleaks) directory, staged and outgoing-commit scanning (values always redacted) |
52
+ | Code | [Semgrep](https://semgrep.dev) static analysis with technology-based rule packs (metrics disabled) |
53
+ | Dependencies | [OSV-Scanner](https://google.github.io/osv-scanner/) and [Trivy](https://trivy.dev) vulnerability scanning |
54
+ | Configuration | Trivy misconfiguration scanning (Dockerfile, Kubernetes, Terraform, …) |
55
+ | Policy | Central engine: approval for `git push`, denial of hook bypasses and secret writes, project rules can only add restrictions |
56
+ | Git | `pre-commit` / `pre-push` hooks that block secrets (fail closed) |
57
+ | AI agents | Claude Code `PreToolUse` hooks; generic `uds guard` JSON protocol for any agent |
58
+ | GitHub | Generated PR workflow with checksum-verified scanners and SARIF upload |
59
+ | Reports | JSON, SARIF 2.1.0 and an offline dark HTML dashboard with filters, history and scan comparison |
60
+ | Recovery | Checkpoints before every UDS change; rollback that never clobbers later user edits |
61
+ | Fixes | Low-risk, reversible fixes verified by your test suite, rolled back automatically if tests fail |
62
+
63
+ Scanner states are explicit — `clean`, `findings`, `not_installed`,
64
+ `not_applicable`, `skipped`, `error` — and the overall status becomes
65
+ `incomplete` when an applicable scanner did not run. Severity is shown only
66
+ when the scanner supplies it or a published scale (CVSS) defines it; everything
67
+ else is `unclassified`. No security score is invented.
68
+
69
+ ## Quick start
70
+
71
+ Requirements: Python 3.11+, Windows, Linux or macOS. Git is recommended.
72
+
73
+ ```powershell
74
+ # Windows (from a release folder containing the wheel and SHA256SUMS)
75
+ .\scripts\install.ps1 -Wheel .\dist\1.0.0\universal_dev_security-1.0.0-py3-none-any.whl
76
+ ```
77
+
78
+ ```bash
79
+ # Linux / macOS
80
+ sh scripts/install.sh --wheel dist/1.0.0/universal_dev_security-1.0.0-py3-none-any.whl
81
+ ```
82
+
83
+ Then, inside a project:
84
+
85
+ ```bash
86
+ uds doctor # runtime, config and scanner availability (+ official install sources)
87
+ uds init # create .uds/config.toml (never overwrites)
88
+ uds scan # run applicable scanners, write JSON + HTML reports, record history
89
+ uds dashboard --open # open the dark HTML dashboard
90
+ uds hooks install --apply # block secrets at commit and push time
91
+ uds integrate claude-code --apply # enforce the UDS policy inside Claude Code
92
+ ```
93
+
94
+ Every command that changes files is a **dry run by default** and shows a diff;
95
+ `--apply` creates a recovery checkpoint first. See [docs/installation.md](docs/installation.md)
96
+ for scanner installation and upgrades, and [docs/commands.md](docs/commands.md) for all commands.
97
+
98
+ ## Documentation
99
+
100
+ - [Installation and upgrades](docs/installation.md)
101
+ - [Commands](docs/commands.md)
102
+ - [Scanners, severity and privacy](docs/scanners.md)
103
+ - [Integrations: Claude Code, GitHub, VS Code, other agents](docs/integrations.md)
104
+ - [Architecture](docs/architecture.md)
105
+ - [Security model](docs/security-model.md) and [global policy](policies/GLOBAL_SECURITY_POLICY.md)
106
+ - [Dashboard design system](docs/dashboard-design-system.md)
107
+ - [Release process](docs/release.md)
108
+
109
+ ## Safety guarantees
110
+
111
+ - No telemetry. The core never contacts the network; scanners' network use is documented and
112
+ OSV-Scanner (which sends package names/versions to osv.dev) runs only with explicit approval.
113
+ - UDS never installs scanners, never commits, never pushes and never publishes.
114
+ - Existing configuration is merged, never silently overwritten; invalid files are left untouched.
115
+ - Secret values, matched text and raw scanner output never appear in output, reports or history.
116
+ - Global policies cannot be weakened by project configuration or AI tools.
117
+
118
+ Local Git hooks and AI-agent hooks are defense in depth — keep CI scanning and
119
+ repository-level protections (for example GitHub push protection) enabled too.
120
+
121
+ ## Contributing and security
122
+
123
+ See [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md).
124
+ Changes are listed in [CHANGELOG.md](CHANGELOG.md).
125
+
126
+ ## License
127
+
128
+ Apache License 2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,96 @@
1
+ # Universal Dev Security (UDS)
2
+
3
+ **One Security System. Every Project.**
4
+
5
+ UDS is an open-source, local-first security toolkit for developers. It runs
6
+ industry-standard scanners on any project, normalizes their results into one
7
+ schema, enforces a central security policy for Git and AI coding agents, and
8
+ produces a dark, self-contained HTML security dashboard.
9
+
10
+ > **Status:** `1.0.0` — first stable release. See
11
+ > [DEVELOPMENT_STATUS.md](DEVELOPMENT_STATUS.md) for verified functionality,
12
+ > known issues and test results. UDS reports what its scanners find; a clean
13
+ > result is never proof that a project is secure.
14
+
15
+ ## What it does
16
+
17
+ | Area | Capability |
18
+ |---|---|
19
+ | Secrets | [Gitleaks](https://github.com/gitleaks/gitleaks) directory, staged and outgoing-commit scanning (values always redacted) |
20
+ | Code | [Semgrep](https://semgrep.dev) static analysis with technology-based rule packs (metrics disabled) |
21
+ | Dependencies | [OSV-Scanner](https://google.github.io/osv-scanner/) and [Trivy](https://trivy.dev) vulnerability scanning |
22
+ | Configuration | Trivy misconfiguration scanning (Dockerfile, Kubernetes, Terraform, …) |
23
+ | Policy | Central engine: approval for `git push`, denial of hook bypasses and secret writes, project rules can only add restrictions |
24
+ | Git | `pre-commit` / `pre-push` hooks that block secrets (fail closed) |
25
+ | AI agents | Claude Code `PreToolUse` hooks; generic `uds guard` JSON protocol for any agent |
26
+ | GitHub | Generated PR workflow with checksum-verified scanners and SARIF upload |
27
+ | Reports | JSON, SARIF 2.1.0 and an offline dark HTML dashboard with filters, history and scan comparison |
28
+ | Recovery | Checkpoints before every UDS change; rollback that never clobbers later user edits |
29
+ | Fixes | Low-risk, reversible fixes verified by your test suite, rolled back automatically if tests fail |
30
+
31
+ Scanner states are explicit — `clean`, `findings`, `not_installed`,
32
+ `not_applicable`, `skipped`, `error` — and the overall status becomes
33
+ `incomplete` when an applicable scanner did not run. Severity is shown only
34
+ when the scanner supplies it or a published scale (CVSS) defines it; everything
35
+ else is `unclassified`. No security score is invented.
36
+
37
+ ## Quick start
38
+
39
+ Requirements: Python 3.11+, Windows, Linux or macOS. Git is recommended.
40
+
41
+ ```powershell
42
+ # Windows (from a release folder containing the wheel and SHA256SUMS)
43
+ .\scripts\install.ps1 -Wheel .\dist\1.0.0\universal_dev_security-1.0.0-py3-none-any.whl
44
+ ```
45
+
46
+ ```bash
47
+ # Linux / macOS
48
+ sh scripts/install.sh --wheel dist/1.0.0/universal_dev_security-1.0.0-py3-none-any.whl
49
+ ```
50
+
51
+ Then, inside a project:
52
+
53
+ ```bash
54
+ uds doctor # runtime, config and scanner availability (+ official install sources)
55
+ uds init # create .uds/config.toml (never overwrites)
56
+ uds scan # run applicable scanners, write JSON + HTML reports, record history
57
+ uds dashboard --open # open the dark HTML dashboard
58
+ uds hooks install --apply # block secrets at commit and push time
59
+ uds integrate claude-code --apply # enforce the UDS policy inside Claude Code
60
+ ```
61
+
62
+ Every command that changes files is a **dry run by default** and shows a diff;
63
+ `--apply` creates a recovery checkpoint first. See [docs/installation.md](docs/installation.md)
64
+ for scanner installation and upgrades, and [docs/commands.md](docs/commands.md) for all commands.
65
+
66
+ ## Documentation
67
+
68
+ - [Installation and upgrades](docs/installation.md)
69
+ - [Commands](docs/commands.md)
70
+ - [Scanners, severity and privacy](docs/scanners.md)
71
+ - [Integrations: Claude Code, GitHub, VS Code, other agents](docs/integrations.md)
72
+ - [Architecture](docs/architecture.md)
73
+ - [Security model](docs/security-model.md) and [global policy](policies/GLOBAL_SECURITY_POLICY.md)
74
+ - [Dashboard design system](docs/dashboard-design-system.md)
75
+ - [Release process](docs/release.md)
76
+
77
+ ## Safety guarantees
78
+
79
+ - No telemetry. The core never contacts the network; scanners' network use is documented and
80
+ OSV-Scanner (which sends package names/versions to osv.dev) runs only with explicit approval.
81
+ - UDS never installs scanners, never commits, never pushes and never publishes.
82
+ - Existing configuration is merged, never silently overwritten; invalid files are left untouched.
83
+ - Secret values, matched text and raw scanner output never appear in output, reports or history.
84
+ - Global policies cannot be weakened by project configuration or AI tools.
85
+
86
+ Local Git hooks and AI-agent hooks are defense in depth — keep CI scanning and
87
+ repository-level protections (for example GitHub push protection) enabled too.
88
+
89
+ ## Contributing and security
90
+
91
+ See [CONTRIBUTING.md](CONTRIBUTING.md) and [SECURITY.md](SECURITY.md).
92
+ Changes are listed in [CHANGELOG.md](CHANGELOG.md).
93
+
94
+ ## License
95
+
96
+ Apache License 2.0. See [LICENSE](LICENSE).
@@ -0,0 +1,33 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a vulnerability
4
+
5
+ Please do **not** publish exploitable details in a public issue.
6
+
7
+ - Preferred: use GitHub **private vulnerability reporting** ("Report a vulnerability" on the
8
+ repository's Security tab) once it is enabled.
9
+ - Until then, open a minimal issue asking the maintainers for a private channel. Do not include
10
+ exploit details, credentials or private data.
11
+
12
+ Please include the affected version, platform, and a minimal reproduction. We aim to acknowledge
13
+ reports within 7 days and to agree on a disclosure timeline with the reporter.
14
+
15
+ ## Supported versions
16
+
17
+ | Version | Supported |
18
+ |---|---|
19
+ | 1.0.x (including release candidates) | Yes |
20
+ | < 1.0 | No |
21
+
22
+ ## Scope
23
+
24
+ This policy covers UDS itself: the CLI, policy engine, hooks, integrations, report generation
25
+ and installers. Integrated third-party scanners (Gitleaks, Semgrep, OSV-Scanner, Trivy) have
26
+ their own security reporting processes.
27
+
28
+ Particularly relevant classes of issues: secret leakage into output or reports, policy bypasses
29
+ that let an AI agent perform an action without the required approval, command injection or
30
+ unsafe process execution, path traversal in recovery/history, unsafe HTML in reports, and
31
+ denial of service in pattern matching.
32
+
33
+ See [docs/security-model.md](docs/security-model.md) for guarantees and known limitations.