raxe 0.4.6__py3-none-any.whl
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.
- raxe/__init__.py +101 -0
- raxe/application/__init__.py +48 -0
- raxe/application/ab_testing.py +170 -0
- raxe/application/analytics/__init__.py +30 -0
- raxe/application/analytics/achievement_service.py +444 -0
- raxe/application/analytics/repositories.py +172 -0
- raxe/application/analytics/retention_service.py +267 -0
- raxe/application/analytics/statistics_service.py +419 -0
- raxe/application/analytics/streak_service.py +283 -0
- raxe/application/apply_policy.py +291 -0
- raxe/application/eager_l2.py +503 -0
- raxe/application/preloader.py +353 -0
- raxe/application/scan_merger.py +321 -0
- raxe/application/scan_pipeline.py +1059 -0
- raxe/application/scan_pipeline_async.py +403 -0
- raxe/application/session_tracker.py +458 -0
- raxe/application/telemetry_manager.py +357 -0
- raxe/application/telemetry_orchestrator.py +1210 -0
- raxe/async_sdk/__init__.py +34 -0
- raxe/async_sdk/cache.py +286 -0
- raxe/async_sdk/client.py +556 -0
- raxe/async_sdk/wrappers/__init__.py +23 -0
- raxe/async_sdk/wrappers/openai.py +238 -0
- raxe/cli/__init__.py +21 -0
- raxe/cli/auth.py +1047 -0
- raxe/cli/branding.py +235 -0
- raxe/cli/config.py +334 -0
- raxe/cli/custom_rules.py +458 -0
- raxe/cli/doctor.py +686 -0
- raxe/cli/error_handler.py +665 -0
- raxe/cli/event.py +648 -0
- raxe/cli/exit_codes.py +57 -0
- raxe/cli/expiry_warning.py +302 -0
- raxe/cli/export.py +183 -0
- raxe/cli/history.py +247 -0
- raxe/cli/l2_formatter.py +872 -0
- raxe/cli/main.py +1137 -0
- raxe/cli/models.py +590 -0
- raxe/cli/output.py +403 -0
- raxe/cli/privacy.py +84 -0
- raxe/cli/profiler.py +262 -0
- raxe/cli/progress.py +379 -0
- raxe/cli/progress_context.py +101 -0
- raxe/cli/repl.py +394 -0
- raxe/cli/rules.py +542 -0
- raxe/cli/setup_wizard.py +721 -0
- raxe/cli/stats.py +292 -0
- raxe/cli/suppress.py +501 -0
- raxe/cli/telemetry.py +1384 -0
- raxe/cli/test.py +130 -0
- raxe/cli/tune.py +315 -0
- raxe/cli/validate.py +218 -0
- raxe/domain/__init__.py +30 -0
- raxe/domain/analytics/__init__.py +97 -0
- raxe/domain/analytics/achievements.py +306 -0
- raxe/domain/analytics/models.py +120 -0
- raxe/domain/analytics/retention.py +168 -0
- raxe/domain/analytics/statistics.py +207 -0
- raxe/domain/analytics/streaks.py +173 -0
- raxe/domain/engine/__init__.py +15 -0
- raxe/domain/engine/executor.py +396 -0
- raxe/domain/engine/matcher.py +212 -0
- raxe/domain/inline_suppression.py +176 -0
- raxe/domain/ml/__init__.py +133 -0
- raxe/domain/ml/embedding_cache.py +309 -0
- raxe/domain/ml/gemma_detector.py +921 -0
- raxe/domain/ml/gemma_models.py +346 -0
- raxe/domain/ml/l2_config.py +428 -0
- raxe/domain/ml/l2_output_schema.py +443 -0
- raxe/domain/ml/manifest_loader.py +309 -0
- raxe/domain/ml/manifest_schema.py +345 -0
- raxe/domain/ml/model_metadata.py +263 -0
- raxe/domain/ml/model_registry.py +786 -0
- raxe/domain/ml/protocol.py +282 -0
- raxe/domain/ml/scoring_models.py +419 -0
- raxe/domain/ml/stub_detector.py +397 -0
- raxe/domain/ml/threat_scorer.py +757 -0
- raxe/domain/ml/tokenizer_registry.py +372 -0
- raxe/domain/ml/voting/__init__.py +89 -0
- raxe/domain/ml/voting/config.py +595 -0
- raxe/domain/ml/voting/engine.py +465 -0
- raxe/domain/ml/voting/head_voters.py +378 -0
- raxe/domain/ml/voting/models.py +222 -0
- raxe/domain/models.py +82 -0
- raxe/domain/packs/__init__.py +17 -0
- raxe/domain/packs/models.py +304 -0
- raxe/domain/policies/__init__.py +20 -0
- raxe/domain/policies/evaluator.py +212 -0
- raxe/domain/policies/models.py +223 -0
- raxe/domain/rules/__init__.py +32 -0
- raxe/domain/rules/custom.py +286 -0
- raxe/domain/rules/models.py +273 -0
- raxe/domain/rules/schema.py +166 -0
- raxe/domain/rules/validator.py +556 -0
- raxe/domain/suppression.py +801 -0
- raxe/domain/suppression_factory.py +174 -0
- raxe/domain/telemetry/__init__.py +116 -0
- raxe/domain/telemetry/backpressure.py +424 -0
- raxe/domain/telemetry/event_creator.py +362 -0
- raxe/domain/telemetry/events.py +1282 -0
- raxe/domain/telemetry/priority.py +263 -0
- raxe/domain/telemetry/scan_telemetry_builder.py +670 -0
- raxe/infrastructure/__init__.py +25 -0
- raxe/infrastructure/analytics/__init__.py +18 -0
- raxe/infrastructure/analytics/aggregator.py +484 -0
- raxe/infrastructure/analytics/aggregator_optimized.py +184 -0
- raxe/infrastructure/analytics/engine.py +748 -0
- raxe/infrastructure/analytics/repository.py +409 -0
- raxe/infrastructure/analytics/streaks.py +467 -0
- raxe/infrastructure/analytics/views.py +178 -0
- raxe/infrastructure/cloud/__init__.py +9 -0
- raxe/infrastructure/config/__init__.py +56 -0
- raxe/infrastructure/config/endpoints.py +641 -0
- raxe/infrastructure/config/scan_config.py +352 -0
- raxe/infrastructure/config/yaml_config.py +459 -0
- raxe/infrastructure/database/__init__.py +10 -0
- raxe/infrastructure/database/connection.py +200 -0
- raxe/infrastructure/database/models.py +325 -0
- raxe/infrastructure/database/scan_history.py +764 -0
- raxe/infrastructure/ml/__init__.py +0 -0
- raxe/infrastructure/ml/download_progress.py +438 -0
- raxe/infrastructure/ml/model_downloader.py +457 -0
- raxe/infrastructure/models/__init__.py +16 -0
- raxe/infrastructure/models/discovery.py +461 -0
- raxe/infrastructure/packs/__init__.py +13 -0
- raxe/infrastructure/packs/loader.py +407 -0
- raxe/infrastructure/packs/registry.py +381 -0
- raxe/infrastructure/policies/__init__.py +16 -0
- raxe/infrastructure/policies/api_client.py +256 -0
- raxe/infrastructure/policies/validator.py +227 -0
- raxe/infrastructure/policies/yaml_loader.py +250 -0
- raxe/infrastructure/rules/__init__.py +18 -0
- raxe/infrastructure/rules/custom_loader.py +224 -0
- raxe/infrastructure/rules/versioning.py +222 -0
- raxe/infrastructure/rules/yaml_loader.py +286 -0
- raxe/infrastructure/security/__init__.py +31 -0
- raxe/infrastructure/security/auth.py +145 -0
- raxe/infrastructure/security/policy_validator.py +124 -0
- raxe/infrastructure/security/signatures.py +171 -0
- raxe/infrastructure/suppression/__init__.py +36 -0
- raxe/infrastructure/suppression/composite_repository.py +154 -0
- raxe/infrastructure/suppression/sqlite_repository.py +231 -0
- raxe/infrastructure/suppression/yaml_composite_repository.py +156 -0
- raxe/infrastructure/suppression/yaml_repository.py +510 -0
- raxe/infrastructure/telemetry/__init__.py +79 -0
- raxe/infrastructure/telemetry/acquisition.py +179 -0
- raxe/infrastructure/telemetry/config.py +254 -0
- raxe/infrastructure/telemetry/credential_store.py +947 -0
- raxe/infrastructure/telemetry/dual_queue.py +1123 -0
- raxe/infrastructure/telemetry/flush_helper.py +343 -0
- raxe/infrastructure/telemetry/flush_scheduler.py +776 -0
- raxe/infrastructure/telemetry/health_client.py +394 -0
- raxe/infrastructure/telemetry/hook.py +347 -0
- raxe/infrastructure/telemetry/queue.py +520 -0
- raxe/infrastructure/telemetry/sender.py +476 -0
- raxe/infrastructure/tracking/__init__.py +13 -0
- raxe/infrastructure/tracking/usage.py +389 -0
- raxe/integrations/__init__.py +55 -0
- raxe/integrations/availability.py +143 -0
- raxe/integrations/registry.py +122 -0
- raxe/integrations/utils.py +135 -0
- raxe/mcp/__init__.py +62 -0
- raxe/mcp/cli.py +97 -0
- raxe/mcp/server.py +409 -0
- raxe/monitoring/__init__.py +51 -0
- raxe/monitoring/metrics.py +372 -0
- raxe/monitoring/profiler.py +388 -0
- raxe/monitoring/server.py +136 -0
- raxe/packs/core/v1.0.0/pack.yaml +1394 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-001@1.0.0.yaml +49 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-006@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-014@1.0.0.yaml +54 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-017@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-022@1.0.0.yaml +67 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-023@1.0.0.yaml +91 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-024@1.0.0.yaml +80 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-025@1.0.0.yaml +81 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-026@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-027@1.0.0.yaml +77 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-028@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-029@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-030@1.0.0.yaml +55 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-033@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-034@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-035@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-046@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-047@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-048@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-049@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-050@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-068@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-078@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-2001@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-2004@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-201@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-202@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-203@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3007@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3016@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3026@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3027@1.0.0.yaml +64 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3028@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3029@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3030@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3031@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3032@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3033@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3034@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-79@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-80@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-81@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-82@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-83@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-84@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-85@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-86@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-87@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-88@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-89@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-90@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-91@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-92@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-93@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-94@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-95@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-96@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-97@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-98@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-001@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-007@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-015@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-016@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-017@1.0.0.yaml +57 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-021@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-022@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-023@1.0.0.yaml +78 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-024@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-025@1.0.0.yaml +93 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-026@1.0.0.yaml +81 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-027@1.0.0.yaml +82 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-028@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-033@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-036@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-037@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-052@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-054@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-056@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-065@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-075@1.0.0.yaml +45 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-079@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1080@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1090@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1104@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1105@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1112@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-201@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-202@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-203@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-204@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-205@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-206@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-207@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-208@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-209@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-210@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-211@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-212@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-213@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-214@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-215@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-216@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-217@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-218@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-219@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-220@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-221@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-222@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-223@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-224@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-225@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-226@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-227@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-228@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-229@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-230@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-231@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-232@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-233@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-234@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-235@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-236@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-237@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-238@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-001@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-013@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-019@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-020@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-024@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-029@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-038@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-044@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-067@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-069@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-100@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-101@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-102@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-103@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-104@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-105@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-106@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-107@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-108@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-109@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-110@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-111@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-112@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-113@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-114@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-115@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-116@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-117@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-118@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-119@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-120@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-201@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-202@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-203@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-3004@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-3006@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-3011@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-5016@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-6001@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-6002@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-70@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-71@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-72@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-73@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-74@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-75@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-76@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-77@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-78@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-79@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-80@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-81@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-82@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-83@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-84@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-85@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-86@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-87@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-88@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-89@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-90@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-91@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-92@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-93@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-94@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-95@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-96@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-97@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-98@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-99@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-001@1.0.0.yaml +73 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-002@1.0.0.yaml +71 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-003@1.0.0.yaml +65 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-004@1.0.0.yaml +73 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-101@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-102@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-103@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-104@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-105@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-106@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-107@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-108@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-109@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-110@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-111@1.0.0.yaml +49 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-112@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-113@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-114@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-115@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-116@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-117@1.0.0.yaml +54 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-118@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-119@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-120@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-121@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-122@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-123@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-124@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-125@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-126@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-127@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-128@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-129@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-130@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-131@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-132@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-133@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-134@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-135@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-136@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-137@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-138@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-139@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-140@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-141@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-142@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-143@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-144@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-145@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-146@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-147@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-148@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-149@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-150@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-151@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-152@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-153@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-154@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-155@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-156@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-157@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-158@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-159@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-160@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-161@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-001@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-009@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-020@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-021@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-022@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-028@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-033@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-034@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-036@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-039@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-056@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-066@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-076@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-098@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-103@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-104@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-105@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-110@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-111@1.0.0.yaml +57 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-112@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-113@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-114@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-115@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-116@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-117@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-118@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-119@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-120@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-121@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-122@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-123@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-124@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-125@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-126@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-127@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-128@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-129@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-130@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-131@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-132@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-133@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-134@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-135@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-136@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-137@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-138@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-139@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-140@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-141@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-142@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-143@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-144@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-145@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-146@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-147@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-148@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-149@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-150@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-151@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-152@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-153@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-154@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-155@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-156@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-157@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-158@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-159@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-160@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-161@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-162@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-201@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-202@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-203@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-204@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-205@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-206@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-207@1.0.0.yaml +49 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-001@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-009@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-012@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-017@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-022@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-025@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-027@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-028@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-034@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-037@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-040@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-041@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-044@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-050@1.0.0.yaml +57 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-051@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-052@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-053@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-054@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-055@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-056@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-058@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2015@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2025@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2026@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2035@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2037@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2042@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3001@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3002@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3003@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3004@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3005@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3006@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3007@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3008@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3009@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3010@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3011@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3012@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3013@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3014@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3015@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3016@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3017@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3018@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3019@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3020@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3021@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3022@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3023@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3024@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3025@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3026@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3027@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3028@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3029@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3030@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3031@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3032@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3033@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3034@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3035@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3036@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3037@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3038@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3039@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3040@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3041@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3042@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3043@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3044@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3045@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3046@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3047@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3048@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3049@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3050@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3051@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3052@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3053@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3054@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3055@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3056@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3057@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3058@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3059@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3060@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3061@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3062@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3063@1.0.0.yaml +54 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3064@1.0.0.yaml +78 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3065@1.0.0.yaml +84 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3066@1.0.0.yaml +84 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3067@1.0.0.yaml +88 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3068@1.0.0.yaml +94 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3069@1.0.0.yaml +90 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3070@1.0.0.yaml +99 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3071@1.0.0.yaml +91 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3072@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3073@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3074@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3075@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3076@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3077@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3078@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3079@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3080@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3081@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3082@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3083@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3084@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3085@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-016@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-028@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-042@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-044@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-045@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-050@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-201@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-202@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-3001@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-3006@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-3009@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-3012@1.0.0.yaml +41 -0
- raxe/plugins/__init__.py +98 -0
- raxe/plugins/custom_rules.py +380 -0
- raxe/plugins/loader.py +389 -0
- raxe/plugins/manager.py +538 -0
- raxe/plugins/protocol.py +428 -0
- raxe/py.typed +0 -0
- raxe/sdk/__init__.py +77 -0
- raxe/sdk/agent_scanner.py +1918 -0
- raxe/sdk/client.py +1603 -0
- raxe/sdk/decorator.py +175 -0
- raxe/sdk/exceptions.py +859 -0
- raxe/sdk/integrations/__init__.py +277 -0
- raxe/sdk/integrations/agent_scanner.py +71 -0
- raxe/sdk/integrations/autogen.py +872 -0
- raxe/sdk/integrations/crewai.py +1368 -0
- raxe/sdk/integrations/dspy.py +845 -0
- raxe/sdk/integrations/extractors.py +363 -0
- raxe/sdk/integrations/huggingface.py +395 -0
- raxe/sdk/integrations/langchain.py +948 -0
- raxe/sdk/integrations/litellm.py +484 -0
- raxe/sdk/integrations/llamaindex.py +1049 -0
- raxe/sdk/integrations/portkey.py +831 -0
- raxe/sdk/suppression_context.py +215 -0
- raxe/sdk/wrappers/__init__.py +163 -0
- raxe/sdk/wrappers/anthropic.py +310 -0
- raxe/sdk/wrappers/openai.py +221 -0
- raxe/sdk/wrappers/vertexai.py +484 -0
- raxe/utils/__init__.py +12 -0
- raxe/utils/error_sanitizer.py +135 -0
- raxe/utils/logging.py +241 -0
- raxe/utils/performance.py +414 -0
- raxe/utils/profiler.py +339 -0
- raxe/utils/validators.py +170 -0
- raxe-0.4.6.dist-info/METADATA +471 -0
- raxe-0.4.6.dist-info/RECORD +668 -0
- raxe-0.4.6.dist-info/WHEEL +5 -0
- raxe-0.4.6.dist-info/entry_points.txt +2 -0
- raxe-0.4.6.dist-info/licenses/LICENSE +56 -0
- raxe-0.4.6.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,670 @@
|
|
|
1
|
+
"""Scan Telemetry Builder - Canonical implementation for schema v2.1.
|
|
2
|
+
|
|
3
|
+
This builder creates telemetry payloads that comply with SCAN_TELEMETRY_SCHEMA.md.
|
|
4
|
+
All fields are dynamically calculated from L1/L2 results - NO hardcoded values.
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
builder = ScanTelemetryBuilder()
|
|
8
|
+
telemetry = builder.build(
|
|
9
|
+
prompt=prompt,
|
|
10
|
+
l1_result=l1_result,
|
|
11
|
+
l2_result=l2_result,
|
|
12
|
+
scan_duration_ms=duration_ms,
|
|
13
|
+
entry_point="sdk",
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
See: docs/SCAN_TELEMETRY_SCHEMA.md for field definitions.
|
|
17
|
+
|
|
18
|
+
NEW in v2.1: Voting engine telemetry support
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
import hashlib
|
|
24
|
+
import math
|
|
25
|
+
from dataclasses import dataclass, field
|
|
26
|
+
from typing import TYPE_CHECKING, Any, Literal
|
|
27
|
+
|
|
28
|
+
if TYPE_CHECKING:
|
|
29
|
+
from raxe.domain.detections import L1Result
|
|
30
|
+
from raxe.domain.ml.protocol import L2Result
|
|
31
|
+
|
|
32
|
+
# Schema version - bump when schema changes
|
|
33
|
+
SCHEMA_VERSION = "2.1.0"
|
|
34
|
+
|
|
35
|
+
# Enum labels for probability distributions
|
|
36
|
+
FAMILY_LABELS = [
|
|
37
|
+
"benign",
|
|
38
|
+
"data_exfiltration",
|
|
39
|
+
"encoding_or_obfuscation_attack",
|
|
40
|
+
"jailbreak",
|
|
41
|
+
"other_security",
|
|
42
|
+
"prompt_injection",
|
|
43
|
+
"rag_or_context_attack",
|
|
44
|
+
"tool_or_command_abuse",
|
|
45
|
+
"toxic_or_policy_violating_content",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
SEVERITY_LABELS = ["none", "low", "medium", "high", "critical"]
|
|
49
|
+
|
|
50
|
+
TECHNIQUE_LABELS = [
|
|
51
|
+
"chain_of_thought_or_internal_state_leak",
|
|
52
|
+
"context_or_delimiter_injection",
|
|
53
|
+
"data_exfil_system_prompt_or_config",
|
|
54
|
+
"data_exfil_user_content",
|
|
55
|
+
"encoding_or_obfuscation",
|
|
56
|
+
"eval_or_guardrail_evasion",
|
|
57
|
+
"hidden_or_steganographic_prompt",
|
|
58
|
+
"indirect_injection_via_content",
|
|
59
|
+
"instruction_override",
|
|
60
|
+
"mode_switch_or_privilege_escalation",
|
|
61
|
+
"multi_turn_or_crescendo",
|
|
62
|
+
"none",
|
|
63
|
+
"other_attack_technique",
|
|
64
|
+
"payload_splitting_or_staging",
|
|
65
|
+
"policy_override_or_rewriting",
|
|
66
|
+
"rag_poisoning_or_context_bias",
|
|
67
|
+
"role_or_persona_manipulation",
|
|
68
|
+
"safety_bypass_harmful_output",
|
|
69
|
+
"social_engineering_content",
|
|
70
|
+
"system_prompt_or_config_extraction",
|
|
71
|
+
"tool_abuse_or_unintended_action",
|
|
72
|
+
"tool_or_command_injection",
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
HARM_TYPE_LABELS = [
|
|
76
|
+
"cbrn_or_weapons",
|
|
77
|
+
"crime_or_fraud",
|
|
78
|
+
"cybersecurity_or_malware",
|
|
79
|
+
"hate_or_harassment",
|
|
80
|
+
"misinformation_or_disinfo",
|
|
81
|
+
"other_harm",
|
|
82
|
+
"privacy_or_pii",
|
|
83
|
+
"self_harm_or_suicide",
|
|
84
|
+
"sexual_content",
|
|
85
|
+
"violence_or_physical_harm",
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
# Severity ordering for comparison
|
|
89
|
+
SEVERITY_ORDER = {"none": 0, "low": 1, "medium": 2, "high": 3, "critical": 4}
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
@dataclass
|
|
93
|
+
class ScanTelemetryBuilder:
|
|
94
|
+
"""Builder for scan telemetry payloads following schema v2.0.
|
|
95
|
+
|
|
96
|
+
All fields are dynamically calculated from input data.
|
|
97
|
+
NO hardcoded values - everything derived from actual scan results.
|
|
98
|
+
"""
|
|
99
|
+
|
|
100
|
+
max_l1_detections: int = 10 # Limit per-rule details
|
|
101
|
+
|
|
102
|
+
def build(
|
|
103
|
+
self,
|
|
104
|
+
l1_result: L1Result | None,
|
|
105
|
+
l2_result: L2Result | None,
|
|
106
|
+
scan_duration_ms: float,
|
|
107
|
+
entry_point: Literal["cli", "sdk", "wrapper", "integration"] = "sdk",
|
|
108
|
+
*,
|
|
109
|
+
prompt: str | None = None,
|
|
110
|
+
prompt_hash: str | None = None,
|
|
111
|
+
prompt_length: int | None = None,
|
|
112
|
+
wrapper_type: Literal["openai", "anthropic", "langchain", "none"] | None = None,
|
|
113
|
+
action_taken: Literal["allow", "block", "warn", "redact"] = "allow",
|
|
114
|
+
l2_enabled: bool = True,
|
|
115
|
+
integration_type: str | None = None,
|
|
116
|
+
) -> dict[str, Any]:
|
|
117
|
+
"""Build complete scan telemetry payload.
|
|
118
|
+
|
|
119
|
+
Provide either `prompt` OR both `prompt_hash` and `prompt_length`.
|
|
120
|
+
|
|
121
|
+
Args:
|
|
122
|
+
l1_result: L1 rule-based detection result
|
|
123
|
+
l2_result: L2 ML detection result
|
|
124
|
+
scan_duration_ms: Total scan duration in milliseconds
|
|
125
|
+
entry_point: How scan was triggered
|
|
126
|
+
prompt: Original prompt text (preferred - calculates hash and length)
|
|
127
|
+
prompt_hash: Pre-computed SHA-256 hash (if prompt not available)
|
|
128
|
+
prompt_length: Pre-computed prompt length (if prompt not available)
|
|
129
|
+
wrapper_type: SDK wrapper type if applicable
|
|
130
|
+
action_taken: Policy action taken
|
|
131
|
+
l2_enabled: Whether L2 was enabled for this scan
|
|
132
|
+
integration_type: Agentic framework if applicable (langchain, crewai, etc.)
|
|
133
|
+
|
|
134
|
+
Returns:
|
|
135
|
+
Complete telemetry payload dict matching schema v2.0
|
|
136
|
+
"""
|
|
137
|
+
# Calculate prompt_hash and prompt_length
|
|
138
|
+
if prompt is not None:
|
|
139
|
+
computed_hash = self._compute_prompt_hash(prompt)
|
|
140
|
+
computed_length = len(prompt)
|
|
141
|
+
elif prompt_hash is not None and prompt_length is not None:
|
|
142
|
+
# Use pre-computed values - ensure hash has prefix
|
|
143
|
+
if not prompt_hash.startswith("sha256:"):
|
|
144
|
+
computed_hash = f"sha256:{prompt_hash}"
|
|
145
|
+
else:
|
|
146
|
+
computed_hash = prompt_hash
|
|
147
|
+
computed_length = prompt_length
|
|
148
|
+
else:
|
|
149
|
+
raise ValueError(
|
|
150
|
+
"Must provide either 'prompt' or both 'prompt_hash' and 'prompt_length'"
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
# Build L1 block
|
|
154
|
+
l1_block = self._build_l1_block(l1_result)
|
|
155
|
+
|
|
156
|
+
# Build L2 block
|
|
157
|
+
l2_block = self._build_l2_block(l2_result, l2_enabled)
|
|
158
|
+
|
|
159
|
+
# Determine overall threat detection
|
|
160
|
+
l1_hit = l1_block.get("hit", False) if l1_block else False
|
|
161
|
+
l2_hit = l2_block.get("hit", False) if l2_block else False
|
|
162
|
+
threat_detected = l1_hit or l2_hit
|
|
163
|
+
|
|
164
|
+
# Build payload
|
|
165
|
+
payload: dict[str, Any] = {
|
|
166
|
+
# Core fields - all dynamically calculated
|
|
167
|
+
"prompt_hash": computed_hash,
|
|
168
|
+
"prompt_length": computed_length,
|
|
169
|
+
"threat_detected": threat_detected,
|
|
170
|
+
"scan_duration_ms": scan_duration_ms,
|
|
171
|
+
"action_taken": action_taken,
|
|
172
|
+
"entry_point": entry_point,
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
# Optional wrapper type
|
|
176
|
+
if wrapper_type:
|
|
177
|
+
payload["wrapper_type"] = wrapper_type
|
|
178
|
+
|
|
179
|
+
# Optional integration type (langchain, crewai, llamaindex, autogen, mcp)
|
|
180
|
+
if integration_type:
|
|
181
|
+
payload["integration_type"] = integration_type
|
|
182
|
+
|
|
183
|
+
# Add L1 block if available
|
|
184
|
+
if l1_block:
|
|
185
|
+
payload["l1"] = l1_block
|
|
186
|
+
|
|
187
|
+
# Add L2 block if available
|
|
188
|
+
if l2_block:
|
|
189
|
+
payload["l2"] = l2_block
|
|
190
|
+
|
|
191
|
+
return payload
|
|
192
|
+
|
|
193
|
+
def _compute_prompt_hash(self, prompt: str) -> str:
|
|
194
|
+
"""Compute SHA-256 hash of prompt with prefix.
|
|
195
|
+
|
|
196
|
+
Args:
|
|
197
|
+
prompt: Text to hash
|
|
198
|
+
|
|
199
|
+
Returns:
|
|
200
|
+
Hash string with sha256: prefix
|
|
201
|
+
"""
|
|
202
|
+
hash_bytes = hashlib.sha256(prompt.encode("utf-8")).hexdigest()
|
|
203
|
+
return f"sha256:{hash_bytes}"
|
|
204
|
+
|
|
205
|
+
def _build_l1_block(self, l1_result: L1Result | None) -> dict[str, Any] | None:
|
|
206
|
+
"""Build L1 telemetry block from L1Result.
|
|
207
|
+
|
|
208
|
+
Args:
|
|
209
|
+
l1_result: L1 detection result
|
|
210
|
+
|
|
211
|
+
Returns:
|
|
212
|
+
L1 block dict or None if no L1 result
|
|
213
|
+
"""
|
|
214
|
+
if l1_result is None:
|
|
215
|
+
return None
|
|
216
|
+
|
|
217
|
+
# Get detections list
|
|
218
|
+
detections = getattr(l1_result, "detections", []) or []
|
|
219
|
+
detection_count = len(detections)
|
|
220
|
+
|
|
221
|
+
# Calculate hit status
|
|
222
|
+
hit = detection_count > 0
|
|
223
|
+
|
|
224
|
+
# Get duration
|
|
225
|
+
duration_ms = getattr(l1_result, "scan_duration_ms", 0.0) or 0.0
|
|
226
|
+
|
|
227
|
+
# Extract unique families
|
|
228
|
+
families: list[str] = []
|
|
229
|
+
for detection in detections:
|
|
230
|
+
family = getattr(detection, "family", None)
|
|
231
|
+
if family and family not in families:
|
|
232
|
+
families.append(family)
|
|
233
|
+
|
|
234
|
+
# Calculate highest severity
|
|
235
|
+
highest_severity = "none"
|
|
236
|
+
highest_order = 0
|
|
237
|
+
for detection in detections:
|
|
238
|
+
severity = getattr(detection, "severity", "none")
|
|
239
|
+
if isinstance(severity, str):
|
|
240
|
+
severity_str = severity.lower()
|
|
241
|
+
else:
|
|
242
|
+
severity_str = str(severity.value).lower() if hasattr(severity, "value") else "none"
|
|
243
|
+
order = SEVERITY_ORDER.get(severity_str, 0)
|
|
244
|
+
if order > highest_order:
|
|
245
|
+
highest_order = order
|
|
246
|
+
highest_severity = severity_str
|
|
247
|
+
|
|
248
|
+
# Build per-detection details (limited)
|
|
249
|
+
detection_details: list[dict[str, Any]] = []
|
|
250
|
+
for detection in detections[: self.max_l1_detections]:
|
|
251
|
+
rule_id = getattr(detection, "rule_id", "unknown")
|
|
252
|
+
family = getattr(detection, "family", "unknown")
|
|
253
|
+
severity = getattr(detection, "severity", "none")
|
|
254
|
+
confidence = getattr(detection, "confidence", 1.0)
|
|
255
|
+
|
|
256
|
+
# Handle severity enum
|
|
257
|
+
if hasattr(severity, "value"):
|
|
258
|
+
severity = severity.value
|
|
259
|
+
severity_str = str(severity).lower()
|
|
260
|
+
|
|
261
|
+
detection_details.append({
|
|
262
|
+
"rule_id": rule_id,
|
|
263
|
+
"family": family,
|
|
264
|
+
"severity": severity_str,
|
|
265
|
+
"confidence": float(confidence) if confidence is not None else 1.0,
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
return {
|
|
269
|
+
"hit": hit,
|
|
270
|
+
"duration_ms": duration_ms,
|
|
271
|
+
"detection_count": detection_count,
|
|
272
|
+
"highest_severity": highest_severity,
|
|
273
|
+
"families": families,
|
|
274
|
+
"detections": detection_details,
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
def _build_l2_block(
|
|
278
|
+
self, l2_result: L2Result | None, l2_enabled: bool
|
|
279
|
+
) -> dict[str, Any] | None:
|
|
280
|
+
"""Build L2 telemetry block from L2Result.
|
|
281
|
+
|
|
282
|
+
Args:
|
|
283
|
+
l2_result: L2 ML detection result
|
|
284
|
+
l2_enabled: Whether L2 was enabled
|
|
285
|
+
|
|
286
|
+
Returns:
|
|
287
|
+
L2 block dict or None if L2 disabled
|
|
288
|
+
"""
|
|
289
|
+
if not l2_enabled:
|
|
290
|
+
return {"enabled": False, "hit": False}
|
|
291
|
+
|
|
292
|
+
if l2_result is None:
|
|
293
|
+
return {"enabled": True, "hit": False}
|
|
294
|
+
|
|
295
|
+
# Check if L2 has predictions
|
|
296
|
+
predictions = getattr(l2_result, "predictions", []) or []
|
|
297
|
+
if not predictions:
|
|
298
|
+
# Even without predictions, include voting data if available
|
|
299
|
+
base_result: dict[str, Any] = {
|
|
300
|
+
"enabled": True,
|
|
301
|
+
"hit": False,
|
|
302
|
+
"duration_ms": getattr(l2_result, "processing_time_ms", 0.0) or 0.0,
|
|
303
|
+
"model_version": getattr(l2_result, "model_version", "unknown"),
|
|
304
|
+
}
|
|
305
|
+
# Include voting block for transparency on SAFE decisions
|
|
306
|
+
voting_block = self._build_voting_block(l2_result)
|
|
307
|
+
if voting_block:
|
|
308
|
+
base_result["voting"] = voting_block
|
|
309
|
+
return base_result
|
|
310
|
+
|
|
311
|
+
# Get first prediction's metadata (contains all 5-head data)
|
|
312
|
+
pred = predictions[0]
|
|
313
|
+
metadata = getattr(pred, "metadata", {}) or {}
|
|
314
|
+
|
|
315
|
+
# Extract values from metadata with safe fallbacks
|
|
316
|
+
is_attack = metadata.get("is_attack", False)
|
|
317
|
+
scores = metadata.get("scores", {}) or {}
|
|
318
|
+
|
|
319
|
+
# Build binary head block
|
|
320
|
+
threat_prob = scores.get("attack_probability", 0.0)
|
|
321
|
+
binary_block = {
|
|
322
|
+
"is_threat": bool(is_attack),
|
|
323
|
+
"threat_probability": float(threat_prob),
|
|
324
|
+
"safe_probability": 1.0 - float(threat_prob),
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
# Build family head block
|
|
328
|
+
family_prediction = metadata.get("family", "benign")
|
|
329
|
+
family_confidence = scores.get("family_confidence", 0.0)
|
|
330
|
+
family_top3 = self._extract_top3_from_metadata(metadata, "family")
|
|
331
|
+
family_block = {
|
|
332
|
+
"prediction": family_prediction,
|
|
333
|
+
"confidence": float(family_confidence),
|
|
334
|
+
"top3": family_top3,
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
# Build severity head block
|
|
338
|
+
severity_prediction = metadata.get("severity", "none")
|
|
339
|
+
severity_confidence = scores.get("severity_confidence", 0.0)
|
|
340
|
+
severity_dist = self._extract_severity_distribution(metadata)
|
|
341
|
+
severity_block = {
|
|
342
|
+
"prediction": severity_prediction,
|
|
343
|
+
"confidence": float(severity_confidence),
|
|
344
|
+
"distribution": severity_dist,
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
# Build technique head block
|
|
348
|
+
technique_prediction = metadata.get("primary_technique") or metadata.get("sub_family")
|
|
349
|
+
technique_confidence = scores.get("subfamily_confidence", 0.0) or metadata.get(
|
|
350
|
+
"technique_confidence", 0.0
|
|
351
|
+
)
|
|
352
|
+
technique_top3 = self._extract_top3_from_metadata(metadata, "technique")
|
|
353
|
+
technique_block = {
|
|
354
|
+
"prediction": technique_prediction,
|
|
355
|
+
"confidence": float(technique_confidence),
|
|
356
|
+
"top3": technique_top3,
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
# Build harm types head block
|
|
360
|
+
harm_types_data = metadata.get("harm_types", {}) or {}
|
|
361
|
+
harm_types_block = self._build_harm_types_block(harm_types_data)
|
|
362
|
+
|
|
363
|
+
# Extract derived/ensemble values
|
|
364
|
+
classification = metadata.get("classification", "SAFE")
|
|
365
|
+
recommended_action = metadata.get("action", "ALLOW")
|
|
366
|
+
risk_score = metadata.get("risk_score", threat_prob * 100)
|
|
367
|
+
hierarchical_score = metadata.get("hierarchical_score", threat_prob)
|
|
368
|
+
|
|
369
|
+
# Build quality signals for drift detection
|
|
370
|
+
quality_block = self._build_quality_block(
|
|
371
|
+
threat_prob=threat_prob,
|
|
372
|
+
family_confidence=family_confidence,
|
|
373
|
+
is_attack=is_attack,
|
|
374
|
+
family_prediction=family_prediction,
|
|
375
|
+
metadata=metadata,
|
|
376
|
+
)
|
|
377
|
+
|
|
378
|
+
# Get L2 hit status from is_threat property
|
|
379
|
+
l2_hit = getattr(l2_result, "is_threat", False)
|
|
380
|
+
|
|
381
|
+
# Build voting block if available (NEW in v2.1)
|
|
382
|
+
voting_block = self._build_voting_block(l2_result)
|
|
383
|
+
|
|
384
|
+
result = {
|
|
385
|
+
"enabled": True,
|
|
386
|
+
"hit": l2_hit,
|
|
387
|
+
"duration_ms": getattr(l2_result, "processing_time_ms", 0.0) or 0.0,
|
|
388
|
+
"model_version": getattr(l2_result, "model_version", "unknown"),
|
|
389
|
+
"binary": binary_block,
|
|
390
|
+
"family": family_block,
|
|
391
|
+
"severity": severity_block,
|
|
392
|
+
"technique": technique_block,
|
|
393
|
+
"harm_types": harm_types_block,
|
|
394
|
+
"classification": classification,
|
|
395
|
+
"recommended_action": recommended_action,
|
|
396
|
+
"risk_score": float(risk_score),
|
|
397
|
+
"hierarchical_score": float(hierarchical_score),
|
|
398
|
+
"quality": quality_block,
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
# Add voting block if available
|
|
402
|
+
if voting_block:
|
|
403
|
+
result["voting"] = voting_block
|
|
404
|
+
|
|
405
|
+
return result
|
|
406
|
+
|
|
407
|
+
def _build_voting_block(
|
|
408
|
+
self, l2_result: L2Result | None
|
|
409
|
+
) -> dict[str, Any] | None:
|
|
410
|
+
"""Build voting block from L2Result voting field.
|
|
411
|
+
|
|
412
|
+
Args:
|
|
413
|
+
l2_result: L2 ML detection result
|
|
414
|
+
|
|
415
|
+
Returns:
|
|
416
|
+
Voting telemetry block or None if voting not available
|
|
417
|
+
"""
|
|
418
|
+
if l2_result is None:
|
|
419
|
+
return None
|
|
420
|
+
|
|
421
|
+
# Get voting data from L2Result
|
|
422
|
+
voting_data = getattr(l2_result, "voting", None)
|
|
423
|
+
if not voting_data:
|
|
424
|
+
return None
|
|
425
|
+
|
|
426
|
+
# Return voting data as-is (already in dict format from VotingResult.to_dict())
|
|
427
|
+
# The voting data includes: decision, confidence, preset_used, per_head_votes,
|
|
428
|
+
# aggregated_scores, decision_rule_triggered, threat/safe/abstain counts, etc.
|
|
429
|
+
return voting_data
|
|
430
|
+
|
|
431
|
+
def _extract_top3_from_metadata(
|
|
432
|
+
self, metadata: dict[str, Any], head_type: str
|
|
433
|
+
) -> list[dict[str, Any]]:
|
|
434
|
+
"""Extract top-3 predictions for a head from metadata.
|
|
435
|
+
|
|
436
|
+
Args:
|
|
437
|
+
metadata: Prediction metadata dict
|
|
438
|
+
head_type: "family" or "technique"
|
|
439
|
+
|
|
440
|
+
Returns:
|
|
441
|
+
List of top-3 {label, probability} dicts
|
|
442
|
+
"""
|
|
443
|
+
# Try to get probabilities from metadata
|
|
444
|
+
if head_type == "family":
|
|
445
|
+
probs_key = "family_probabilities"
|
|
446
|
+
labels = FAMILY_LABELS
|
|
447
|
+
prediction = metadata.get("family", "benign")
|
|
448
|
+
confidence = (metadata.get("scores", {}) or {}).get("family_confidence", 0.0)
|
|
449
|
+
else: # technique
|
|
450
|
+
probs_key = "technique_probabilities"
|
|
451
|
+
labels = TECHNIQUE_LABELS
|
|
452
|
+
prediction = metadata.get("primary_technique") or metadata.get("sub_family", "none")
|
|
453
|
+
confidence = (metadata.get("scores", {}) or {}).get("subfamily_confidence", 0.0)
|
|
454
|
+
|
|
455
|
+
# If full probabilities available, use them
|
|
456
|
+
probs = metadata.get(probs_key)
|
|
457
|
+
if probs and isinstance(probs, (list, tuple)) and len(probs) == len(labels):
|
|
458
|
+
# Sort by probability descending
|
|
459
|
+
sorted_items = sorted(
|
|
460
|
+
zip(labels, probs), key=lambda x: -x[1]
|
|
461
|
+
)[:3]
|
|
462
|
+
return [{"label": label, "probability": float(prob)} for label, prob in sorted_items]
|
|
463
|
+
|
|
464
|
+
# Fallback: construct from prediction and confidence
|
|
465
|
+
if prediction and confidence:
|
|
466
|
+
return [{"label": prediction, "probability": float(confidence)}]
|
|
467
|
+
|
|
468
|
+
return []
|
|
469
|
+
|
|
470
|
+
def _extract_severity_distribution(
|
|
471
|
+
self, metadata: dict[str, Any]
|
|
472
|
+
) -> dict[str, float]:
|
|
473
|
+
"""Extract severity distribution from metadata.
|
|
474
|
+
|
|
475
|
+
Args:
|
|
476
|
+
metadata: Prediction metadata dict
|
|
477
|
+
|
|
478
|
+
Returns:
|
|
479
|
+
Dict mapping severity levels to probabilities
|
|
480
|
+
"""
|
|
481
|
+
# Try to get full distribution
|
|
482
|
+
probs = metadata.get("severity_probabilities")
|
|
483
|
+
if probs and isinstance(probs, (list, tuple)) and len(probs) == 5:
|
|
484
|
+
return dict(zip(SEVERITY_LABELS, [float(p) for p in probs]))
|
|
485
|
+
|
|
486
|
+
# Fallback: construct from prediction and confidence
|
|
487
|
+
prediction = metadata.get("severity", "none")
|
|
488
|
+
confidence = (metadata.get("scores", {}) or {}).get("severity_confidence", 0.0)
|
|
489
|
+
|
|
490
|
+
# Initialize with small values
|
|
491
|
+
dist = {label: 0.01 for label in SEVERITY_LABELS}
|
|
492
|
+
if prediction in dist:
|
|
493
|
+
dist[prediction] = float(confidence)
|
|
494
|
+
# Normalize
|
|
495
|
+
total = sum(dist.values())
|
|
496
|
+
if total > 0:
|
|
497
|
+
dist = {k: v / total for k, v in dist.items()}
|
|
498
|
+
|
|
499
|
+
return dist
|
|
500
|
+
|
|
501
|
+
def _build_harm_types_block(
|
|
502
|
+
self, harm_types_data: dict[str, Any]
|
|
503
|
+
) -> dict[str, Any]:
|
|
504
|
+
"""Build harm types block from harm types result.
|
|
505
|
+
|
|
506
|
+
Args:
|
|
507
|
+
harm_types_data: Harm types dict from metadata
|
|
508
|
+
|
|
509
|
+
Returns:
|
|
510
|
+
Harm types telemetry block
|
|
511
|
+
"""
|
|
512
|
+
if not harm_types_data:
|
|
513
|
+
return {
|
|
514
|
+
"active_labels": [],
|
|
515
|
+
"active_count": 0,
|
|
516
|
+
"max_probability": 0.0,
|
|
517
|
+
"probabilities": {label: 0.0 for label in HARM_TYPE_LABELS},
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
# Extract active labels
|
|
521
|
+
active_labels = harm_types_data.get("active_labels", [])
|
|
522
|
+
if active_labels and hasattr(active_labels[0], "value"):
|
|
523
|
+
active_labels = [h.value for h in active_labels]
|
|
524
|
+
|
|
525
|
+
# Extract probabilities
|
|
526
|
+
probs_data = harm_types_data.get("probabilities", {})
|
|
527
|
+
if isinstance(probs_data, dict):
|
|
528
|
+
probabilities = {label: float(probs_data.get(label, 0.0)) for label in HARM_TYPE_LABELS}
|
|
529
|
+
else:
|
|
530
|
+
probabilities = {label: 0.0 for label in HARM_TYPE_LABELS}
|
|
531
|
+
|
|
532
|
+
# Calculate max probability
|
|
533
|
+
max_prob = harm_types_data.get("max_probability", 0.0)
|
|
534
|
+
if not max_prob and probabilities:
|
|
535
|
+
max_prob = max(probabilities.values()) if probabilities else 0.0
|
|
536
|
+
|
|
537
|
+
return {
|
|
538
|
+
"active_labels": list(active_labels) if active_labels else [],
|
|
539
|
+
"active_count": len(active_labels) if active_labels else 0,
|
|
540
|
+
"max_probability": float(max_prob),
|
|
541
|
+
"probabilities": probabilities,
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
def _build_quality_block(
|
|
545
|
+
self,
|
|
546
|
+
threat_prob: float,
|
|
547
|
+
family_confidence: float,
|
|
548
|
+
is_attack: bool,
|
|
549
|
+
family_prediction: str,
|
|
550
|
+
metadata: dict[str, Any],
|
|
551
|
+
) -> dict[str, Any]:
|
|
552
|
+
"""Build quality signals block for drift detection.
|
|
553
|
+
|
|
554
|
+
Args:
|
|
555
|
+
threat_prob: Binary head threat probability
|
|
556
|
+
family_confidence: Family head confidence
|
|
557
|
+
is_attack: Binary classification result
|
|
558
|
+
family_prediction: Family head prediction
|
|
559
|
+
metadata: Full prediction metadata
|
|
560
|
+
|
|
561
|
+
Returns:
|
|
562
|
+
Quality signals block
|
|
563
|
+
"""
|
|
564
|
+
# Calculate uncertain flag
|
|
565
|
+
uncertain = family_confidence < 0.5 or (0.35 <= threat_prob < 0.6)
|
|
566
|
+
|
|
567
|
+
# Calculate head agreement (binary agrees with family)
|
|
568
|
+
family_is_benign = family_prediction == "benign"
|
|
569
|
+
binary_is_benign = not is_attack
|
|
570
|
+
head_agreement = family_is_benign == binary_is_benign
|
|
571
|
+
|
|
572
|
+
# Calculate binary margin (distance from decision boundary)
|
|
573
|
+
binary_margin = abs(threat_prob - 0.5)
|
|
574
|
+
|
|
575
|
+
# Calculate family entropy if probabilities available
|
|
576
|
+
family_probs = metadata.get("family_probabilities")
|
|
577
|
+
if family_probs and isinstance(family_probs, (list, tuple)):
|
|
578
|
+
family_entropy = self._calculate_entropy(list(family_probs))
|
|
579
|
+
else:
|
|
580
|
+
# Estimate entropy from confidence
|
|
581
|
+
family_entropy = -math.log(max(family_confidence, 0.01)) if family_confidence > 0 else 0.0
|
|
582
|
+
|
|
583
|
+
# Calculate consistency score (multi-head agreement metric)
|
|
584
|
+
# Higher score = heads agree, lower = confusion
|
|
585
|
+
consistency_signals = [
|
|
586
|
+
1.0 if head_agreement else 0.0,
|
|
587
|
+
min(1.0, binary_margin * 2), # Scaled margin
|
|
588
|
+
family_confidence,
|
|
589
|
+
]
|
|
590
|
+
consistency_score = sum(consistency_signals) / len(consistency_signals)
|
|
591
|
+
|
|
592
|
+
return {
|
|
593
|
+
"uncertain": uncertain,
|
|
594
|
+
"head_agreement": head_agreement,
|
|
595
|
+
"binary_margin": round(binary_margin, 4),
|
|
596
|
+
"family_entropy": round(family_entropy, 4),
|
|
597
|
+
"consistency_score": round(consistency_score, 4),
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
def _calculate_entropy(self, probabilities: list[float]) -> float:
|
|
601
|
+
"""Calculate Shannon entropy of probability distribution.
|
|
602
|
+
|
|
603
|
+
Args:
|
|
604
|
+
probabilities: List of probabilities (should sum to ~1.0)
|
|
605
|
+
|
|
606
|
+
Returns:
|
|
607
|
+
Entropy value (higher = more uncertain)
|
|
608
|
+
"""
|
|
609
|
+
entropy = 0.0
|
|
610
|
+
for p in probabilities:
|
|
611
|
+
if p > 0:
|
|
612
|
+
entropy -= p * math.log(p)
|
|
613
|
+
return entropy
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
# Singleton instance for convenience
|
|
617
|
+
_builder: ScanTelemetryBuilder | None = None
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
def get_scan_telemetry_builder() -> ScanTelemetryBuilder:
|
|
621
|
+
"""Get singleton ScanTelemetryBuilder instance.
|
|
622
|
+
|
|
623
|
+
Returns:
|
|
624
|
+
ScanTelemetryBuilder instance
|
|
625
|
+
"""
|
|
626
|
+
global _builder
|
|
627
|
+
if _builder is None:
|
|
628
|
+
_builder = ScanTelemetryBuilder()
|
|
629
|
+
return _builder
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
def build_scan_telemetry(
|
|
633
|
+
l1_result: Any,
|
|
634
|
+
l2_result: Any,
|
|
635
|
+
scan_duration_ms: float,
|
|
636
|
+
entry_point: Literal["cli", "sdk", "wrapper", "integration"] = "sdk",
|
|
637
|
+
*,
|
|
638
|
+
prompt: str | None = None,
|
|
639
|
+
prompt_hash: str | None = None,
|
|
640
|
+
prompt_length: int | None = None,
|
|
641
|
+
**kwargs: Any,
|
|
642
|
+
) -> dict[str, Any]:
|
|
643
|
+
"""Convenience function to build scan telemetry.
|
|
644
|
+
|
|
645
|
+
Provide either `prompt` OR both `prompt_hash` and `prompt_length`.
|
|
646
|
+
|
|
647
|
+
Args:
|
|
648
|
+
l1_result: L1 detection result
|
|
649
|
+
l2_result: L2 ML detection result
|
|
650
|
+
scan_duration_ms: Total scan duration
|
|
651
|
+
entry_point: How scan was triggered
|
|
652
|
+
prompt: Original prompt text (preferred)
|
|
653
|
+
prompt_hash: Pre-computed SHA-256 hash
|
|
654
|
+
prompt_length: Pre-computed prompt length
|
|
655
|
+
**kwargs: Additional arguments passed to builder
|
|
656
|
+
|
|
657
|
+
Returns:
|
|
658
|
+
Complete telemetry payload dict
|
|
659
|
+
"""
|
|
660
|
+
builder = get_scan_telemetry_builder()
|
|
661
|
+
return builder.build(
|
|
662
|
+
l1_result=l1_result,
|
|
663
|
+
l2_result=l2_result,
|
|
664
|
+
scan_duration_ms=scan_duration_ms,
|
|
665
|
+
entry_point=entry_point,
|
|
666
|
+
prompt=prompt,
|
|
667
|
+
prompt_hash=prompt_hash,
|
|
668
|
+
prompt_length=prompt_length,
|
|
669
|
+
**kwargs,
|
|
670
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Infrastructure Layer - I/O Implementations
|
|
3
|
+
|
|
4
|
+
This layer handles ALL external I/O operations:
|
|
5
|
+
- Database access (SQLite)
|
|
6
|
+
- Network calls (Cloud API)
|
|
7
|
+
- File system operations (Config files)
|
|
8
|
+
- External services
|
|
9
|
+
|
|
10
|
+
The infrastructure layer implements interfaces defined by the domain
|
|
11
|
+
and application layers, keeping those layers pure and testable.
|
|
12
|
+
|
|
13
|
+
Subdirectories:
|
|
14
|
+
- database/: SQLite queue, migrations, models
|
|
15
|
+
- cloud/: RAXE cloud API client, telemetry sender
|
|
16
|
+
- config/: Configuration file I/O, environment variables
|
|
17
|
+
|
|
18
|
+
Key Patterns:
|
|
19
|
+
- Repository pattern for data access
|
|
20
|
+
- Adapter pattern for external services
|
|
21
|
+
- Circuit breaker for resilience
|
|
22
|
+
- Retry logic with exponential backoff
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
__all__ = []
|