cvm-caspar 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 (603) hide show
  1. cvm_caspar-1.0.0/.gitignore +105 -0
  2. cvm_caspar-1.0.0/INSTALL.md +383 -0
  3. cvm_caspar-1.0.0/LICENSE +202 -0
  4. cvm_caspar-1.0.0/NOTICE +53 -0
  5. cvm_caspar-1.0.0/PKG-INFO +149 -0
  6. cvm_caspar-1.0.0/README.md +216 -0
  7. cvm_caspar-1.0.0/README_PYPI.md +108 -0
  8. cvm_caspar-1.0.0/cli/__init__.py +1 -0
  9. cvm_caspar-1.0.0/cli/_discovery.py +43 -0
  10. cvm_caspar-1.0.0/cli/_knowledge.py +194 -0
  11. cvm_caspar-1.0.0/cli/_output.py +944 -0
  12. cvm_caspar-1.0.0/cli/_publish.py +68 -0
  13. cvm_caspar-1.0.0/cli/commands/__init__.py +1 -0
  14. cvm_caspar-1.0.0/cli/commands/build_cmds.py +191 -0
  15. cvm_caspar-1.0.0/cli/commands/chain_cmds.py +197 -0
  16. cvm_caspar-1.0.0/cli/commands/demo_cmds.py +258 -0
  17. cvm_caspar-1.0.0/cli/commands/init_cmds.py +116 -0
  18. cvm_caspar-1.0.0/cli/commands/manage_cmds.py +380 -0
  19. cvm_caspar-1.0.0/cli/commands/plugin_cmds.py +438 -0
  20. cvm_caspar-1.0.0/cli/commands/publish_cmds.py +40 -0
  21. cvm_caspar-1.0.0/cli/commands/report_cmds.py +342 -0
  22. cvm_caspar-1.0.0/cli/commands/scan_cmds.py +622 -0
  23. cvm_caspar-1.0.0/cli/commands/serve_cmds.py +176 -0
  24. cvm_caspar-1.0.0/cli/main.py +136 -0
  25. cvm_caspar-1.0.0/config_assessment/__init__.py +1 -0
  26. cvm_caspar-1.0.0/config_assessment/api/__init__.py +8 -0
  27. cvm_caspar-1.0.0/config_assessment/api/app.py +71 -0
  28. cvm_caspar-1.0.0/config_assessment/api/chains.py +112 -0
  29. cvm_caspar-1.0.0/config_assessment/api/deps.py +36 -0
  30. cvm_caspar-1.0.0/config_assessment/api/findings.py +191 -0
  31. cvm_caspar-1.0.0/config_assessment/api/job_runner.py +139 -0
  32. cvm_caspar-1.0.0/config_assessment/api/routers/__init__.py +0 -0
  33. cvm_caspar-1.0.0/config_assessment/api/routers/builds.py +91 -0
  34. cvm_caspar-1.0.0/config_assessment/api/routers/chains.py +63 -0
  35. cvm_caspar-1.0.0/config_assessment/api/routers/dimensions.py +200 -0
  36. cvm_caspar-1.0.0/config_assessment/api/routers/findings.py +146 -0
  37. cvm_caspar-1.0.0/config_assessment/api/routers/health.py +32 -0
  38. cvm_caspar-1.0.0/config_assessment/api/routers/hosts.py +147 -0
  39. cvm_caspar-1.0.0/config_assessment/api/routers/jobs.py +56 -0
  40. cvm_caspar-1.0.0/config_assessment/api/routers/knowledge.py +114 -0
  41. cvm_caspar-1.0.0/config_assessment/api/routers/maintenance.py +80 -0
  42. cvm_caspar-1.0.0/config_assessment/api/routers/manage.py +260 -0
  43. cvm_caspar-1.0.0/config_assessment/api/routers/plugins.py +107 -0
  44. cvm_caspar-1.0.0/config_assessment/api/routers/posture.py +263 -0
  45. cvm_caspar-1.0.0/config_assessment/api/routers/reports.py +75 -0
  46. cvm_caspar-1.0.0/config_assessment/api/routers/scans.py +202 -0
  47. cvm_caspar-1.0.0/config_assessment/api/routers/targets.py +86 -0
  48. cvm_caspar-1.0.0/config_assessment/api/routers/trends.py +45 -0
  49. cvm_caspar-1.0.0/config_assessment/api/routers/watch.py +200 -0
  50. cvm_caspar-1.0.0/config_assessment/api/schemas.py +74 -0
  51. cvm_caspar-1.0.0/config_assessment/api/schemas_jobs.py +77 -0
  52. cvm_caspar-1.0.0/config_assessment/api/schemas_maintenance.py +29 -0
  53. cvm_caspar-1.0.0/config_assessment/api/schemas_manage.py +124 -0
  54. cvm_caspar-1.0.0/config_assessment/api/schemas_watch.py +82 -0
  55. cvm_caspar-1.0.0/config_assessment/api/scoring_explain.py +217 -0
  56. cvm_caspar-1.0.0/config_assessment/api/watch_runner.py +252 -0
  57. cvm_caspar-1.0.0/config_assessment/build/__init__.py +1 -0
  58. cvm_caspar-1.0.0/config_assessment/build/benchmark_extractor.py +395 -0
  59. cvm_caspar-1.0.0/config_assessment/build/build_utils.py +224 -0
  60. cvm_caspar-1.0.0/config_assessment/build/chain_pipeline.py +417 -0
  61. cvm_caspar-1.0.0/config_assessment/build/curated_build.py +75 -0
  62. cvm_caspar-1.0.0/config_assessment/build/generic_build.py +80 -0
  63. cvm_caspar-1.0.0/config_assessment/build/llm_client.py +452 -0
  64. cvm_caspar-1.0.0/config_assessment/build/plugin_detector.py +151 -0
  65. cvm_caspar-1.0.0/config_assessment/build/plugin_scaffolder.py +268 -0
  66. cvm_caspar-1.0.0/config_assessment/build/rag.py +331 -0
  67. cvm_caspar-1.0.0/config_assessment/core/__init__.py +1 -0
  68. cvm_caspar-1.0.0/config_assessment/core/ccss.py +43 -0
  69. cvm_caspar-1.0.0/config_assessment/core/collectors/__init__.py +44 -0
  70. cvm_caspar-1.0.0/config_assessment/core/collectors/exposure.py +305 -0
  71. cvm_caspar-1.0.0/config_assessment/core/collectors/permissions.py +180 -0
  72. cvm_caspar-1.0.0/config_assessment/core/db/__init__.py +1 -0
  73. cvm_caspar-1.0.0/config_assessment/core/db/ccss_canonical.sql.gz +0 -0
  74. cvm_caspar-1.0.0/config_assessment/core/db/database.py +1229 -0
  75. cvm_caspar-1.0.0/config_assessment/core/db/doctor.py +155 -0
  76. cvm_caspar-1.0.0/config_assessment/core/db/reseed.py +124 -0
  77. cvm_caspar-1.0.0/config_assessment/core/db/schema.sql +209 -0
  78. cvm_caspar-1.0.0/config_assessment/core/engines/__init__.py +81 -0
  79. cvm_caspar-1.0.0/config_assessment/core/engines/aggregation.py +247 -0
  80. cvm_caspar-1.0.0/config_assessment/core/engines/assessment.py +235 -0
  81. cvm_caspar-1.0.0/config_assessment/core/engines/attack_chain.py +78 -0
  82. cvm_caspar-1.0.0/config_assessment/core/engines/categorization.py +74 -0
  83. cvm_caspar-1.0.0/config_assessment/core/engines/chain_authoring.py +171 -0
  84. cvm_caspar-1.0.0/config_assessment/core/engines/dimensions.py +308 -0
  85. cvm_caspar-1.0.0/config_assessment/core/engines/knowledge.py +65 -0
  86. cvm_caspar-1.0.0/config_assessment/core/engines/reporting.py +32 -0
  87. cvm_caspar-1.0.0/config_assessment/core/engines/scoring.py +341 -0
  88. cvm_caspar-1.0.0/config_assessment/core/input_resolver.py +838 -0
  89. cvm_caspar-1.0.0/config_assessment/core/inventory.py +132 -0
  90. cvm_caspar-1.0.0/config_assessment/core/manifest.py +103 -0
  91. cvm_caspar-1.0.0/config_assessment/core/models.py +233 -0
  92. cvm_caspar-1.0.0/config_assessment/core/runtime.py +311 -0
  93. cvm_caspar-1.0.0/config_assessment/core/target.py +130 -0
  94. cvm_caspar-1.0.0/config_assessment/core/unknown_directives.py +311 -0
  95. cvm_caspar-1.0.0/config_assessment/core/watch.py +157 -0
  96. cvm_caspar-1.0.0/config_assessment/core/watch_loop.py +61 -0
  97. cvm_caspar-1.0.0/config_assessment/core/watch_session.py +65 -0
  98. cvm_caspar-1.0.0/config_assessment/enrichment/__init__.py +1 -0
  99. cvm_caspar-1.0.0/config_assessment/enrichment/cve_enricher.py +659 -0
  100. cvm_caspar-1.0.0/config_assessment/enrichment/exploit_enricher.py +163 -0
  101. cvm_caspar-1.0.0/config_assessment/enrichment/ttp_enricher.py +119 -0
  102. cvm_caspar-1.0.0/config_assessment/enrichment/version_prefetch.py +96 -0
  103. cvm_caspar-1.0.0/config_assessment/fetch/__init__.py +0 -0
  104. cvm_caspar-1.0.0/config_assessment/fetch/benchmark_fetcher.py +394 -0
  105. cvm_caspar-1.0.0/config_assessment/fetch/catalog.json +568 -0
  106. cvm_caspar-1.0.0/config_assessment/fetch/ssg_source.py +414 -0
  107. cvm_caspar-1.0.0/config_assessment/parsers/__init__.py +1 -0
  108. cvm_caspar-1.0.0/config_assessment/parsers/arm_json.py +109 -0
  109. cvm_caspar-1.0.0/config_assessment/parsers/bicep_flat.py +139 -0
  110. cvm_caspar-1.0.0/config_assessment/parsers/dockerfile.py +105 -0
  111. cvm_caspar-1.0.0/config_assessment/parsers/hcl_flat.py +210 -0
  112. cvm_caspar-1.0.0/config_assessment/parsers/key_value.py +108 -0
  113. cvm_caspar-1.0.0/config_assessment/parsers/yaml_flat.py +99 -0
  114. cvm_caspar-1.0.0/config_assessment/plugins/__init__.py +22 -0
  115. cvm_caspar-1.0.0/config_assessment/plugins/apache_httpd/__init__.py +195 -0
  116. cvm_caspar-1.0.0/config_assessment/plugins/apache_httpd/build_apache.py +728 -0
  117. cvm_caspar-1.0.0/config_assessment/plugins/apache_httpd/build_llm.py +338 -0
  118. cvm_caspar-1.0.0/config_assessment/plugins/apache_httpd/build_narratives.py +113 -0
  119. cvm_caspar-1.0.0/config_assessment/plugins/apache_httpd/cce-apache-httpd2.2-5.20130214.xlsx +0 -0
  120. cvm_caspar-1.0.0/config_assessment/plugins/apache_httpd/chains.json +125 -0
  121. cvm_caspar-1.0.0/config_assessment/plugins/apache_httpd/llm_pipeline.py +704 -0
  122. cvm_caspar-1.0.0/config_assessment/plugins/apache_httpd/narrative_pipeline.py +312 -0
  123. cvm_caspar-1.0.0/config_assessment/plugins/apache_httpd/parser.py +198 -0
  124. cvm_caspar-1.0.0/config_assessment/plugins/apache_httpd/refresh_cve.py +158 -0
  125. cvm_caspar-1.0.0/config_assessment/plugins/apache_httpd/rules.py +123 -0
  126. cvm_caspar-1.0.0/config_assessment/plugins/apache_httpd/validate_mae.py +266 -0
  127. cvm_caspar-1.0.0/config_assessment/plugins/azure_iac/__init__.py +122 -0
  128. cvm_caspar-1.0.0/config_assessment/plugins/azure_iac/build_azure.py +283 -0
  129. cvm_caspar-1.0.0/config_assessment/plugins/azure_iac/canon.py +35 -0
  130. cvm_caspar-1.0.0/config_assessment/plugins/docker/__init__.py +68 -0
  131. cvm_caspar-1.0.0/config_assessment/plugins/docker/build_docker.py +72 -0
  132. cvm_caspar-1.0.0/config_assessment/plugins/docker/chains.json +13 -0
  133. cvm_caspar-1.0.0/config_assessment/plugins/docker/parser.py +8 -0
  134. cvm_caspar-1.0.0/config_assessment/plugins/docker/rules.py +37 -0
  135. cvm_caspar-1.0.0/config_assessment/plugins/dockerfile/__init__.py +97 -0
  136. cvm_caspar-1.0.0/config_assessment/plugins/dockerfile/build_dockerfile.py +34 -0
  137. cvm_caspar-1.0.0/config_assessment/plugins/dockerfile/parser.py +8 -0
  138. cvm_caspar-1.0.0/config_assessment/plugins/dockerfile/rules.py +67 -0
  139. cvm_caspar-1.0.0/config_assessment/plugins/dummy/__init__.py +71 -0
  140. cvm_caspar-1.0.0/config_assessment/plugins/kubernetes/__init__.py +106 -0
  141. cvm_caspar-1.0.0/config_assessment/plugins/kubernetes/build_kubernetes.py +35 -0
  142. cvm_caspar-1.0.0/config_assessment/plugins/kubernetes/chains.json +10 -0
  143. cvm_caspar-1.0.0/config_assessment/plugins/kubernetes/parser.py +9 -0
  144. cvm_caspar-1.0.0/config_assessment/plugins/kubernetes/rules.py +98 -0
  145. cvm_caspar-1.0.0/config_assessment/plugins/mysql/__init__.py +69 -0
  146. cvm_caspar-1.0.0/config_assessment/plugins/mysql/build_mysql.py +39 -0
  147. cvm_caspar-1.0.0/config_assessment/plugins/mysql/parser.py +8 -0
  148. cvm_caspar-1.0.0/config_assessment/plugins/mysql/rules.py +36 -0
  149. cvm_caspar-1.0.0/config_assessment/plugins/nginx/__init__.py +177 -0
  150. cvm_caspar-1.0.0/config_assessment/plugins/nginx/build_nginx.py +376 -0
  151. cvm_caspar-1.0.0/config_assessment/plugins/nginx/chains.json +26 -0
  152. cvm_caspar-1.0.0/config_assessment/plugins/nginx/parser.py +272 -0
  153. cvm_caspar-1.0.0/config_assessment/plugins/nginx/rules.py +118 -0
  154. cvm_caspar-1.0.0/config_assessment/plugins/postgresql/__init__.py +68 -0
  155. cvm_caspar-1.0.0/config_assessment/plugins/postgresql/build_postgresql.py +41 -0
  156. cvm_caspar-1.0.0/config_assessment/plugins/postgresql/chains.json +57 -0
  157. cvm_caspar-1.0.0/config_assessment/plugins/postgresql/parser.py +8 -0
  158. cvm_caspar-1.0.0/config_assessment/plugins/postgresql/rules.py +48 -0
  159. cvm_caspar-1.0.0/config_assessment/plugins/redis/U_Redis_Enterprise_6-x_STIG_V2R2_Manual-xccdf.xml +2173 -0
  160. cvm_caspar-1.0.0/config_assessment/plugins/redis/__init__.py +68 -0
  161. cvm_caspar-1.0.0/config_assessment/plugins/redis/build_redis.py +25 -0
  162. cvm_caspar-1.0.0/config_assessment/plugins/redis/chains.json +57 -0
  163. cvm_caspar-1.0.0/config_assessment/plugins/redis/parser.py +8 -0
  164. cvm_caspar-1.0.0/config_assessment/plugins/redis/rules.py +44 -0
  165. cvm_caspar-1.0.0/config_assessment/plugins/ssh/__init__.py +165 -0
  166. cvm_caspar-1.0.0/config_assessment/plugins/ssh/build_ssh.py +221 -0
  167. cvm_caspar-1.0.0/config_assessment/plugins/ssh/parser.py +193 -0
  168. cvm_caspar-1.0.0/config_assessment/plugins/ssh/rules.py +96 -0
  169. cvm_caspar-1.0.0/config_assessment/plugins/tomcat/U_Apache_Tomcat_Application_Server_9_STIG_V3R4_Manual-xccdf.xml +1620 -0
  170. cvm_caspar-1.0.0/config_assessment/plugins/tomcat/__init__.py +68 -0
  171. cvm_caspar-1.0.0/config_assessment/plugins/tomcat/build_tomcat.py +68 -0
  172. cvm_caspar-1.0.0/config_assessment/plugins/tomcat/chains.json +35 -0
  173. cvm_caspar-1.0.0/config_assessment/plugins/tomcat/parser.py +8 -0
  174. cvm_caspar-1.0.0/config_assessment/plugins/tomcat/rules.py +55 -0
  175. cvm_caspar-1.0.0/config_assessment/plugins/ubuntu/__init__.py +93 -0
  176. cvm_caspar-1.0.0/config_assessment/plugins/ubuntu/build_ubuntu.py +34 -0
  177. cvm_caspar-1.0.0/config_assessment/plugins/ubuntu/parser.py +10 -0
  178. cvm_caspar-1.0.0/config_assessment/plugins/ubuntu/rules.py +140 -0
  179. cvm_caspar-1.0.0/config_assessment/plugins/ubuntu2204/__init__.py +141 -0
  180. cvm_caspar-1.0.0/config_assessment/plugins/ubuntu2204/build_ubuntu2204.py +34 -0
  181. cvm_caspar-1.0.0/config_assessment/plugins/ubuntu2204/rules.py +283 -0
  182. cvm_caspar-1.0.0/config_assessment/reports/__init__.py +1 -0
  183. cvm_caspar-1.0.0/config_assessment/reports/remediation.py +178 -0
  184. cvm_caspar-1.0.0/config_assessment/reports/report_dashboard.py +942 -0
  185. cvm_caspar-1.0.0/config_assessment/reports/report_dashboard_online.py +419 -0
  186. cvm_caspar-1.0.0/config_assessment/reports/report_html.py +507 -0
  187. cvm_caspar-1.0.0/config_assessment/reports/scan_features.py +225 -0
  188. cvm_caspar-1.0.0/data/ccss_canonical.sql +689 -0
  189. cvm_caspar-1.0.0/docker/caspar/.dockerignore +53 -0
  190. cvm_caspar-1.0.0/docker/caspar/Dockerfile +140 -0
  191. cvm_caspar-1.0.0/docker/caspar/Dockerfile.full +27 -0
  192. cvm_caspar-1.0.0/docker/caspar/Dockerfile.slim +40 -0
  193. cvm_caspar-1.0.0/docker/caspar/README.md +187 -0
  194. cvm_caspar-1.0.0/docker/caspar/docker-compose.yml +34 -0
  195. cvm_caspar-1.0.0/docker/caspar/entrypoint_full.sh +105 -0
  196. cvm_caspar-1.0.0/docker/caspar/seed_data.sh +50 -0
  197. cvm_caspar-1.0.0/docker/nginx-vulnerable/Dockerfile +22 -0
  198. cvm_caspar-1.0.0/docker/nginx-vulnerable/nginx.conf +52 -0
  199. cvm_caspar-1.0.0/docs/01_README_CASPAR_v1.md +801 -0
  200. cvm_caspar-1.0.0/docs/02_GUIA_CASPAR.md +1114 -0
  201. cvm_caspar-1.0.0/docs/03_GUIA_VM_UBUNTU22.md +488 -0
  202. cvm_caspar-1.0.0/docs/04_AVALIACAO_FUNCIONAL.md +194 -0
  203. cvm_caspar-1.0.0/docs/05_GUIA_TECNICO.md +319 -0
  204. cvm_caspar-1.0.0/docs/06_VALIDACAO.md +1041 -0
  205. cvm_caspar-1.0.0/docs/07_GUIA_TESTE_COMPLETO.md +867 -0
  206. cvm_caspar-1.0.0/docs/HANDOFF.md +428 -0
  207. cvm_caspar-1.0.0/docs/assets/cli-mockup.png +0 -0
  208. cvm_caspar-1.0.0/docs/cvm/EVOLUCAO.md +252 -0
  209. cvm_caspar-1.0.0/docs/cvm/PRD.md +131 -0
  210. cvm_caspar-1.0.0/docs/cvm/VISAO_PRODUTO.md +68 -0
  211. cvm_caspar-1.0.0/docs/img/cvm-console-mockup.png +0 -0
  212. cvm_caspar-1.0.0/docs/img/dashboard_online_fallback.png +0 -0
  213. cvm_caspar-1.0.0/docs/img/dashboard_preview.png +0 -0
  214. cvm_caspar-1.0.0/docs/tese-docs/DISSERTACAO_REFERENCIA.md +724 -0
  215. cvm_caspar-1.0.0/docs/tese-docs/PROMPT_HANDOFF_ESCRITA.md +23 -0
  216. cvm_caspar-1.0.0/docs/tese-docs/RESPOSTA_REVISORES.md +426 -0
  217. cvm_caspar-1.0.0/frontend/.gitignore +13 -0
  218. cvm_caspar-1.0.0/frontend/PARITY.md +95 -0
  219. cvm_caspar-1.0.0/frontend/README.md +159 -0
  220. cvm_caspar-1.0.0/frontend/dist/assets/charts-BLacFBYH.js +73 -0
  221. cvm_caspar-1.0.0/frontend/dist/assets/index-CUhIFMOg.css +1 -0
  222. cvm_caspar-1.0.0/frontend/dist/assets/index-T2YLv5jH.js +358 -0
  223. cvm_caspar-1.0.0/frontend/dist/assets/query-CKBowX9j.js +9 -0
  224. cvm_caspar-1.0.0/frontend/dist/assets/react-DBpqIJvm.js +59 -0
  225. cvm_caspar-1.0.0/frontend/dist/favicon.svg +11 -0
  226. cvm_caspar-1.0.0/frontend/dist/index.html +18 -0
  227. cvm_caspar-1.0.0/frontend/index.html +14 -0
  228. cvm_caspar-1.0.0/frontend/package-lock.json +4176 -0
  229. cvm_caspar-1.0.0/frontend/package.json +36 -0
  230. cvm_caspar-1.0.0/frontend/public/favicon.svg +11 -0
  231. cvm_caspar-1.0.0/frontend/src/App.tsx +25 -0
  232. cvm_caspar-1.0.0/frontend/src/api/client.ts +66 -0
  233. cvm_caspar-1.0.0/frontend/src/api/health.ts +12 -0
  234. cvm_caspar-1.0.0/frontend/src/api/hosts.ts +22 -0
  235. cvm_caspar-1.0.0/frontend/src/api/jobs.ts +118 -0
  236. cvm_caspar-1.0.0/frontend/src/api/knowledge.ts +37 -0
  237. cvm_caspar-1.0.0/frontend/src/api/manage.test.tsx +130 -0
  238. cvm_caspar-1.0.0/frontend/src/api/manage.ts +111 -0
  239. cvm_caspar-1.0.0/frontend/src/api/reports.ts +54 -0
  240. cvm_caspar-1.0.0/frontend/src/api/scans.ts +139 -0
  241. cvm_caspar-1.0.0/frontend/src/api/targets.ts +20 -0
  242. cvm_caspar-1.0.0/frontend/src/api/trends.ts +11 -0
  243. cvm_caspar-1.0.0/frontend/src/api/types.ts +350 -0
  244. cvm_caspar-1.0.0/frontend/src/api/watch.ts +100 -0
  245. cvm_caspar-1.0.0/frontend/src/components/assessment/CompareView.tsx +83 -0
  246. cvm_caspar-1.0.0/frontend/src/components/assessment/HistoryView.tsx +69 -0
  247. cvm_caspar-1.0.0/frontend/src/components/assessment/RemediateView.module.css +104 -0
  248. cvm_caspar-1.0.0/frontend/src/components/assessment/RemediateView.tsx +183 -0
  249. cvm_caspar-1.0.0/frontend/src/components/assessment/RunAssessmentForm.tsx +236 -0
  250. cvm_caspar-1.0.0/frontend/src/components/assessment/ScanResultView.tsx +70 -0
  251. cvm_caspar-1.0.0/frontend/src/components/dashboard/AttackChainsList.module.css +58 -0
  252. cvm_caspar-1.0.0/frontend/src/components/dashboard/AttackChainsList.tsx +73 -0
  253. cvm_caspar-1.0.0/frontend/src/components/dashboard/ChainDetail.module.css +99 -0
  254. cvm_caspar-1.0.0/frontend/src/components/dashboard/ChainDetail.tsx +119 -0
  255. cvm_caspar-1.0.0/frontend/src/components/dashboard/FindingsTable.module.css +24 -0
  256. cvm_caspar-1.0.0/frontend/src/components/dashboard/FindingsTable.tsx +101 -0
  257. cvm_caspar-1.0.0/frontend/src/components/dashboard/KpiTile.module.css +78 -0
  258. cvm_caspar-1.0.0/frontend/src/components/dashboard/KpiTile.tsx +36 -0
  259. cvm_caspar-1.0.0/frontend/src/components/dashboard/QuickActions.module.css +10 -0
  260. cvm_caspar-1.0.0/frontend/src/components/dashboard/QuickActions.tsx +25 -0
  261. cvm_caspar-1.0.0/frontend/src/components/dashboard/RecentFindingsList.module.css +56 -0
  262. cvm_caspar-1.0.0/frontend/src/components/dashboard/RecentFindingsList.tsx +69 -0
  263. cvm_caspar-1.0.0/frontend/src/components/dashboard/ScoreGauge.module.css +58 -0
  264. cvm_caspar-1.0.0/frontend/src/components/dashboard/ScoreGauge.tsx +140 -0
  265. cvm_caspar-1.0.0/frontend/src/components/dashboard/ScoreTrendChart.module.css +24 -0
  266. cvm_caspar-1.0.0/frontend/src/components/dashboard/ScoreTrendChart.tsx +134 -0
  267. cvm_caspar-1.0.0/frontend/src/components/dashboard/ServiceIcon.module.css +74 -0
  268. cvm_caspar-1.0.0/frontend/src/components/dashboard/ServiceIcon.tsx +83 -0
  269. cvm_caspar-1.0.0/frontend/src/components/dashboard/ServiceScoreList.module.css +55 -0
  270. cvm_caspar-1.0.0/frontend/src/components/dashboard/ServiceScoreList.tsx +54 -0
  271. cvm_caspar-1.0.0/frontend/src/components/dashboard/SeverityDonut.module.css +70 -0
  272. cvm_caspar-1.0.0/frontend/src/components/dashboard/SeverityDonut.tsx +85 -0
  273. cvm_caspar-1.0.0/frontend/src/components/dashboard/StatRow.module.css +86 -0
  274. cvm_caspar-1.0.0/frontend/src/components/dashboard/StatRow.tsx +55 -0
  275. cvm_caspar-1.0.0/frontend/src/components/dashboard/StatusFooter.module.css +86 -0
  276. cvm_caspar-1.0.0/frontend/src/components/dashboard/StatusFooter.tsx +119 -0
  277. cvm_caspar-1.0.0/frontend/src/components/jobs/JobConsole.module.css +121 -0
  278. cvm_caspar-1.0.0/frontend/src/components/jobs/JobConsole.tsx +98 -0
  279. cvm_caspar-1.0.0/frontend/src/components/knowledge/BenchmarkList.module.css +47 -0
  280. cvm_caspar-1.0.0/frontend/src/components/knowledge/BenchmarkList.tsx +32 -0
  281. cvm_caspar-1.0.0/frontend/src/components/knowledge/ChainList.module.css +34 -0
  282. cvm_caspar-1.0.0/frontend/src/components/knowledge/ChainList.tsx +25 -0
  283. cvm_caspar-1.0.0/frontend/src/components/knowledge/FindingDetail.module.css +180 -0
  284. cvm_caspar-1.0.0/frontend/src/components/knowledge/FindingDetail.tsx +205 -0
  285. cvm_caspar-1.0.0/frontend/src/components/knowledge/RuleDetailPanel.module.css +79 -0
  286. cvm_caspar-1.0.0/frontend/src/components/knowledge/RuleDetailPanel.tsx +47 -0
  287. cvm_caspar-1.0.0/frontend/src/components/knowledge/RuleTable.tsx +34 -0
  288. cvm_caspar-1.0.0/frontend/src/components/layout/ErrorBoundary.tsx +83 -0
  289. cvm_caspar-1.0.0/frontend/src/components/layout/PageHeader.module.css +26 -0
  290. cvm_caspar-1.0.0/frontend/src/components/layout/PageHeader.tsx +20 -0
  291. cvm_caspar-1.0.0/frontend/src/components/layout/Sidebar.module.css +108 -0
  292. cvm_caspar-1.0.0/frontend/src/components/layout/Sidebar.tsx +93 -0
  293. cvm_caspar-1.0.0/frontend/src/components/layout/Topbar.module.css +77 -0
  294. cvm_caspar-1.0.0/frontend/src/components/layout/Topbar.tsx +48 -0
  295. cvm_caspar-1.0.0/frontend/src/components/reports/ReportList.tsx +97 -0
  296. cvm_caspar-1.0.0/frontend/src/components/reports/ReportPreviewModal.module.css +68 -0
  297. cvm_caspar-1.0.0/frontend/src/components/reports/ReportPreviewModal.tsx +56 -0
  298. cvm_caspar-1.0.0/frontend/src/components/settings/SuppressionsPanel.module.css +25 -0
  299. cvm_caspar-1.0.0/frontend/src/components/settings/SuppressionsPanel.tsx +208 -0
  300. cvm_caspar-1.0.0/frontend/src/components/ui/Badge.module.css +47 -0
  301. cvm_caspar-1.0.0/frontend/src/components/ui/Badge.tsx +26 -0
  302. cvm_caspar-1.0.0/frontend/src/components/ui/Button.module.css +64 -0
  303. cvm_caspar-1.0.0/frontend/src/components/ui/Button.tsx +17 -0
  304. cvm_caspar-1.0.0/frontend/src/components/ui/Card.module.css +59 -0
  305. cvm_caspar-1.0.0/frontend/src/components/ui/Card.tsx +31 -0
  306. cvm_caspar-1.0.0/frontend/src/components/ui/EmptyState.module.css +35 -0
  307. cvm_caspar-1.0.0/frontend/src/components/ui/EmptyState.tsx +20 -0
  308. cvm_caspar-1.0.0/frontend/src/components/ui/Modal.module.css +74 -0
  309. cvm_caspar-1.0.0/frontend/src/components/ui/Modal.tsx +46 -0
  310. cvm_caspar-1.0.0/frontend/src/components/ui/Skeleton.module.css +21 -0
  311. cvm_caspar-1.0.0/frontend/src/components/ui/Skeleton.tsx +26 -0
  312. cvm_caspar-1.0.0/frontend/src/components/ui/Table.module.css +59 -0
  313. cvm_caspar-1.0.0/frontend/src/components/ui/Table.tsx +53 -0
  314. cvm_caspar-1.0.0/frontend/src/components/watch/WatchEventDetail.module.css +25 -0
  315. cvm_caspar-1.0.0/frontend/src/components/watch/WatchEventDetail.tsx +61 -0
  316. cvm_caspar-1.0.0/frontend/src/context/PreferencesContext.test.tsx +77 -0
  317. cvm_caspar-1.0.0/frontend/src/context/PreferencesContext.tsx +74 -0
  318. cvm_caspar-1.0.0/frontend/src/context/ThemeContext.tsx +48 -0
  319. cvm_caspar-1.0.0/frontend/src/lib/dashboard.test.ts +141 -0
  320. cvm_caspar-1.0.0/frontend/src/lib/dashboard.ts +94 -0
  321. cvm_caspar-1.0.0/frontend/src/lib/narrative.test.ts +45 -0
  322. cvm_caspar-1.0.0/frontend/src/lib/narrative.ts +78 -0
  323. cvm_caspar-1.0.0/frontend/src/lib/severity.ts +52 -0
  324. cvm_caspar-1.0.0/frontend/src/main.tsx +37 -0
  325. cvm_caspar-1.0.0/frontend/src/pages/AssessmentPage.module.css +237 -0
  326. cvm_caspar-1.0.0/frontend/src/pages/AssessmentPage.tsx +85 -0
  327. cvm_caspar-1.0.0/frontend/src/pages/BuildPage.tsx +183 -0
  328. cvm_caspar-1.0.0/frontend/src/pages/DashboardPage.module.css +62 -0
  329. cvm_caspar-1.0.0/frontend/src/pages/DashboardPage.tsx +259 -0
  330. cvm_caspar-1.0.0/frontend/src/pages/JobsShared.module.css +232 -0
  331. cvm_caspar-1.0.0/frontend/src/pages/KnowledgeBasePage.module.css +44 -0
  332. cvm_caspar-1.0.0/frontend/src/pages/KnowledgeBasePage.tsx +98 -0
  333. cvm_caspar-1.0.0/frontend/src/pages/PluginsPage.tsx +233 -0
  334. cvm_caspar-1.0.0/frontend/src/pages/ReportsPage.tsx +75 -0
  335. cvm_caspar-1.0.0/frontend/src/pages/SettingsPage.module.css +145 -0
  336. cvm_caspar-1.0.0/frontend/src/pages/SettingsPage.tsx +238 -0
  337. cvm_caspar-1.0.0/frontend/src/pages/WatchPage.module.css +282 -0
  338. cvm_caspar-1.0.0/frontend/src/pages/WatchPage.test.tsx +53 -0
  339. cvm_caspar-1.0.0/frontend/src/pages/WatchPage.tsx +605 -0
  340. cvm_caspar-1.0.0/frontend/src/routes.tsx +20 -0
  341. cvm_caspar-1.0.0/frontend/src/styles/global.css +165 -0
  342. cvm_caspar-1.0.0/frontend/src/styles/tokens.css +270 -0
  343. cvm_caspar-1.0.0/frontend/src/test/dashboard.rollup.test.tsx +89 -0
  344. cvm_caspar-1.0.0/frontend/src/test/finding.location.test.tsx +83 -0
  345. cvm_caspar-1.0.0/frontend/src/test/findings.duplicate.test.tsx +64 -0
  346. cvm_caspar-1.0.0/frontend/src/test/fixtures-scan-detail.json +1 -0
  347. cvm_caspar-1.0.0/frontend/src/test/navigation.repro.test.tsx +77 -0
  348. cvm_caspar-1.0.0/frontend/src/test/overview.refresh.test.tsx +82 -0
  349. cvm_caspar-1.0.0/frontend/src/test/reports.delete.test.tsx +102 -0
  350. cvm_caspar-1.0.0/frontend/src/test/setup.ts +6 -0
  351. cvm_caspar-1.0.0/frontend/src/test/watch.eventdetail.test.tsx +81 -0
  352. cvm_caspar-1.0.0/frontend/src/test/watch.selection.test.tsx +87 -0
  353. cvm_caspar-1.0.0/frontend/src/test/watch.session.test.tsx +126 -0
  354. cvm_caspar-1.0.0/frontend/src/vite-env.d.ts +6 -0
  355. cvm_caspar-1.0.0/frontend/tsconfig.json +23 -0
  356. cvm_caspar-1.0.0/frontend/tsconfig.tsbuildinfo +1 -0
  357. cvm_caspar-1.0.0/frontend/vite.config.ts +56 -0
  358. cvm_caspar-1.0.0/frontend-v2/.gitignore +37 -0
  359. cvm_caspar-1.0.0/frontend-v2/.lovable/project.json +5 -0
  360. cvm_caspar-1.0.0/frontend-v2/.prettierignore +8 -0
  361. cvm_caspar-1.0.0/frontend-v2/.prettierrc +6 -0
  362. cvm_caspar-1.0.0/frontend-v2/AGENTS.md +10 -0
  363. cvm_caspar-1.0.0/frontend-v2/README.md +98 -0
  364. cvm_caspar-1.0.0/frontend-v2/bun.lock +1049 -0
  365. cvm_caspar-1.0.0/frontend-v2/bunfig.toml +7 -0
  366. cvm_caspar-1.0.0/frontend-v2/components.json +22 -0
  367. cvm_caspar-1.0.0/frontend-v2/dist/assets/JobConsole-B5TzVvBO.js +1 -0
  368. cvm_caspar-1.0.0/frontend-v2/dist/assets/Pager-DGkcPZxi.js +1 -0
  369. cvm_caspar-1.0.0/frontend-v2/dist/assets/arrow-right-CoUZZYja.js +1 -0
  370. cvm_caspar-1.0.0/frontend-v2/dist/assets/assessment-CWjDYtm4.js +1 -0
  371. cvm_caspar-1.0.0/frontend-v2/dist/assets/build-CWwe6xXy.js +1 -0
  372. cvm_caspar-1.0.0/frontend-v2/dist/assets/chains-Bp-2RuOM.js +1 -0
  373. cvm_caspar-1.0.0/frontend-v2/dist/assets/chains-CHoELElb.js +1 -0
  374. cvm_caspar-1.0.0/frontend-v2/dist/assets/charts-DaqLp_gX.js +59 -0
  375. cvm_caspar-1.0.0/frontend-v2/dist/assets/circle-slash-CXTugZTs.js +1 -0
  376. cvm_caspar-1.0.0/frontend-v2/dist/assets/dimensions-BAF2npX5.js +1 -0
  377. cvm_caspar-1.0.0/frontend-v2/dist/assets/dimensions._dimensionId-C3_eBojp.js +1 -0
  378. cvm_caspar-1.0.0/frontend-v2/dist/assets/dimensions._dimensionId-DFLMAtbl.js +2 -0
  379. cvm_caspar-1.0.0/frontend-v2/dist/assets/dimensions.index-BBjA5Bzn.js +1 -0
  380. cvm_caspar-1.0.0/frontend-v2/dist/assets/download-Dh1LJG-8.js +1 -0
  381. cvm_caspar-1.0.0/frontend-v2/dist/assets/file-code-corner-BWMYzPBG.js +1 -0
  382. cvm_caspar-1.0.0/frontend-v2/dist/assets/findings-2alsHeTl.js +1 -0
  383. cvm_caspar-1.0.0/frontend-v2/dist/assets/findings-lLEMYnEK.js +1 -0
  384. cvm_caspar-1.0.0/frontend-v2/dist/assets/forms-DgdCPcVc.js +1 -0
  385. cvm_caspar-1.0.0/frontend-v2/dist/assets/history-S4IgFFeE.js +1 -0
  386. cvm_caspar-1.0.0/frontend-v2/dist/assets/index-BZutiq_g.css +2 -0
  387. cvm_caspar-1.0.0/frontend-v2/dist/assets/index-BaMm0UHG.js +10 -0
  388. cvm_caspar-1.0.0/frontend-v2/dist/assets/knowledge-xLSviV7d.js +1 -0
  389. cvm_caspar-1.0.0/frontend-v2/dist/assets/link-BbeBO0_K.js +1 -0
  390. cvm_caspar-1.0.0/frontend-v2/dist/assets/loader-circle-Ba83xNCK.js +1 -0
  391. cvm_caspar-1.0.0/frontend-v2/dist/assets/plugins-CzXMrQwW.js +1 -0
  392. cvm_caspar-1.0.0/frontend-v2/dist/assets/plus-AkERmfFa.js +1 -0
  393. cvm_caspar-1.0.0/frontend-v2/dist/assets/preload-helper-DbwQHY1D.js +1 -0
  394. cvm_caspar-1.0.0/frontend-v2/dist/assets/primitives-BW89Tfln.js +1 -0
  395. cvm_caspar-1.0.0/frontend-v2/dist/assets/reports-BQ3qjrcj.js +1 -0
  396. cvm_caspar-1.0.0/frontend-v2/dist/assets/routes-DQ3bHfQq.js +1 -0
  397. cvm_caspar-1.0.0/frontend-v2/dist/assets/search-2QqRG79P.js +1 -0
  398. cvm_caspar-1.0.0/frontend-v2/dist/assets/settings-DSkJ7P-3.js +1 -0
  399. cvm_caspar-1.0.0/frontend-v2/dist/assets/shield-alert-C7uviNzh.js +1 -0
  400. cvm_caspar-1.0.0/frontend-v2/dist/assets/states-xAIpco0A.js +1 -0
  401. cvm_caspar-1.0.0/frontend-v2/dist/assets/targets-UiGpvtxc.js +1 -0
  402. cvm_caspar-1.0.0/frontend-v2/dist/assets/trash-2-S2IA3E-_.js +1 -0
  403. cvm_caspar-1.0.0/frontend-v2/dist/assets/types-CQXP9NZP.js +1 -0
  404. cvm_caspar-1.0.0/frontend-v2/dist/assets/useNavigate-BqxVW_T_.js +1 -0
  405. cvm_caspar-1.0.0/frontend-v2/dist/assets/watch-mlOhZRdb.js +1 -0
  406. cvm_caspar-1.0.0/frontend-v2/dist/favicon.ico +0 -0
  407. cvm_caspar-1.0.0/frontend-v2/dist/index.html +23 -0
  408. cvm_caspar-1.0.0/frontend-v2/dist/robots.txt +14 -0
  409. cvm_caspar-1.0.0/frontend-v2/eslint.config.js +40 -0
  410. cvm_caspar-1.0.0/frontend-v2/index.html +17 -0
  411. cvm_caspar-1.0.0/frontend-v2/package-lock.json +9053 -0
  412. cvm_caspar-1.0.0/frontend-v2/package.json +96 -0
  413. cvm_caspar-1.0.0/frontend-v2/public/favicon.ico +0 -0
  414. cvm_caspar-1.0.0/frontend-v2/public/robots.txt +14 -0
  415. cvm_caspar-1.0.0/frontend-v2/src/components/cvm/AppShell.tsx +315 -0
  416. cvm_caspar-1.0.0/frontend-v2/src/components/cvm/JobConsole.tsx +144 -0
  417. cvm_caspar-1.0.0/frontend-v2/src/components/cvm/Pager.tsx +84 -0
  418. cvm_caspar-1.0.0/frontend-v2/src/components/cvm/ScoringPanel.tsx +150 -0
  419. cvm_caspar-1.0.0/frontend-v2/src/components/cvm/chains.tsx +247 -0
  420. cvm_caspar-1.0.0/frontend-v2/src/components/cvm/charts.tsx +331 -0
  421. cvm_caspar-1.0.0/frontend-v2/src/components/cvm/dimensions.test.tsx +114 -0
  422. cvm_caspar-1.0.0/frontend-v2/src/components/cvm/dimensions.tsx +104 -0
  423. cvm_caspar-1.0.0/frontend-v2/src/components/cvm/findings.test.tsx +114 -0
  424. cvm_caspar-1.0.0/frontend-v2/src/components/cvm/findings.tsx +328 -0
  425. cvm_caspar-1.0.0/frontend-v2/src/components/cvm/forms.tsx +177 -0
  426. cvm_caspar-1.0.0/frontend-v2/src/components/cvm/primitives.tsx +386 -0
  427. cvm_caspar-1.0.0/frontend-v2/src/components/cvm/states.tsx +144 -0
  428. cvm_caspar-1.0.0/frontend-v2/src/components/ui/accordion.tsx +51 -0
  429. cvm_caspar-1.0.0/frontend-v2/src/components/ui/alert-dialog.tsx +115 -0
  430. cvm_caspar-1.0.0/frontend-v2/src/components/ui/alert.tsx +49 -0
  431. cvm_caspar-1.0.0/frontend-v2/src/components/ui/aspect-ratio.tsx +5 -0
  432. cvm_caspar-1.0.0/frontend-v2/src/components/ui/avatar.tsx +47 -0
  433. cvm_caspar-1.0.0/frontend-v2/src/components/ui/badge.tsx +32 -0
  434. cvm_caspar-1.0.0/frontend-v2/src/components/ui/breadcrumb.tsx +101 -0
  435. cvm_caspar-1.0.0/frontend-v2/src/components/ui/button.tsx +49 -0
  436. cvm_caspar-1.0.0/frontend-v2/src/components/ui/calendar.tsx +177 -0
  437. cvm_caspar-1.0.0/frontend-v2/src/components/ui/card.tsx +55 -0
  438. cvm_caspar-1.0.0/frontend-v2/src/components/ui/carousel.tsx +240 -0
  439. cvm_caspar-1.0.0/frontend-v2/src/components/ui/chart.tsx +331 -0
  440. cvm_caspar-1.0.0/frontend-v2/src/components/ui/checkbox.tsx +26 -0
  441. cvm_caspar-1.0.0/frontend-v2/src/components/ui/collapsible.tsx +11 -0
  442. cvm_caspar-1.0.0/frontend-v2/src/components/ui/command.tsx +143 -0
  443. cvm_caspar-1.0.0/frontend-v2/src/components/ui/context-menu.tsx +186 -0
  444. cvm_caspar-1.0.0/frontend-v2/src/components/ui/dialog.tsx +104 -0
  445. cvm_caspar-1.0.0/frontend-v2/src/components/ui/drawer.tsx +98 -0
  446. cvm_caspar-1.0.0/frontend-v2/src/components/ui/dropdown-menu.tsx +187 -0
  447. cvm_caspar-1.0.0/frontend-v2/src/components/ui/form.tsx +171 -0
  448. cvm_caspar-1.0.0/frontend-v2/src/components/ui/hover-card.tsx +27 -0
  449. cvm_caspar-1.0.0/frontend-v2/src/components/ui/input-otp.tsx +73 -0
  450. cvm_caspar-1.0.0/frontend-v2/src/components/ui/input.tsx +22 -0
  451. cvm_caspar-1.0.0/frontend-v2/src/components/ui/label.tsx +21 -0
  452. cvm_caspar-1.0.0/frontend-v2/src/components/ui/menubar.tsx +228 -0
  453. cvm_caspar-1.0.0/frontend-v2/src/components/ui/navigation-menu.tsx +120 -0
  454. cvm_caspar-1.0.0/frontend-v2/src/components/ui/pagination.tsx +98 -0
  455. cvm_caspar-1.0.0/frontend-v2/src/components/ui/popover.tsx +31 -0
  456. cvm_caspar-1.0.0/frontend-v2/src/components/ui/progress.tsx +25 -0
  457. cvm_caspar-1.0.0/frontend-v2/src/components/ui/radio-group.tsx +36 -0
  458. cvm_caspar-1.0.0/frontend-v2/src/components/ui/resizable.tsx +37 -0
  459. cvm_caspar-1.0.0/frontend-v2/src/components/ui/scroll-area.tsx +44 -0
  460. cvm_caspar-1.0.0/frontend-v2/src/components/ui/select.tsx +152 -0
  461. cvm_caspar-1.0.0/frontend-v2/src/components/ui/separator.tsx +24 -0
  462. cvm_caspar-1.0.0/frontend-v2/src/components/ui/sheet.tsx +122 -0
  463. cvm_caspar-1.0.0/frontend-v2/src/components/ui/sidebar.tsx +744 -0
  464. cvm_caspar-1.0.0/frontend-v2/src/components/ui/skeleton.tsx +7 -0
  465. cvm_caspar-1.0.0/frontend-v2/src/components/ui/slider.tsx +23 -0
  466. cvm_caspar-1.0.0/frontend-v2/src/components/ui/sonner.tsx +23 -0
  467. cvm_caspar-1.0.0/frontend-v2/src/components/ui/switch.tsx +27 -0
  468. cvm_caspar-1.0.0/frontend-v2/src/components/ui/table.tsx +94 -0
  469. cvm_caspar-1.0.0/frontend-v2/src/components/ui/tabs.tsx +53 -0
  470. cvm_caspar-1.0.0/frontend-v2/src/components/ui/textarea.tsx +21 -0
  471. cvm_caspar-1.0.0/frontend-v2/src/components/ui/toggle-group.tsx +57 -0
  472. cvm_caspar-1.0.0/frontend-v2/src/components/ui/toggle.tsx +42 -0
  473. cvm_caspar-1.0.0/frontend-v2/src/components/ui/tooltip.tsx +32 -0
  474. cvm_caspar-1.0.0/frontend-v2/src/hooks/use-mobile.tsx +19 -0
  475. cvm_caspar-1.0.0/frontend-v2/src/lib/cvm/api.test.ts +59 -0
  476. cvm_caspar-1.0.0/frontend-v2/src/lib/cvm/api.ts +456 -0
  477. cvm_caspar-1.0.0/frontend-v2/src/lib/cvm/client.ts +282 -0
  478. cvm_caspar-1.0.0/frontend-v2/src/lib/cvm/jobs.ts +240 -0
  479. cvm_caspar-1.0.0/frontend-v2/src/lib/cvm/knowledge.ts +174 -0
  480. cvm_caspar-1.0.0/frontend-v2/src/lib/cvm/manage.ts +202 -0
  481. cvm_caspar-1.0.0/frontend-v2/src/lib/cvm/scans.ts +242 -0
  482. cvm_caspar-1.0.0/frontend-v2/src/lib/cvm/types.ts +252 -0
  483. cvm_caspar-1.0.0/frontend-v2/src/lib/cvm/ui.test.ts +115 -0
  484. cvm_caspar-1.0.0/frontend-v2/src/lib/cvm/ui.tsx +174 -0
  485. cvm_caspar-1.0.0/frontend-v2/src/lib/error-capture.ts +81 -0
  486. cvm_caspar-1.0.0/frontend-v2/src/lib/error-page.ts +30 -0
  487. cvm_caspar-1.0.0/frontend-v2/src/lib/lovable-error-reporting.ts +58 -0
  488. cvm_caspar-1.0.0/frontend-v2/src/lib/utils.ts +6 -0
  489. cvm_caspar-1.0.0/frontend-v2/src/main.tsx +38 -0
  490. cvm_caspar-1.0.0/frontend-v2/src/routeTree.gen.ts +315 -0
  491. cvm_caspar-1.0.0/frontend-v2/src/router.tsx +51 -0
  492. cvm_caspar-1.0.0/frontend-v2/src/routes/README.md +21 -0
  493. cvm_caspar-1.0.0/frontend-v2/src/routes/__root.tsx +86 -0
  494. cvm_caspar-1.0.0/frontend-v2/src/routes/assessment.tsx +666 -0
  495. cvm_caspar-1.0.0/frontend-v2/src/routes/build.tsx +284 -0
  496. cvm_caspar-1.0.0/frontend-v2/src/routes/chains.tsx +250 -0
  497. cvm_caspar-1.0.0/frontend-v2/src/routes/dimensions.$dimensionId.tsx +322 -0
  498. cvm_caspar-1.0.0/frontend-v2/src/routes/dimensions.index.tsx +157 -0
  499. cvm_caspar-1.0.0/frontend-v2/src/routes/findings.tsx +292 -0
  500. cvm_caspar-1.0.0/frontend-v2/src/routes/index.tsx +465 -0
  501. cvm_caspar-1.0.0/frontend-v2/src/routes/knowledge.tsx +781 -0
  502. cvm_caspar-1.0.0/frontend-v2/src/routes/plugins.tsx +282 -0
  503. cvm_caspar-1.0.0/frontend-v2/src/routes/reports.tsx +271 -0
  504. cvm_caspar-1.0.0/frontend-v2/src/routes/settings.tsx +696 -0
  505. cvm_caspar-1.0.0/frontend-v2/src/routes/targets.tsx +159 -0
  506. cvm_caspar-1.0.0/frontend-v2/src/routes/watch.tsx +164 -0
  507. cvm_caspar-1.0.0/frontend-v2/src/styles.css +206 -0
  508. cvm_caspar-1.0.0/frontend-v2/src/test/setup.ts +6 -0
  509. cvm_caspar-1.0.0/frontend-v2/tsconfig.json +30 -0
  510. cvm_caspar-1.0.0/frontend-v2/vite.config.ts +76 -0
  511. cvm_caspar-1.0.0/install-native.sh +52 -0
  512. cvm_caspar-1.0.0/pyproject.toml +133 -0
  513. cvm_caspar-1.0.0/test_target/Dockerfile +14 -0
  514. cvm_caspar-1.0.0/test_target/Dockerfile.hardened +10 -0
  515. cvm_caspar-1.0.0/test_target/Dockerfile.vulnerable +5 -0
  516. cvm_caspar-1.0.0/test_target/README_TESTE.md +43 -0
  517. cvm_caspar-1.0.0/test_target/azure_storage_hardened.tf +34 -0
  518. cvm_caspar-1.0.0/test_target/azure_storage_vulnerable.tf +36 -0
  519. cvm_caspar-1.0.0/test_target/httpd.conf +65 -0
  520. cvm_caspar-1.0.0/test_target/httpd_absence.conf +25 -0
  521. cvm_caspar-1.0.0/test_target/httpd_hardened.conf +38 -0
  522. cvm_caspar-1.0.0/test_target/mysql_demo/my.cnf +22 -0
  523. cvm_caspar-1.0.0/test_target/mysql_hardened_demo/my.cnf +22 -0
  524. cvm_caspar-1.0.0/test_target/nginx.conf +43 -0
  525. cvm_caspar-1.0.0/test_target/nginx_absence.conf +35 -0
  526. cvm_caspar-1.0.0/test_target/nginx_hardened.conf +37 -0
  527. cvm_caspar-1.0.0/test_target/nginx_realistic.conf +38 -0
  528. cvm_caspar-1.0.0/test_target/pod_hardened.yaml +25 -0
  529. cvm_caspar-1.0.0/test_target/pod_vulnerable.yaml +19 -0
  530. cvm_caspar-1.0.0/test_target/redis_demo/redis.conf +16 -0
  531. cvm_caspar-1.0.0/test_target/redis_hardened_demo/redis.conf +16 -0
  532. cvm_caspar-1.0.0/test_target/ssh_demo/sshd_config +18 -0
  533. cvm_caspar-1.0.0/test_target/ssh_demo/sshd_config_hardened +22 -0
  534. cvm_caspar-1.0.0/test_target/test_httpd.conf +25 -0
  535. cvm_caspar-1.0.0/test_target/test_nginx.conf +47 -0
  536. cvm_caspar-1.0.0/test_target/tomcat_demo/tomcat.conf +17 -0
  537. cvm_caspar-1.0.0/test_target/tomcat_hardened_demo/tomcat.conf +17 -0
  538. cvm_caspar-1.0.0/test_target/ubuntu_demo/sysctl.conf +14 -0
  539. cvm_caspar-1.0.0/test_target/ubuntu_hardened_demo/sysctl.conf +14 -0
  540. cvm_caspar-1.0.0/tests/__init__.py +1 -0
  541. cvm_caspar-1.0.0/tests/docker_fixtures/Dockerfile.vulnerable +4 -0
  542. cvm_caspar-1.0.0/tests/docker_fixtures/httpd-vulnerable.conf +63 -0
  543. cvm_caspar-1.0.0/tests/test_aggregation.py +247 -0
  544. cvm_caspar-1.0.0/tests/test_apache.py +557 -0
  545. cvm_caspar-1.0.0/tests/test_api.py +583 -0
  546. cvm_caspar-1.0.0/tests/test_api_chains.py +226 -0
  547. cvm_caspar-1.0.0/tests/test_api_findings.py +565 -0
  548. cvm_caspar-1.0.0/tests/test_api_jobs.py +284 -0
  549. cvm_caspar-1.0.0/tests/test_api_manage.py +326 -0
  550. cvm_caspar-1.0.0/tests/test_api_posture.py +379 -0
  551. cvm_caspar-1.0.0/tests/test_api_watch.py +462 -0
  552. cvm_caspar-1.0.0/tests/test_azure_iac_parsers.py +155 -0
  553. cvm_caspar-1.0.0/tests/test_azure_iac_plugin.py +264 -0
  554. cvm_caspar-1.0.0/tests/test_benchmark_extractor.py +269 -0
  555. cvm_caspar-1.0.0/tests/test_ccss.py +214 -0
  556. cvm_caspar-1.0.0/tests/test_chain_authoring.py +355 -0
  557. cvm_caspar-1.0.0/tests/test_chain_determinism.py +94 -0
  558. cvm_caspar-1.0.0/tests/test_chain_pipeline.py +445 -0
  559. cvm_caspar-1.0.0/tests/test_collectors.py +385 -0
  560. cvm_caspar-1.0.0/tests/test_cve_enricher.py +637 -0
  561. cvm_caspar-1.0.0/tests/test_dashboard_exploits.py +167 -0
  562. cvm_caspar-1.0.0/tests/test_dimensions.py +315 -0
  563. cvm_caspar-1.0.0/tests/test_docker_config_paths.py +46 -0
  564. cvm_caspar-1.0.0/tests/test_doctor.py +120 -0
  565. cvm_caspar-1.0.0/tests/test_exploit_enricher.py +128 -0
  566. cvm_caspar-1.0.0/tests/test_external_plugins.py +86 -0
  567. cvm_caspar-1.0.0/tests/test_fetch.py +285 -0
  568. cvm_caspar-1.0.0/tests/test_full_coverage.py +333 -0
  569. cvm_caspar-1.0.0/tests/test_iac_parsers.py +130 -0
  570. cvm_caspar-1.0.0/tests/test_iac_plugins.py +117 -0
  571. cvm_caspar-1.0.0/tests/test_init_cmds.py +145 -0
  572. cvm_caspar-1.0.0/tests/test_inventory.py +240 -0
  573. cvm_caspar-1.0.0/tests/test_key_value_parser.py +93 -0
  574. cvm_caspar-1.0.0/tests/test_knowledge_base.py +243 -0
  575. cvm_caspar-1.0.0/tests/test_live_service.py +148 -0
  576. cvm_caspar-1.0.0/tests/test_llm_pipeline.py +619 -0
  577. cvm_caspar-1.0.0/tests/test_llm_providers.py +293 -0
  578. cvm_caspar-1.0.0/tests/test_manifest.py +264 -0
  579. cvm_caspar-1.0.0/tests/test_min_python_syntax.py +94 -0
  580. cvm_caspar-1.0.0/tests/test_nistir7502_examples.py +134 -0
  581. cvm_caspar-1.0.0/tests/test_output_not_assessed.py +161 -0
  582. cvm_caspar-1.0.0/tests/test_packaging.py +200 -0
  583. cvm_caspar-1.0.0/tests/test_plugin_add_cli.py +104 -0
  584. cvm_caspar-1.0.0/tests/test_plugin_detector.py +68 -0
  585. cvm_caspar-1.0.0/tests/test_plugin_scaffolder.py +130 -0
  586. cvm_caspar-1.0.0/tests/test_promote_stats.py +69 -0
  587. cvm_caspar-1.0.0/tests/test_rag_document.py +81 -0
  588. cvm_caspar-1.0.0/tests/test_remediation.py +122 -0
  589. cvm_caspar-1.0.0/tests/test_reseed.py +230 -0
  590. cvm_caspar-1.0.0/tests/test_runtime.py +702 -0
  591. cvm_caspar-1.0.0/tests/test_scan_cmds.py +259 -0
  592. cvm_caspar-1.0.0/tests/test_scan_features.py +257 -0
  593. cvm_caspar-1.0.0/tests/test_serve_cmds.py +169 -0
  594. cvm_caspar-1.0.0/tests/test_ssg_source.py +422 -0
  595. cvm_caspar-1.0.0/tests/test_ssh.py +251 -0
  596. cvm_caspar-1.0.0/tests/test_trend.py +64 -0
  597. cvm_caspar-1.0.0/tests/test_ubuntu2204_plugin.py +217 -0
  598. cvm_caspar-1.0.0/tests/test_ubuntu_plugin.py +110 -0
  599. cvm_caspar-1.0.0/tests/test_unknown_directives.py +237 -0
  600. cvm_caspar-1.0.0/tests/test_version_detection.py +202 -0
  601. cvm_caspar-1.0.0/tests/test_version_prefetch.py +106 -0
  602. cvm_caspar-1.0.0/tests/test_watch.py +565 -0
  603. cvm_caspar-1.0.0/tests/test_xccdf_extractor.py +107 -0
