torusguard 1.3.5 → 1.4.0
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.
- package/.torusguard/.manifest.json +37 -36
- package/.torusguard/runs/report-latest.html +5862 -315
- package/.torusguard/runs/results-latest.sarif +20 -0
- package/.torusguard/runs/run-20260918-104221-audit/findings.json +1 -0
- package/.torusguard/runs/run-20260918-104221-audit/findings.md +8 -0
- package/.torusguard/runs/run-20260918-104221-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260918-104221-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260918-104236-audit/findings.json +2314 -0
- package/.torusguard/runs/run-20260918-104236-audit/findings.md +960 -0
- package/.torusguard/runs/run-20260918-104236-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260918-104236-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260918-105723-audit/findings.json +2382 -0
- package/.torusguard/runs/run-20260918-105723-audit/findings.md +960 -0
- package/.torusguard/runs/run-20260918-105723-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260918-105723-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260918-105731-audit/findings.json +1 -0
- package/.torusguard/runs/run-20260918-105731-audit/findings.md +8 -0
- package/.torusguard/runs/run-20260918-105731-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260918-105731-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260918-105940-audit/findings.json +1 -0
- package/.torusguard/runs/run-20260918-105940-audit/findings.md +8 -0
- package/.torusguard/runs/run-20260918-105940-audit/manifest.json +13 -0
- package/.torusguard/runs/run-20260918-105940-audit/remediation.md +7 -0
- package/.torusguard/runs/run-20260918-105940-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260919-145701-audit/findings.json +1 -0
- package/.torusguard/runs/run-20260919-145701-audit/findings.md +8 -0
- package/.torusguard/runs/run-20260919-145701-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260919-145701-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260919-151729-audit/findings.json +1 -0
- package/.torusguard/runs/run-20260919-151729-audit/findings.md +8 -0
- package/.torusguard/runs/run-20260919-151729-audit/manifest.json +13 -0
- package/.torusguard/runs/run-20260919-151729-audit/remediation.md +7 -0
- package/.torusguard/runs/run-20260919-151729-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260919-152340-audit/findings.json +1 -0
- package/.torusguard/runs/run-20260919-152340-audit/findings.md +8 -0
- package/.torusguard/runs/run-20260919-152340-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260919-152340-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260919-152345-audit/findings.json +1 -0
- package/.torusguard/runs/run-20260919-152345-audit/findings.md +8 -0
- package/.torusguard/runs/run-20260919-152345-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260919-152345-audit/summary.md +5 -0
- package/.torusguard/runs/run-20260919-153500-audit/findings.json +1 -0
- package/.torusguard/runs/run-20260919-153500-audit/findings.md +8 -0
- package/.torusguard/runs/run-20260919-153500-audit/manifest.json +12 -0
- package/.torusguard/runs/run-20260919-153500-audit/summary.md +5 -0
- package/.torusguard/scripts/__pycache__/apply_runner.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/audit_runner.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/diff_guard.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/finding_scorer.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/harden_runner.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/html_reporter.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/manifest_builder.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/memory_engine.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/monorepo_detector.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/recheck_runner.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/recipes_runner.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/report_sync.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/run_manager.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/sarif_exporter.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/stack_detect.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/term_ui.cpython-314.pyc +0 -0
- package/.torusguard/scripts/apply_runner.py +108 -9
- package/.torusguard/scripts/audit_runner.py +336 -24
- package/.torusguard/scripts/harden_runner.py +124 -70
- package/.torusguard/scripts/html_reporter.py +3585 -648
- package/.torusguard/scripts/manifest_builder.py +2 -0
- package/.torusguard/scripts/recheck_runner.py +5 -4
- package/.torusguard/scripts/recipes_runner.py +91 -8
- package/.torusguard/scripts/report_sync.py +496 -73
- package/.torusguard/scripts/sarif_exporter.py +48 -8
- package/.torusguard/scripts/stack_detect.py +44 -2
- package/.torusguard/scripts/status_runner.py +267 -0
- package/.torusguard/scripts/term_ui.py +1 -1
- package/.torusguard/skills/torusguard/SKILL.md +75 -72
- package/.torusguard/skills/torusguard-apply/SKILL.md +84 -80
- package/.torusguard/skills/torusguard-audit/SKILL.md +87 -83
- package/.torusguard/skills/torusguard-authorize/SKILL.md +7 -2
- package/.torusguard/skills/torusguard-exploit-check/SKILL.md +7 -2
- package/.torusguard/skills/torusguard-full/SKILL.md +7 -2
- package/.torusguard/skills/torusguard-harden/SKILL.md +98 -94
- package/.torusguard/skills/torusguard-init/SKILL.md +68 -64
- package/.torusguard/skills/torusguard-recheck/SKILL.md +81 -77
- package/.torusguard/skills/torusguard-report/SKILL.md +93 -72
- package/.torusguard/skills/torusguard-status/SKILL.md +62 -58
- package/.torusguard/skills/torusguard-verify/SKILL.md +7 -2
- package/.torusguard/skills/torusguard-web-validate/SKILL.md +7 -2
- package/.torusguard/workflows/apply.md +1 -1
- package/.torusguard/workflows/audit.md +1 -1
- package/.torusguard/workflows/authorize.md +1 -1
- package/.torusguard/workflows/exploit-check.md +1 -1
- package/.torusguard/workflows/harden.md +1 -1
- package/.torusguard/workflows/init.md +1 -1
- package/.torusguard/workflows/memory.md +1 -1
- package/.torusguard/workflows/recheck.md +1 -1
- package/.torusguard/workflows/report.md +1 -1
- package/.torusguard/workflows/status.md +1 -1
- package/.torusguard/workflows/verify.md +1 -1
- package/.torusguard/workflows/web-validate.md +1 -1
- package/README.md +115 -81
- package/bin/torusguard.js +244 -38
- package/package.json +6 -2
- package/skills/torusguard/SKILL.md +1 -1
- package/skills/torusguard/__pycache__/bootstrap.cpython-314.pyc +0 -0
- package/skills/torusguard/bootstrap.py +52 -8
- package/skills/torusguard/payload/.manifest.json +51 -36
- package/skills/torusguard/payload/scripts/__pycache__/apply_runner.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/audit_runner.cpython-311.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/audit_runner.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/diff_guard.cpython-311.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/diff_guard.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/finding_scorer.cpython-311.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/finding_scorer.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/harden_runner.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/html_reporter.cpython-311.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/html_reporter.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/manifest_builder.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/memory_engine.cpython-311.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/memory_engine.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/monorepo_detector.cpython-311.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/monorepo_detector.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/recheck_runner.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/report_sync.cpython-311.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/report_sync.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/rules_sync.cpython-311.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/run_manager.cpython-311.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/run_manager.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/sarif_exporter.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/stack_detect.cpython-311.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/stack_detect.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/term_ui.cpython-311.pyc +0 -0
- package/skills/torusguard/payload/scripts/__pycache__/term_ui.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/apply_runner.py +108 -9
- package/skills/torusguard/payload/scripts/audit_runner.py +336 -24
- package/skills/torusguard/payload/scripts/harden_runner.py +124 -70
- package/skills/torusguard/payload/scripts/html_reporter.py +3585 -648
- package/skills/torusguard/payload/scripts/manifest_builder.py +2 -0
- package/skills/torusguard/payload/scripts/recheck_runner.py +5 -4
- package/skills/torusguard/payload/scripts/recipes_runner.py +91 -8
- package/skills/torusguard/payload/scripts/report_sync.py +496 -73
- package/skills/torusguard/payload/scripts/sarif_exporter.py +48 -8
- package/skills/torusguard/payload/scripts/stack_detect.py +44 -2
- package/skills/torusguard/payload/scripts/status_runner.py +267 -0
- package/skills/torusguard/payload/scripts/term_ui.py +1 -1
- package/skills/torusguard/payload/skills/torusguard/SKILL.md +1 -1
- package/skills/torusguard/payload/skills/torusguard-apply/SKILL.md +1 -1
- package/skills/torusguard/payload/skills/torusguard-audit/SKILL.md +1 -1
- package/skills/torusguard/payload/skills/torusguard-authorize/SKILL.md +1 -1
- package/skills/torusguard/payload/skills/torusguard-exploit-check/SKILL.md +1 -1
- package/skills/torusguard/payload/skills/torusguard-full/SKILL.md +1 -1
- package/skills/torusguard/payload/skills/torusguard-harden/SKILL.md +1 -1
- package/skills/torusguard/payload/skills/torusguard-init/SKILL.md +1 -1
- package/skills/torusguard/payload/skills/torusguard-recheck/SKILL.md +1 -1
- package/skills/torusguard/payload/skills/torusguard-report/SKILL.md +40 -23
- package/skills/torusguard/payload/skills/torusguard-status/SKILL.md +1 -1
- package/skills/torusguard/payload/skills/torusguard-verify/SKILL.md +1 -1
- package/skills/torusguard/payload/skills/torusguard-web-validate/SKILL.md +1 -1
- package/skills/torusguard/payload/workflows/apply.md +9 -1
- package/skills/torusguard/payload/workflows/audit.md +8 -2
- package/skills/torusguard/payload/workflows/authorize.md +1 -1
- package/skills/torusguard/payload/workflows/exploit-check.md +1 -1
- package/skills/torusguard/payload/workflows/harden.md +6 -1
- package/skills/torusguard/payload/workflows/init.md +7 -1
- package/skills/torusguard/payload/workflows/memory.md +1 -1
- package/skills/torusguard/payload/workflows/recheck.md +1 -1
- package/skills/torusguard/payload/workflows/recipes.md +55 -0
- package/skills/torusguard/payload/workflows/report.md +59 -55
- package/skills/torusguard/payload/workflows/status.md +4 -1
- package/skills/torusguard/payload/workflows/torusguard-apply.md +110 -0
- package/skills/torusguard/payload/workflows/torusguard-audit.md +105 -0
- package/skills/torusguard/payload/workflows/torusguard-authorize.md +96 -0
- package/skills/torusguard/payload/workflows/torusguard-exploit-check.md +98 -0
- package/skills/torusguard/payload/workflows/torusguard-harden.md +104 -0
- package/skills/torusguard/payload/workflows/torusguard-init.md +106 -0
- package/skills/torusguard/payload/workflows/torusguard-recheck.md +101 -0
- package/skills/torusguard/payload/workflows/torusguard-recipes.md +55 -0
- package/skills/torusguard/payload/workflows/torusguard-report.md +105 -0
- package/skills/torusguard/payload/workflows/torusguard-status.md +103 -0
- package/skills/torusguard/payload/workflows/torusguard-verify.md +100 -0
- package/skills/torusguard/payload/workflows/torusguard-web-validate.md +96 -0
- package/skills/torusguard/payload/workflows/torusguard.md +19 -0
- package/skills/torusguard/payload/workflows/verify.md +1 -1
- package/skills/torusguard/payload/workflows/web-validate.md +1 -1
- package/skills/torusguard-apply/SKILL.md +1 -1
- package/skills/torusguard-audit/SKILL.md +1 -1
- package/skills/torusguard-authorize/SKILL.md +1 -1
- package/skills/torusguard-exploit-check/SKILL.md +1 -1
- package/skills/torusguard-full/SKILL.md +1 -1
- package/skills/torusguard-harden/SKILL.md +1 -1
- package/skills/torusguard-init/SKILL.md +1 -1
- package/skills/torusguard-recheck/SKILL.md +1 -1
- package/skills/torusguard-report/SKILL.md +40 -23
- package/skills/torusguard-status/SKILL.md +1 -1
- package/skills/torusguard-verify/SKILL.md +1 -1
- package/skills/torusguard-web-validate/SKILL.md +1 -1
|
@@ -142,25 +142,26 @@
|
|
|
142
142
|
"schemas/remediation.schema.json": "544904239f871dec9552973e01e09dc1f40dbb8330f20d98c319f3b24031d630",
|
|
143
143
|
"schemas/retest.schema.json": "97c0407ca4365a524020c430912f686f698cc0de90043194621071e9fc681cc7",
|
|
144
144
|
"schemas/runtime-evidence.schema.json": "929d2b094c1cd1f7f9db07be1eba5994e8002477eab3fd24140e1e973fd18cc1",
|
|
145
|
-
"scripts/apply_runner.py": "
|
|
146
|
-
"scripts/audit_runner.py": "
|
|
145
|
+
"scripts/apply_runner.py": "b145a68a4bc10fcacb853f972aee81fa3607e32d282b2b850c5a63d8e72da890",
|
|
146
|
+
"scripts/audit_runner.py": "bc1e06ea5153ae326c4ad1de5d0cbb9503e618186623bea7cb8bb64d7b7b05ec",
|
|
147
147
|
"scripts/diff_guard.py": "0dc178cdde1ac0ae1a1ea4b2eb2ce1756b2126f6156909cf55d85249f115fcbd",
|
|
148
148
|
"scripts/finding_scorer.py": "a5315be6ee256c01c4539da3d1905ebc8d0840a356b83c55f9f6f2654a9f0c60",
|
|
149
|
-
"scripts/harden_runner.py": "
|
|
150
|
-
"scripts/html_reporter.py": "
|
|
151
|
-
"scripts/manifest_builder.py": "
|
|
149
|
+
"scripts/harden_runner.py": "5d5a40029c088ccb66790a9b0128bdefcd35883ef1dac78088ceb9531392a8f1",
|
|
150
|
+
"scripts/html_reporter.py": "655c57be39e13c177db8842ef471664e5853f3e43b9f2a63e590df40ff9c16cb",
|
|
151
|
+
"scripts/manifest_builder.py": "18db6979b341a87e9bf38fe06525365d12b07d532c0dbfd2ac3ef0f539dc1f6f",
|
|
152
152
|
"scripts/memory_engine.py": "b715d0ca030e95eb06ad6eda99027535df8a7e37d64897c023be6a291cf13dc6",
|
|
153
153
|
"scripts/monorepo_detector.py": "5603674136a5294ebfff89efeca0a546dd4a7deb1d184a2592ff21aff2131f73",
|
|
154
|
-
"scripts/recheck_runner.py": "
|
|
155
|
-
"scripts/recipes_runner.py": "
|
|
156
|
-
"scripts/report_sync.py": "
|
|
154
|
+
"scripts/recheck_runner.py": "89e93fcc6843493d7e5f0bf97065dbdb40106273a00e07f903250665ca25f6fb",
|
|
155
|
+
"scripts/recipes_runner.py": "090c06ef0de3c640a111c5646837233ceeaca494b161bd5edc630cc1371dca0e",
|
|
156
|
+
"scripts/report_sync.py": "5ebef684690200694a53af30db850d9808d03ec710ed21ef75c4de52b5e5217c",
|
|
157
157
|
"scripts/rules_sync.py": "4101b2ca8036ff4f468800b32a8d08898e8640a74d14124af53d454706a62d3a",
|
|
158
158
|
"scripts/run_manager.py": "b738ff70879e46547d32fac6befc61de9599f676411384280fb9819ea3ad7035",
|
|
159
159
|
"scripts/safety_gate.py": "3379b7534b2590cf563717a448983ad8ed7e8f174f0ad65683d33e8a10f51558",
|
|
160
|
-
"scripts/sarif_exporter.py": "
|
|
161
|
-
"scripts/stack_detect.py": "
|
|
162
|
-
"scripts/
|
|
163
|
-
"
|
|
160
|
+
"scripts/sarif_exporter.py": "86700765212adb3ab590ca72614bf3ad4ce7ce60e3193f7f3bd1a04d34d10f6e",
|
|
161
|
+
"scripts/stack_detect.py": "c05a1ade4c8692025476bf7ea080a8f07c92e5d8e9a04f94c1654386352ffbdc",
|
|
162
|
+
"scripts/status_runner.py": "4c358c91950c7874bcc6a5f23f2d3fda62b0752efcf6c6b658adf02ed77c7752",
|
|
163
|
+
"scripts/term_ui.py": "ca69398f85c86fe89526d6334b3ee866c890273997351113c3cc1765b7bd20c3",
|
|
164
|
+
"skills/torusguard/SKILL.md": "4d5b8e43fa3c09e5e1079cbc3e2184654219a2c47b2272db394da749969318f8",
|
|
164
165
|
"skills/torusguard/bootstrap.py": "3d946f388cb4befa739c9d3b1404255d9a8ea5770ebbb79e5a1b9839589e9bc7",
|
|
165
166
|
"skills/torusguard/references/auth-and-sessions.md": "c3e4b9600cb53fc28c993922dc880accbec5783ac90d5ee98d63b52762d19525",
|
|
166
167
|
"skills/torusguard/references/business-logic-and-abuse.md": "58e87df2864d468af70c1ff39f5d540c687fa846b671457f85046ab2065fe99c",
|
|
@@ -190,32 +191,46 @@
|
|
|
190
191
|
"skills/torusguard/references/ssrf-and-outbound-requests.md": "5ce59ebada2f227b3e0a27f612b59a47801c152d24d2d4d533bee435f32b1b05",
|
|
191
192
|
"skills/torusguard/references/webhook-security.md": "8fd27cce1562a3dfda8d4fae29bef7cfd47a65c1e89c6868cdbcac161ccd2be8",
|
|
192
193
|
"skills/torusguard/references/websocket-security.md": "b5315e49432184c006664436d689d426b7322fc6fbbba2899a9ea5e5bab74c92",
|
|
193
|
-
"skills/torusguard-apply/SKILL.md": "
|
|
194
|
-
"skills/torusguard-audit/SKILL.md": "
|
|
195
|
-
"skills/torusguard-authorize/SKILL.md": "
|
|
196
|
-
"skills/torusguard-exploit-check/SKILL.md": "
|
|
197
|
-
"skills/torusguard-full/SKILL.md": "
|
|
198
|
-
"skills/torusguard-harden/SKILL.md": "
|
|
199
|
-
"skills/torusguard-init/SKILL.md": "
|
|
200
|
-
"skills/torusguard-recheck/SKILL.md": "
|
|
201
|
-
"skills/torusguard-report/SKILL.md": "
|
|
202
|
-
"skills/torusguard-status/SKILL.md": "
|
|
203
|
-
"skills/torusguard-verify/SKILL.md": "
|
|
204
|
-
"skills/torusguard-web-validate/SKILL.md": "
|
|
194
|
+
"skills/torusguard-apply/SKILL.md": "4cdd01d8159fc5f7519a806526a119e6d67e41b8af195de018b05d6af09acb12",
|
|
195
|
+
"skills/torusguard-audit/SKILL.md": "0065336b125cfa8ec766dcec585bce4bbac66b3b063c174b7183dffef18e090d",
|
|
196
|
+
"skills/torusguard-authorize/SKILL.md": "8694e6cef71cbeb6605fed33dd1f24b74352541069e54de7c3f48c9676e9aa3a",
|
|
197
|
+
"skills/torusguard-exploit-check/SKILL.md": "87e0e01f28f3efea8dbe81790abaceb845a1290c75a6a16bbd256251cd0539a9",
|
|
198
|
+
"skills/torusguard-full/SKILL.md": "35f8b38b08fef5a09504312ef3e54921b1f8f31f197bbe2af1474bcce2e83e1c",
|
|
199
|
+
"skills/torusguard-harden/SKILL.md": "4332761e5454a504176eebbba2d4c585bcf066c8046c014cebc0f5771379c089",
|
|
200
|
+
"skills/torusguard-init/SKILL.md": "03e599a5dad4262396e6b1a75859f76739b0b1480d8cc64544296106da903dfc",
|
|
201
|
+
"skills/torusguard-recheck/SKILL.md": "72a0a79b29dcc7f7ae054f00c53e005bc92778f2c6bf3ad828f6391e859d9c1c",
|
|
202
|
+
"skills/torusguard-report/SKILL.md": "6dc62fb2c9e2986827a802b7cabf41ce41d00a47573524a4bf1642a8d8e2249e",
|
|
203
|
+
"skills/torusguard-status/SKILL.md": "2ad72e5d317e1d6fe0606f6926b1721dc01ba98b5daa2bfaa90bdd953a67bdf7",
|
|
204
|
+
"skills/torusguard-verify/SKILL.md": "810c31ba9adc1b410b22eb8503f266be2d51e260a9c6828fd2938e2774e5baa7",
|
|
205
|
+
"skills/torusguard-web-validate/SKILL.md": "3e02d9734402e8fbc86a0b5c2fdac945ef4fc9d60ba1b992197b1373427ad16e",
|
|
205
206
|
"templates/audit-report.template.md": "71149dd05b01a74287a47781fdc71fd2d1b4b70337da303bf78767d0410a6c90",
|
|
206
207
|
"templates/authorization.template.md": "81ef843d42a19412c369f383b787465ac24173c0b14c1f5f211786eab3d10e8b",
|
|
207
208
|
"templates/finding-card.template.md": "8f756edbd3e4139d3da2fb96f35bd2d2b267b33b754f187b590a89584265c1e6",
|
|
208
209
|
"templates/remediation-bundle.template.md": "4d85a540e3a2e74f9b21fc8a2a1072e27ca03e97cd67ca482f529cfe722acc4d",
|
|
209
|
-
"workflows/apply.md": "
|
|
210
|
-
"workflows/audit.md": "
|
|
211
|
-
"workflows/authorize.md": "
|
|
212
|
-
"workflows/exploit-check.md": "
|
|
213
|
-
"workflows/harden.md": "
|
|
214
|
-
"workflows/init.md": "
|
|
215
|
-
"workflows/memory.md": "
|
|
216
|
-
"workflows/recheck.md": "
|
|
217
|
-
"workflows/
|
|
218
|
-
"workflows/
|
|
219
|
-
"workflows/
|
|
220
|
-
"workflows/
|
|
210
|
+
"workflows/apply.md": "67e1002fc6e9d68e0c7d871c40b6f3c3b9c3919c8e02106a579882729c0f6b9f",
|
|
211
|
+
"workflows/audit.md": "eac9102ca88d53f71da474cd55717d431fd9c3b08c66d0760da9b53a659cf89a",
|
|
212
|
+
"workflows/authorize.md": "28ca58cfc656e956f7cec8160f2aadc152abcde3eb5ad5588df149007afb0df8",
|
|
213
|
+
"workflows/exploit-check.md": "41e77afe912be9266c5bc1e00fd796baff22a67973eb6e86d196d34f4d7bdfa4",
|
|
214
|
+
"workflows/harden.md": "7d92132973ff867b99e0425e3aee3c4e91868cb5193ec601069af2e857b6697f",
|
|
215
|
+
"workflows/init.md": "611418577ff9d5719df459f56b3fa53b91eb3717b02c4b4e5e86ed483bed3bfa",
|
|
216
|
+
"workflows/memory.md": "8ad2ec154176e2540c2859a28eff9f7c2dbca0217aa29d0f4aa88b87c43f8bef",
|
|
217
|
+
"workflows/recheck.md": "42eecc3ba194564d48a6a88d8003e86cafe003503e887dc565314d4aa558e8fd",
|
|
218
|
+
"workflows/recipes.md": "300c1fed0167e1a299fcd33c07db05630116b18a71ec2513c385862bba0f179b",
|
|
219
|
+
"workflows/report.md": "ecbd67bfa95bde3c0f51e06aac6fad70d5989b0be82245116cd7ba367f378a4c",
|
|
220
|
+
"workflows/status.md": "7f07e726bbb0488e48b718c2f36971634b1422bc2ddfbb381eb3e1ea67c1cfbf",
|
|
221
|
+
"workflows/torusguard-apply.md": "67e1002fc6e9d68e0c7d871c40b6f3c3b9c3919c8e02106a579882729c0f6b9f",
|
|
222
|
+
"workflows/torusguard-audit.md": "eac9102ca88d53f71da474cd55717d431fd9c3b08c66d0760da9b53a659cf89a",
|
|
223
|
+
"workflows/torusguard-authorize.md": "28ca58cfc656e956f7cec8160f2aadc152abcde3eb5ad5588df149007afb0df8",
|
|
224
|
+
"workflows/torusguard-exploit-check.md": "41e77afe912be9266c5bc1e00fd796baff22a67973eb6e86d196d34f4d7bdfa4",
|
|
225
|
+
"workflows/torusguard-harden.md": "7d92132973ff867b99e0425e3aee3c4e91868cb5193ec601069af2e857b6697f",
|
|
226
|
+
"workflows/torusguard-init.md": "611418577ff9d5719df459f56b3fa53b91eb3717b02c4b4e5e86ed483bed3bfa",
|
|
227
|
+
"workflows/torusguard-recheck.md": "42eecc3ba194564d48a6a88d8003e86cafe003503e887dc565314d4aa558e8fd",
|
|
228
|
+
"workflows/torusguard-recipes.md": "300c1fed0167e1a299fcd33c07db05630116b18a71ec2513c385862bba0f179b",
|
|
229
|
+
"workflows/torusguard-report.md": "ecbd67bfa95bde3c0f51e06aac6fad70d5989b0be82245116cd7ba367f378a4c",
|
|
230
|
+
"workflows/torusguard-status.md": "7f07e726bbb0488e48b718c2f36971634b1422bc2ddfbb381eb3e1ea67c1cfbf",
|
|
231
|
+
"workflows/torusguard-verify.md": "6412e123a9346240e5ba898a0da73d3409d9a215d6e8f202ab2eb5719b663731",
|
|
232
|
+
"workflows/torusguard-web-validate.md": "3b2a3d02b69469539b4a48ed3bd355362927cc21470dbcdeccba564a9e68a371",
|
|
233
|
+
"workflows/torusguard.md": "4b5da6d38dae6be277bd52782121cdb181a75f1400068041310ca69deae89589",
|
|
234
|
+
"workflows/verify.md": "6412e123a9346240e5ba898a0da73d3409d9a215d6e8f202ab2eb5719b663731",
|
|
235
|
+
"workflows/web-validate.md": "3b2a3d02b69469539b4a48ed3bd355362927cc21470dbcdeccba564a9e68a371"
|
|
221
236
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
|
-
TorusGuard Governed Patch Application & Snapshot Engine (v1.3.
|
|
3
|
+
TorusGuard Governed Patch Application & Snapshot Engine (v1.3.6)
|
|
4
4
|
Interactive Human Gate authorization, pre-apply .bak rollback snapshots,
|
|
5
5
|
atomic patch application, and Golden Fix Recipe distillation into persistent memory.
|
|
6
6
|
Strict 75-column terminal UI formatting.
|
|
@@ -58,7 +58,7 @@ def box_line(content: str, width: int = 67, border: str = "│", border_color: s
|
|
|
58
58
|
return term_ui.format_box_line(content, width=width, border=border, border_color=border_color)
|
|
59
59
|
return f" {border_color}{border}{RESET} {content}"
|
|
60
60
|
|
|
61
|
-
def box_header(title: str, subtitle: str = "", version: str = "v1.
|
|
61
|
+
def box_header(title: str, subtitle: str = "", version: str = "v1.4.0", border_color: str = CYAN) -> str:
|
|
62
62
|
if term_ui:
|
|
63
63
|
return term_ui.card_header(title, subtitle, version, border_color)
|
|
64
64
|
return f"=== {title} ({version}) ==="
|
|
@@ -81,6 +81,35 @@ def find_latest_audit_run(runs_dir: Path) -> Optional[Path]:
|
|
|
81
81
|
return runs[0] if runs else None
|
|
82
82
|
|
|
83
83
|
|
|
84
|
+
def list_snapshots(target_root: Path) -> None:
|
|
85
|
+
"""Display historical pre-apply backup snapshots."""
|
|
86
|
+
snapshots_base = target_root / ".torusguard" / "snapshots"
|
|
87
|
+
print()
|
|
88
|
+
print(box_header("🛡️ TORUSGUARD SNAPSHOT LEDGER", "Pre-Apply Safety Snapshots (.bak)", "v1.4.0"))
|
|
89
|
+
print()
|
|
90
|
+
if not snapshots_base.is_dir():
|
|
91
|
+
print(f" {YELLOW}ℹ No snapshots directory found at:{RESET} {snapshots_base}\n")
|
|
92
|
+
return
|
|
93
|
+
snapshots = sorted([d for d in snapshots_base.iterdir() if d.is_dir()], key=lambda p: p.stat().st_mtime, reverse=True)
|
|
94
|
+
if not snapshots:
|
|
95
|
+
print(f" {YELLOW}ℹ No rollback snapshots captured yet.{RESET}\n")
|
|
96
|
+
return
|
|
97
|
+
print(border_top(f"Available Snapshots ({len(snapshots)})"))
|
|
98
|
+
for s in snapshots:
|
|
99
|
+
bak_files = list(s.rglob("*.bak"))
|
|
100
|
+
total_bytes = sum(f.stat().st_size for f in bak_files)
|
|
101
|
+
kb_str = f"{total_bytes / 1024:.1f} KB"
|
|
102
|
+
try:
|
|
103
|
+
mtime_dt = datetime.datetime.fromtimestamp(s.stat().st_mtime, tz=IST)
|
|
104
|
+
time_str = mtime_dt.strftime("%Y-%m-%d %H:%M:%S IST")
|
|
105
|
+
except Exception:
|
|
106
|
+
time_str = "Captured"
|
|
107
|
+
print(box_line(f"{GREEN}{s.name}{RESET} ({len(bak_files)} files · {kb_str})"))
|
|
108
|
+
print(box_line(f" └─ {DIM}Timestamp: {time_str}{RESET}"))
|
|
109
|
+
print(border_bottom())
|
|
110
|
+
print(f"\n {DIM}To restore any snapshot, run: {CYAN}npx torusguard rollback --run <snapshot-name>{RESET}\n")
|
|
111
|
+
|
|
112
|
+
|
|
84
113
|
def execute_rollback(target_root: Path, run_id_arg: Optional[str] = None) -> None:
|
|
85
114
|
"""Restore all target files from the pre-apply backup snapshots."""
|
|
86
115
|
snapshots_base = target_root / ".torusguard" / "snapshots"
|
|
@@ -108,8 +137,14 @@ def execute_rollback(target_root: Path, run_id_arg: Optional[str] = None) -> Non
|
|
|
108
137
|
shutil.copy2(bak_file, dest_file)
|
|
109
138
|
restored_files.append(orig_rel)
|
|
110
139
|
|
|
140
|
+
try:
|
|
141
|
+
import report_sync
|
|
142
|
+
report_sync.record_rollback_results(target_root, restored_files, snapshot_dir.name)
|
|
143
|
+
except Exception:
|
|
144
|
+
pass
|
|
145
|
+
|
|
111
146
|
print()
|
|
112
|
-
print(box_header("🛡️ TORUSGUARD ROLLBACK RESTORATION", "Restored original files from pre-apply snapshot", "v1.
|
|
147
|
+
print(box_header("🛡️ TORUSGUARD ROLLBACK RESTORATION", "Restored original files from pre-apply snapshot", "v1.4.0"))
|
|
113
148
|
print()
|
|
114
149
|
|
|
115
150
|
print(border_top("Rollback Snapshot Restored"))
|
|
@@ -122,7 +157,7 @@ def execute_rollback(target_root: Path, run_id_arg: Optional[str] = None) -> Non
|
|
|
122
157
|
sys.exit(0)
|
|
123
158
|
|
|
124
159
|
|
|
125
|
-
def execute_apply(target_root: Path, run_id_arg: Optional[str] = None, auto_approve: bool = False) -> Dict[str, Any]:
|
|
160
|
+
def execute_apply(target_root: Path, run_id_arg: Optional[str] = None, auto_approve: bool = False, diff_only: bool = False, selective: bool = False, verify_post_apply: bool = False) -> Dict[str, Any]:
|
|
126
161
|
runs_dir = target_root / ".torusguard" / "runs"
|
|
127
162
|
if run_id_arg:
|
|
128
163
|
run_folder = runs_dir / run_id_arg
|
|
@@ -138,7 +173,7 @@ def execute_apply(target_root: Path, run_id_arg: Optional[str] = None, auto_appr
|
|
|
138
173
|
bundle_meta_files = list(bundles_dir.glob("*/metadata.json")) if bundles_dir.is_dir() else []
|
|
139
174
|
if not bundle_meta_files:
|
|
140
175
|
print()
|
|
141
|
-
print(box_header("🛡️ TORUSGUARD GOVERNED PATCH APPLIER", "Human-Gate Authorization, Snapshots & Golden Recipe Distillation", "v1.
|
|
176
|
+
print(box_header("🛡️ TORUSGUARD GOVERNED PATCH APPLIER", "Human-Gate Authorization, Snapshots & Golden Recipe Distillation", "v1.4.0"))
|
|
142
177
|
print()
|
|
143
178
|
print(f" {YELLOW}ℹ Zero candidate remediation bundles found in run: {run_folder.name}{RESET}")
|
|
144
179
|
print(f" {GRAY}The findings in this run require manual review or AI-assisted remediation.{RESET}\n")
|
|
@@ -157,13 +192,46 @@ def execute_apply(target_root: Path, run_id_arg: Optional[str] = None, auto_appr
|
|
|
157
192
|
except Exception:
|
|
158
193
|
pass
|
|
159
194
|
|
|
195
|
+
# Diff Preview Mode
|
|
196
|
+
if diff_only:
|
|
197
|
+
print()
|
|
198
|
+
print(box_header("🛡️ TORUSGUARD GOVERNED PATCH DIFF PREVIEW", "Dry-Run Unified Diff Inspection (No Files Modified)", "v1.4.0"))
|
|
199
|
+
print()
|
|
200
|
+
print(border_top(f"Candidate Patches ({len(bundles)})"))
|
|
201
|
+
for idx, b in enumerate(bundles, 1):
|
|
202
|
+
rule_id = b.get("rule_id", "TG-SEC")
|
|
203
|
+
rel_path = b.get("target_file", "")
|
|
204
|
+
line_no = b.get("line_number", 1)
|
|
205
|
+
diff = b.get("proposed_diff", "")
|
|
206
|
+
desc = b.get("what_should_change", "")
|
|
207
|
+
print(f" {YELLOW}─── [{idx}/{len(bundles)}] Candidate Patch: [{rule_id}] on {rel_path}:{line_no} ───{RESET}")
|
|
208
|
+
print(f" Strategy: {WHITE}{desc}{RESET}")
|
|
209
|
+
print(f" Ponytail: {GREEN}+{b.get('additions', 0)} / -{b.get('deletions', 0)}{RESET}\n")
|
|
210
|
+
for dline in diff.splitlines()[:16]:
|
|
211
|
+
if dline.startswith("+") and not dline.startswith("+++"):
|
|
212
|
+
print(f" {GREEN}{dline}{RESET}")
|
|
213
|
+
elif dline.startswith("-") and not dline.startswith("---"):
|
|
214
|
+
print(f" {RED}{dline}{RESET}")
|
|
215
|
+
elif dline.startswith("@"):
|
|
216
|
+
print(f" {CYAN}{dline}{RESET}")
|
|
217
|
+
else:
|
|
218
|
+
print(f" {DIM}{dline}{RESET}")
|
|
219
|
+
print()
|
|
220
|
+
print(border_bottom())
|
|
221
|
+
print(f"\n {DIM}To apply these patches to disk, run: {CYAN}npx torusguard apply{RESET} or {CYAN}npx torusguard apply --yes{RESET}\n")
|
|
222
|
+
return {
|
|
223
|
+
"status": "diff_preview",
|
|
224
|
+
"bundles_count": len(bundles),
|
|
225
|
+
"bundles": bundles
|
|
226
|
+
}
|
|
227
|
+
|
|
160
228
|
# Snapshot directory
|
|
161
229
|
snapshot_dir = target_root / ".torusguard" / "snapshots" / run_folder.name
|
|
162
230
|
snapshot_dir.mkdir(parents=True, exist_ok=True)
|
|
163
231
|
|
|
164
232
|
# Header Card
|
|
165
233
|
print()
|
|
166
|
-
print(box_header("🛡️ TORUSGUARD GOVERNED PATCH APPLIER", "Human-Gate Authorization, Snapshots & Golden Recipe Distillation", "v1.
|
|
234
|
+
print(box_header("🛡️ TORUSGUARD GOVERNED PATCH APPLIER", "Human-Gate Authorization, Snapshots & Golden Recipe Distillation", "v1.4.0"))
|
|
167
235
|
print()
|
|
168
236
|
|
|
169
237
|
print(border_top("Candidate Bundles Ready for Application"))
|
|
@@ -175,7 +243,7 @@ def execute_apply(target_root: Path, run_id_arg: Optional[str] = None, auto_appr
|
|
|
175
243
|
|
|
176
244
|
applied_count = 0
|
|
177
245
|
skipped_count = 0
|
|
178
|
-
all_approved = auto_approve
|
|
246
|
+
all_approved = False if selective else auto_approve
|
|
179
247
|
diff_summary_lines = [f"# TorusGuard Applied Patch Summary: {run_folder.name}\n"]
|
|
180
248
|
applied_bundles = []
|
|
181
249
|
|
|
@@ -351,6 +419,21 @@ def execute_apply(target_root: Path, run_id_arg: Optional[str] = None, auto_appr
|
|
|
351
419
|
print(border_bottom(border_color=GREEN, double=True))
|
|
352
420
|
print()
|
|
353
421
|
|
|
422
|
+
if verify_post_apply and applied_count > 0:
|
|
423
|
+
recheck_script = scripts_dir / "recheck_runner.py"
|
|
424
|
+
if recheck_script.is_file():
|
|
425
|
+
print(f"\n {CYAN}▸ Triggering differential recheck post-apply (--verify)...{RESET}\n")
|
|
426
|
+
try:
|
|
427
|
+
import importlib.util
|
|
428
|
+
spec = importlib.util.spec_from_file_location("recheck_runner", str(recheck_script))
|
|
429
|
+
if spec and spec.loader:
|
|
430
|
+
rc_mod = importlib.util.module_from_spec(spec)
|
|
431
|
+
spec.loader.exec_module(rc_mod)
|
|
432
|
+
if hasattr(rc_mod, "execute_recheck"):
|
|
433
|
+
rc_mod.execute_recheck(target_root, run_folder.name)
|
|
434
|
+
except Exception as e:
|
|
435
|
+
print(f" {YELLOW}⚠ Post-apply recheck notice: {e}{RESET}")
|
|
436
|
+
|
|
354
437
|
return {
|
|
355
438
|
"applied_count": applied_count,
|
|
356
439
|
"skipped_count": skipped_count,
|
|
@@ -362,19 +445,35 @@ def execute_apply(target_root: Path, run_id_arg: Optional[str] = None, auto_appr
|
|
|
362
445
|
def main():
|
|
363
446
|
parser = argparse.ArgumentParser(description="TorusGuard Governed Patch Application Engine")
|
|
364
447
|
parser.add_argument("path", nargs="?", default=".", help="Target project root directory")
|
|
448
|
+
parser.add_argument("--target", "-t", help="Target project root directory (alias for path)")
|
|
365
449
|
parser.add_argument("--run", "-r", help="Explicit run ID to apply")
|
|
366
450
|
parser.add_argument("--yes", "-y", action="store_true", help="Auto-approve all patches (non-interactive)")
|
|
451
|
+
parser.add_argument("--diff", action="store_true", help="Preview unified diffs without modifying files on disk")
|
|
452
|
+
parser.add_argument("--selective", action="store_true", help="Interactively review and select patches one by one")
|
|
453
|
+
parser.add_argument("--verify", action="store_true", help="Trigger differential AST recheck immediately post-apply")
|
|
454
|
+
parser.add_argument("--list-snapshots", action="store_true", help="List historical pre-apply backup snapshots")
|
|
367
455
|
parser.add_argument("--rollback", action="store_true", help="Rollback all applied patches using snapshots")
|
|
368
456
|
parser.add_argument("--json", action="store_true", help="Output raw JSON")
|
|
369
457
|
args = parser.parse_args()
|
|
370
458
|
|
|
371
|
-
target = Path(args.path).resolve()
|
|
459
|
+
target = Path(args.target or args.path).resolve()
|
|
460
|
+
|
|
461
|
+
if args.list_snapshots:
|
|
462
|
+
list_snapshots(target)
|
|
463
|
+
return
|
|
372
464
|
|
|
373
465
|
if args.rollback:
|
|
374
466
|
execute_rollback(target, run_id_arg=args.run)
|
|
375
467
|
return
|
|
376
468
|
|
|
377
|
-
result = execute_apply(
|
|
469
|
+
result = execute_apply(
|
|
470
|
+
target,
|
|
471
|
+
run_id_arg=args.run,
|
|
472
|
+
auto_approve=args.yes,
|
|
473
|
+
diff_only=args.diff,
|
|
474
|
+
selective=args.selective,
|
|
475
|
+
verify_post_apply=args.verify
|
|
476
|
+
)
|
|
378
477
|
if args.json:
|
|
379
478
|
print(json.dumps(result, indent=2))
|
|
380
479
|
|