@@ -0,0 +1,105 @@
1
+ # Ambiente virtual
2
+ .venv/
3
+ venv/
4
+ env/
5
+
6
+ # Credenciais — NUNCA commitar
7
+ .env
8
+ *.env
9
+ .env.local
10
+ .env.*.local
11
+ # Credenciais de publicação. Um token do PyPI dá a quem o tiver o direito de
12
+ # publicar sob este nome — e a versão publicada é o que os utilizadores
13
+ # instalam. Um ficheiro destes já apareceu na árvore de trabalho por hábito
14
+ # (`testpyapi`), a um `git add -A` de um repositório público.
15
+ .pypirc
16
+ *.pypirc
17
+ testpyapi
18
+ pypirc*
19
+
20
+ # Base de dados (gerada em runtime)
21
+ *.db
22
+ *.db-shm
23
+ *.db-wal
24
+
25
+ # Cache de exploitabilidade por versão (F1, online-first)
26
+ .ccss_cache/
27
+ # config de trabalho do scripts/watch_demo.py
28
+ .watch_demo/
29
+
30
+ # Relatórios gerados pelo scan (output, não versionar)
31
+ reports/*
32
+ !reports/.gitkeep
33
+
34
+ # Configurações de exemplo escritas por `caspar demo` (output, não versionar)
35
+ caspar-demo/
36
+
37
+ # Python
38
+ __pycache__/
39
+ *.pyc
40
+ *.pyo
41
+ *.pyd
42
+ .Python
43
+
44
+ # Build (Python packaging artifacts — anchored to repo root so they do NOT
45
+ # match the config_assessment/build/ source package).
46
+ /dist/
47
+ /build/
48
+ *.egg-info/
49
+ *.egg
50
+
51
+ # Pytest
52
+ .pytest_cache/
53
+ .coverage
54
+ htmlcov/
55
+
56
+ # IDEs
57
+ .vscode/
58
+ .idea/
59
+ *.swp
60
+ *.swo
61
+
62
+ # Relatórios gerados
63
+ ccss-report-*.json
64
+ ccss-report-*.sarif
65
+ ccss_*.json
66
+ ccss_*.sarif
67
+
68
+ # Logs
69
+ *.log
70
+ narratives_reference.txt
71
+ # PDFs ficam fora do repo (benchmarks CIS chegam aos 78MB)…
72
+ *.pdf
73
+ # …excepto a especificação CCSS: é a base de conhecimento partilhada de TODOS
74
+ # os targets (Camada 3/RAG) e tem de viajar com o clone e com a imagem Docker.
75
+ !nistir7502.pdf
76
+
77
+ # Generated documents
78
+ *.docx
79
+
80
+ # CASPAR user state
81
+ .caspar-suppress.json
82
+
83
+ # Material da dissertação (não pertence ao repo do código)
84
+ *.zip
85
+ FCUP_thesis_layout/
86
+ caspar_inforum2026/
87
+ documentosccss/
88
+ dissertacao/
89
+ tese/
90
+ tese-pt/
91
+
92
+ # WSL: Windows "downloaded from the internet" metadata streams
93
+ *:Zone.Identifier
94
+
95
+ # Cache do Vite se algum comando npm/npx correr fora de frontend/
96
+ node_modules/
97
+
98
+ # Imagens e estado da VM de validação. Os scripts de vm/ são versionados;
99
+ # tudo o que eles geram não é — a imagem tem GB e reconstrói-se do zero
100
+ # com vm/provision.sh (ver vm/README.md).
101
+ vm/images/
102
+ vm/run/
103
+ *.qcow2
104
+ *.img
105
+ *.iso
@@ -0,0 +1,383 @@
1
+ # INSTALL — do clone ao primeiro scan
2
+
3
+ Este documento leva uma máquina Linux acabada de instalar até um scan CVM
4
+ reproduzível. É o percurso mínimo: **clone → instalar → semear → scan**.
5
+
6
+ Todos os comandos abaixo foram executados exactamente como estão escritos. Onde
7
+ há um resultado esperado, ele está transcrito da execução real, não parafraseado.
8
+
9
+ > **Nomenclatura.** CVM (*Configuration Vulnerability Meter*) é a metodologia;
10
+ > CASPAR é a implementação de referência. Por isso o comando chama-se `caspar` e
11
+ > a base de dados `ccss.db` — os nomes do programa não mudam, mesmo quando a
12
+ > documentação fala de CVM.
13
+
14
+ **Ambientes validados:** Ubuntu 22.04 LTS, Ubuntu 24.04 LTS, Debian 12.
15
+ Ver [docs/06_VALIDACAO.md](docs/06_VALIDACAO.md) para a matriz de resultados.
16
+
17
+ ---
18
+
19
+ ## 0. Pré-requisitos
20
+
21
+ ```bash
22
+ sudo apt-get update
23
+ sudo apt-get install -y python3 python3-venv python3-pip git sqlite3
24
+ ```
25
+
26
+ | Pacote | Porquê | Obrigatório |
27
+ |---|---|---|
28
+ | `python3` ≥ 3.10 | O `pyproject.toml` exige `>=3.10`. Ubuntu 22.04 traz 3.10, Ubuntu 24.04 traz 3.12 — ambos servem. | sim |
29
+ | `python3-venv` | Instalação isolada, sem tocar no Python do sistema. | sim |
30
+ | `git` | Clonar o repositório. | sim |
31
+ | `sqlite3` | Aplicar a base de conhecimento canónica (passo 3). | sim |
32
+ | `poppler-utils` | Só para `caspar build --benchmark <pdf>` (extrair texto de PDFs). Não é preciso para fazer scans. | não |
33
+ | Docker | Só para `caspar scan docker://...`. Ver [secção 6](#6-caminho-alternativo-docker). | não |
34
+
35
+ Confirmar a versão do Python:
36
+
37
+ ```bash
38
+ python3 --version # tem de ser 3.10 ou superior
39
+ ```
40
+
41
+ ---
42
+
43
+ ## 1. Clonar o repositório
44
+
45
+ ```bash
46
+ git clone https://github.com/AFilipe-IT/CASPAR.git caspar
47
+ cd caspar
48
+ ```
49
+
50
+ ---
51
+
52
+ ## 2. Instalar
53
+
54
+ ```bash
55
+ python3 -m venv .venv
56
+ source .venv/bin/activate
57
+ pip install --upgrade pip
58
+ pip install -e .
59
+ ```
60
+
61
+ **Esperado:** termina em poucos segundos com `Successfully installed ... caspar-0.1.0 ...`.
62
+ As dependências base são apenas três (`pydantic`, `click`, `pyyaml`), por isso a
63
+ instalação é rápida.
64
+
65
+ Confirmar:
66
+
67
+ ```bash
68
+ caspar --help
69
+ ```
70
+
71
+ **Esperado:** o texto de ajuda. Após a linha `Usage:`, a descrição é
72
+ `CASPAR — Configuration Vulnerability Meter (CVM) reference implementation.`,
73
+ seguida da lista de comandos (`scan`, `build`, `plugin`, `watch`, …).
74
+
75
+ > Se em vez disso aparecer `CASPAR — Configuration Analysis, Security Posture
76
+ > Assessment and Reporting`, o clone é anterior à uniformização de nomenclatura
77
+ > para CVM (anterior a `66f1159`). Confirma com `git log --oneline -1`: uma
78
+ > versão antiga não tem a correcção de determinismo e pode falhar a verificação
79
+ > da secção 4.
80
+
81
+ > ⚠️ **O `pip install --upgrade pip` acima não é decorativo.** Com o pip que
82
+ > vem de origem no Ubuntu 22.04, `pip install -e ".[dev]"` falha com
83
+ > `ResolutionTooDeep`. Com o pip actualizado resolve em segundos. Se
84
+ > encontrares esse erro, actualiza o pip antes de tentar outra coisa.
85
+
86
+ ---
87
+
88
+ ## 3. Semear a base de conhecimento
89
+
90
+ **Este passo é obrigatório.** Sem ele, qualquer scan falha com:
91
+
92
+ ```
93
+ DB 'ccss.db' not found.
94
+ Run: caspar build --benchmark <pdf>
95
+ ```
96
+
97
+ Essa mensagem aponta para `caspar build`, que reconstrói a base de conhecimento
98
+ com um LLM local e demora cerca de **1h46min** (medido). Não é preciso: o
99
+ repositório já inclui a base de conhecimento canónica, e aplicá-la demora
100
+ menos de um segundo.
101
+
102
+ ```bash
103
+ sqlite3 ccss.db < data/ccss_canonical.sql
104
+ ```
105
+
106
+ Confirmar:
107
+
108
+ ```bash
109
+ caspar doctor # integridade da base de dados
110
+ caspar targets # tecnologias suportadas
111
+ ```
112
+
113
+ **Esperado:** `doctor` termina com `✓ Database is healthy — no issues found.` e
114
+ `targets` lista 13 plugins:
115
+
116
+ ```
117
+ apache-httpd azure-iac docker dockerfile dummy kubernetes mysql
118
+ nginx postgresql redis ssh tomcat ubuntu
119
+ ```
120
+
121
+ > A base de conhecimento fica em `ccss.db` **na pasta onde correres o comando**.
122
+ > Para a usar a partir de qualquer sítio, define `export CASPAR_DB=$PWD/ccss.db`
123
+ > ou passa `--db /caminho/para/ccss.db` (nota: as opções globais vêm *antes* do
124
+ > subcomando — `caspar --db X scan f.conf`, nunca `caspar scan f.conf --db X`).
125
+
126
+ ---
127
+
128
+ ## 4. Primeiro scan
129
+
130
+ Criar uma configuração Apache deliberadamente vulnerável:
131
+
132
+ ```bash
133
+ cat > apache.conf <<'EOF'
134
+ ServerTokens Full
135
+ ServerSignature On
136
+ TraceEnable On
137
+ EOF
138
+
139
+ caspar scan apache.conf
140
+ ```
141
+
142
+ > **Para um teste mais realista**, `caspar demo` escreve quatro configurações
143
+ > de exemplo — Apache e NGINX, cada uma em versão vulnerável e endurecida — sem
144
+ > precisares de clonar nada:
145
+ >
146
+ > ```bash
147
+ > caspar demo
148
+ > caspar scan caspar-demo/apache-vulnerable.conf # 8.7 HIGH, 4 cadeias
149
+ > caspar scan caspar-demo/apache-hardened.conf # 4.7 MEDIUM, 0 cadeias
150
+ > ```
151
+ >
152
+ > O par vulnerável/endurecido mostra o score a mover-se por uma razão
153
+ > conhecida, que é mais informativo do que um número isolado. As três linhas
154
+ > acima servem para o percurso mínimo; o `demo` serve para perceber o que a
155
+ > ferramenta faz.
156
+
157
+ **Esperado** — a identidade CASPAR, o painel de score, e depois:
158
+
159
+ ```
160
+ Highest finding 6.0 Highest chain 6.1 Chains triggered 1 → score from findings; chains not scored
161
+
162
+ TOP FINDINGS
163
+
164
+ # Severity Directive Score CCSS Vector File / Location
165
+ ──────────────────────────────────────────────────────────────────────────────────
166
+ 1 MEDIUM Header 6.0 AV:N AC:L Au:N C:P I:P A:N -
167
+ 2 MEDIUM ServerTokens 4.7 AV:N AC:L Au:N C:P I:N A:N apache.conf:1
168
+ 3 MEDIUM ServerSign... 4.7 AV:N AC:L Au:N C:P I:N A:N apache.conf:2
169
+ 4 MEDIUM TraceEnable 4.0 AV:N AC:M Au:N C:P I:N A:N apache.conf:3
170
+
171
+ ATTACK CHAINS TRIGGERED
172
+
173
+ [MEDIUM] info-disclosure-chain: ServerTokens -> ServerSignature Score: 6.1
174
+
175
+ RECOMMENDATION
176
+
177
+ ! This configuration scores 6.0 — MEDIUM overall vulnerability.
178
+ Highest-value fix: Header (6.0)
179
+ → Add 'Header always append Content-Security-Policy …'
180
+
181
+ Note: these findings compose into info-disclosure-chain, rated 6.1 —
182
+ higher than any single finding.
183
+ Chain: ServerTokens + ServerSignature
184
+
185
+ COVERAGE
186
+
187
+ 3 of 3 directives read from the configuration were matched against the
188
+ knowledge base
189
+
190
+ reproducible: caspar 0.1.0 · kb sha256:37087229989b · 35 rules (apache-httpd)
191
+ ```
192
+
193
+ > Os números exactos dependem dos factores temporais na tua base de
194
+ > conhecimento; o `kb sha256:` no rodapé identifica-a. A saída acima é o resumo
195
+ > operacional — `--verbose` mostra cada finding em detalhe, `--show-chains` a
196
+ > análise completa das cadeias.
197
+
198
+ **O código de saída é 0.** Por omissão `caspar scan` não falha por encontrar
199
+ problemas — para o usar como gate de CI, passa `--exit-code` (devolve 2 num
200
+ achado Critical) ou `--threshold N` (devolve 1 acima de N).
201
+
202
+ Repara no resultado central da metodologia. O score global (6.0) vem do **pior
203
+ finding individual**, e continua a ser sempre atribuível a uma directiva
204
+ concreta que podes corrigir. Mas a cadeia `info-disclosure-chain` está cotada a
205
+ **6.1** — acima de qualquer finding que a compõe (4.7 + 4.7). `ServerTokens` e
206
+ `ServerSignature` isoladamente são divulgação de informação; combinadas dão ao
207
+ atacante versão exacta *e* confirmação do software.
208
+
209
+ Essa composição é o que um scanner de conformidade pass/fail não captura, e é a
210
+ contribuição central do CVM. As cadeias são **reportadas mas não somadas ao
211
+ score**: um número que não se consegue rastrear até uma directiva corrigível é
212
+ um número sobre o qual não se consegue agir. A cadeia aparece como aviso
213
+ explícito na recomendação, precisamente para que quem corrige apenas a primeira
214
+ linha da tabela saiba que fica com o problema maior por resolver.
215
+
216
+ > **Os scores dependem dos factores temporais** (`GEL`/`GRL`, visíveis com
217
+ > `--verbose`). Logo após o seed reflectem a base canónica; `caspar refresh`
218
+ > (NVD + CISA KEV) e `caspar fetch-exploits` incorporam dados de exploração
219
+ > pública e fazem os mesmos findings subir. **Não corras esses comandos se
220
+ > quiseres comparar com o output acima**: precisam de rede e mudam os valores.
221
+ > O percurso base é deliberadamente offline e determinístico.
222
+
223
+ ### Verificar a reprodutibilidade
224
+
225
+ O mesmo input tem de dar exactamente o mesmo output. Para o confirmar:
226
+
227
+ ```bash
228
+ for i in 1 2 3 4 5; do
229
+ caspar scan apache.conf --report -f json -o out$i >/dev/null 2>&1
230
+ done
231
+
232
+ python3 - <<'EOF'
233
+ import json, hashlib, glob
234
+ VOLATILE = {"scan_date", "timestamp", "target_path", "scan_id",
235
+ "duration_seconds", "file_path", "date", "generated_at", "path"}
236
+ def clean(o):
237
+ if isinstance(o, dict):
238
+ return {k: clean(v) for k, v in o.items() if k not in VOLATILE}
239
+ if isinstance(o, list):
240
+ return [clean(x) for x in o]
241
+ return o
242
+ for i in range(1, 6):
243
+ d = json.load(open(glob.glob(f"out{i}/*.json")[0]))
244
+ h = hashlib.sha256(json.dumps(clean(d), sort_keys=True, default=str).encode())
245
+ print(f'run {i}: score={d["global_temporal_score"]} sha={h.hexdigest()[:16]}')
246
+ EOF
247
+ ```
248
+
249
+ **Esperado:** as cinco linhas com o mesmo score e o **mesmo hash**. Os campos
250
+ voláteis (data, caminho, id) são excluídos do hash por variarem por construção;
251
+ tudo o resto — scores, findings, cadeias, justificações — tem de ser idêntico.
252
+
253
+ ```
254
+ run 1: score=6.1 sha=c6ec56b851fc812d
255
+ run 2: score=6.1 sha=c6ec56b851fc812d
256
+ run 3: score=6.1 sha=c6ec56b851fc812d
257
+ run 4: score=6.1 sha=c6ec56b851fc812d
258
+ run 5: score=6.1 sha=c6ec56b851fc812d
259
+ ```
260
+
261
+ Se os hashes divergirem, **não continues** — é um problema de reprodutibilidade
262
+ e deve ser registado, não contornado.
263
+
264
+ > O hash acima corresponde à base canónica acabada de semear
265
+ > (`kb sha256:37087229989b`), sem enriquecimento por rede. Se tiveres corrido
266
+ > `refresh` ou `fetch-exploits`, os scores sobem e o hash muda — é esperado. O
267
+ > critério que tem sempre de se verificar é que as cinco linhas sejam **iguais
268
+ > entre si**; o valor absoluto só é comparável entre bases idênticas, e a linha
269
+ > `reproducible:` de cada scan identifica qual foi usada. Este teste não
270
+ > é decorativo: foi ele que expôs uma fonte real de não-determinismo (a ordem
271
+ > das directivas numa cadeia de ataque variava com o `PYTHONHASHSEED` do
272
+ > processo), corrigida em `config_assessment/core/engines/attack_chain.py` e
273
+ > agora coberta por `tests/test_chain_determinism.py`.
274
+
275
+ ---
276
+
277
+ ## 5. (Opcional) Correr a suite de testes
278
+
279
+ ```bash
280
+ pip install -e ".[dev]"
281
+ python3 -m pytest tests/ -q
282
+ ```
283
+
284
+ **Esperado:** `755 passed, 22 skipped`, sem falhas nem erros de colecção.
285
+
286
+ Os skips são esperados e não indicam problema. A suite adapta-se ao que o
287
+ ambiente tem:
288
+
289
+ | Cenário | Resultado | Porquê |
290
+ |---|---|---|
291
+ | Clone limpo + `[dev]` | `755 passed, 22 skipped` | os skips dependem de ficheiros-fonte que o repositório não redistribui (PDFs dos CIS Benchmarks em `sources/benchmarks/`) |
292
+ | Só `pytest`, sem `[dev]` | `692 passed, 4 skipped` | os 4 módulos da API REST precisam do FastAPI |
293
+ | Com todos os ficheiros-fonte presentes | `777 passed` | nada por exercitar |
294
+
295
+ Para ver o motivo de cada skip no teu ambiente:
296
+
297
+ ```bash
298
+ python3 -m pytest tests/ -q -rs 2>&1 | grep SKIPPED | sort | uniq -c
299
+ ```
300
+
301
+ O critério de aceitação é **zero falhas e zero erros**, não um número exacto
302
+ de testes. Um `passed` acompanhado de `skipped` é um resultado válido; um
303
+ `failed` ou `error` não é.
304
+
305
+ Se isto falhar com `ResolutionTooDeep`, o pip está desactualizado — corre
306
+ `pip install --upgrade pip` e repete (ver secção 2).
307
+
308
+ ---
309
+
310
+ ## 6. Caminho alternativo: Docker
311
+
312
+ Não precisa de Python, nem de clonar o repositório, nem do passo do seed — a
313
+ imagem já traz a base de conhecimento e semeia-a na primeira utilização.
314
+
315
+ **Antes de começar**, confirma que o teu utilizador consegue falar com o Docker:
316
+
317
+ ```bash
318
+ docker info >/dev/null 2>&1 && echo "OK" || echo "sem acesso ao Docker"
319
+ ```
320
+
321
+ Se não tiveres acesso, acrescenta-te ao grupo `docker` — instalar o Docker não
322
+ o faz automaticamente:
323
+
324
+ ```bash
325
+ sudo usermod -aG docker $USER
326
+ getent group docker # confirma que o teu utilizador aparece na lista
327
+ sudo reboot
328
+ ```
329
+
330
+ Depois de reiniciar, confirma:
331
+
332
+ ```bash
333
+ id -nG # 'docker' tem de aparecer
334
+ docker ps # tem de correr sem erro de permissões
335
+ ```
336
+
337
+ > **Porque reiniciar e não apenas voltar a entrar.** Os grupos são fixados no
338
+ > arranque da sessão. Num ambiente gráfico, um terminal novo herda os grupos da
339
+ > sessão X/Wayland que o lançou, que é anterior ao `usermod` — por isso pode
340
+ > continuar sem acesso mesmo depois de "abrir outro terminal". O `newgrp
341
+ > docker` dá acesso imediato, mas só ao sub-shell que abre, e não sobrevive a
342
+ > essa sessão. Reiniciar é o único caminho que se aplica a tudo de uma vez.
343
+
344
+ > `sudo curl … | sh` **não** resolve este problema: o `sudo` aplica-se ao
345
+ > `curl`, não ao shell que executa o script, por isso a instalação continua a
346
+ > correr sem privilégios.
347
+
348
+ ```bash
349
+ curl -fsSL https://raw.githubusercontent.com/AFilipe-IT/CASPAR/master/install.sh | sh
350
+ export PATH="$HOME/.local/bin:$PATH"
351
+
352
+ caspar targets
353
+ caspar scan apache.conf
354
+ ```
355
+
356
+ O percurso completo em Docker, incluindo a instalação do Docker Engine e a
357
+ comparação contra Trivy e OpenSCAP, está em
358
+ [docs/03_GUIA_VM_UBUNTU22.md](docs/03_GUIA_VM_UBUNTU22.md).
359
+
360
+ ---
361
+
362
+ ## 7. A seguir
363
+
364
+ | Quero… | Ver |
365
+ |---|---|
366
+ | Perceber o que os scores significam | [docs/02_GUIA_CASPAR.md](docs/02_GUIA_CASPAR.md) |
367
+ | Reproduzir os resultados da dissertação | [docs/04_AVALIACAO_FUNCIONAL.md](docs/04_AVALIACAO_FUNCIONAL.md) |
368
+ | Protocolo de medições e validação | [docs/06_VALIDACAO.md](docs/06_VALIDACAO.md) |
369
+ | Arquitectura interna | [docs/05_GUIA_TECNICO.md](docs/05_GUIA_TECNICO.md) |
370
+ | Consola web (React) | `caspar serve`, depois `http://127.0.0.1:2027/app` |
371
+
372
+ ---
373
+
374
+ ## Resolução de problemas
375
+
376
+ | Sintoma | Causa | Solução |
377
+ |---|---|---|
378
+ | `DB 'ccss.db' not found` | O seed (passo 3) não foi aplicado, ou estás noutra pasta. | `sqlite3 ccss.db < data/ccss_canonical.sql`, ou define `CASPAR_DB` com o caminho absoluto. |
379
+ | `ResolutionTooDeep` no `pip install` | O pip de origem do Ubuntu 22.04 é demasiado antigo para resolver o extra `[dev]`. | `pip install --upgrade pip` e repete. |
380
+ | `caspar: command not found` | A venv não está activa. | `source .venv/bin/activate` |
381
+ | O scan devolve 1 | Comportamento normal — encontrou problemas. | Nada a fazer; usa `--threshold` para definir o teu próprio gate. |
382
+ | `--db` parece ignorado | As opções globais vêm antes do subcomando. | `caspar --db X scan f.conf` |
383
+ | `caspar build` demora horas | É esperado — reconstrói a base com um LLM local. | Usa o seed (passo 3) em vez de `build`. |
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.