regscale-cli 6.21.2.0__py3-none-any.whl → 6.28.2.1__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.
- regscale/_version.py +1 -1
- regscale/airflow/hierarchy.py +2 -2
- regscale/core/app/api.py +5 -2
- regscale/core/app/application.py +36 -6
- regscale/core/app/internal/control_editor.py +73 -21
- regscale/core/app/internal/evidence.py +727 -204
- regscale/core/app/internal/login.py +4 -2
- regscale/core/app/internal/model_editor.py +219 -64
- regscale/core/app/utils/app_utils.py +86 -12
- regscale/core/app/utils/catalog_utils/common.py +1 -1
- regscale/core/login.py +21 -4
- regscale/core/utils/async_graphql_client.py +363 -0
- regscale/core/utils/date.py +77 -1
- regscale/dev/cli.py +26 -0
- regscale/dev/code_gen.py +109 -24
- regscale/dev/version.py +72 -0
- regscale/integrations/commercial/__init__.py +30 -2
- regscale/integrations/commercial/aws/audit_manager_compliance.py +3908 -0
- regscale/integrations/commercial/aws/cli.py +3107 -54
- regscale/integrations/commercial/aws/cloudtrail_control_mappings.py +333 -0
- regscale/integrations/commercial/aws/cloudtrail_evidence.py +501 -0
- regscale/integrations/commercial/aws/cloudwatch_control_mappings.py +357 -0
- regscale/integrations/commercial/aws/cloudwatch_evidence.py +490 -0
- regscale/integrations/commercial/{amazon → aws}/common.py +71 -19
- regscale/integrations/commercial/aws/config_compliance.py +914 -0
- regscale/integrations/commercial/aws/conformance_pack_mappings.py +198 -0
- regscale/integrations/commercial/aws/control_compliance_analyzer.py +439 -0
- regscale/integrations/commercial/aws/evidence_generator.py +283 -0
- regscale/integrations/commercial/aws/guardduty_control_mappings.py +340 -0
- regscale/integrations/commercial/aws/guardduty_evidence.py +1053 -0
- regscale/integrations/commercial/aws/iam_control_mappings.py +368 -0
- regscale/integrations/commercial/aws/iam_evidence.py +574 -0
- regscale/integrations/commercial/aws/inventory/__init__.py +338 -22
- regscale/integrations/commercial/aws/inventory/base.py +107 -5
- regscale/integrations/commercial/aws/inventory/resources/analytics.py +390 -0
- regscale/integrations/commercial/aws/inventory/resources/applications.py +234 -0
- regscale/integrations/commercial/aws/inventory/resources/audit_manager.py +513 -0
- regscale/integrations/commercial/aws/inventory/resources/cloudtrail.py +315 -0
- regscale/integrations/commercial/aws/inventory/resources/cloudtrail_logs_metadata.py +476 -0
- regscale/integrations/commercial/aws/inventory/resources/cloudwatch.py +191 -0
- regscale/integrations/commercial/aws/inventory/resources/compute.py +328 -9
- regscale/integrations/commercial/aws/inventory/resources/config.py +464 -0
- regscale/integrations/commercial/aws/inventory/resources/containers.py +74 -9
- regscale/integrations/commercial/aws/inventory/resources/database.py +481 -31
- regscale/integrations/commercial/aws/inventory/resources/developer_tools.py +253 -0
- regscale/integrations/commercial/aws/inventory/resources/guardduty.py +286 -0
- regscale/integrations/commercial/aws/inventory/resources/iam.py +470 -0
- regscale/integrations/commercial/aws/inventory/resources/inspector.py +476 -0
- regscale/integrations/commercial/aws/inventory/resources/integration.py +175 -61
- regscale/integrations/commercial/aws/inventory/resources/kms.py +447 -0
- regscale/integrations/commercial/aws/inventory/resources/machine_learning.py +358 -0
- regscale/integrations/commercial/aws/inventory/resources/networking.py +390 -67
- regscale/integrations/commercial/aws/inventory/resources/s3.py +394 -0
- regscale/integrations/commercial/aws/inventory/resources/security.py +268 -72
- regscale/integrations/commercial/aws/inventory/resources/securityhub.py +473 -0
- regscale/integrations/commercial/aws/inventory/resources/storage.py +288 -29
- regscale/integrations/commercial/aws/inventory/resources/systems_manager.py +657 -0
- regscale/integrations/commercial/aws/inventory/resources/vpc.py +655 -0
- regscale/integrations/commercial/aws/kms_control_mappings.py +288 -0
- regscale/integrations/commercial/aws/kms_evidence.py +879 -0
- regscale/integrations/commercial/aws/ocsf/__init__.py +7 -0
- regscale/integrations/commercial/aws/ocsf/constants.py +115 -0
- regscale/integrations/commercial/aws/ocsf/mapper.py +435 -0
- regscale/integrations/commercial/aws/org_control_mappings.py +286 -0
- regscale/integrations/commercial/aws/org_evidence.py +666 -0
- regscale/integrations/commercial/aws/s3_control_mappings.py +356 -0
- regscale/integrations/commercial/aws/s3_evidence.py +632 -0
- regscale/integrations/commercial/aws/scanner.py +1072 -205
- regscale/integrations/commercial/aws/security_hub.py +319 -0
- regscale/integrations/commercial/aws/session_manager.py +282 -0
- regscale/integrations/commercial/aws/ssm_control_mappings.py +291 -0
- regscale/integrations/commercial/aws/ssm_evidence.py +492 -0
- regscale/integrations/commercial/jira.py +489 -153
- regscale/integrations/commercial/microsoft_defender/defender.py +326 -5
- regscale/integrations/commercial/microsoft_defender/defender_api.py +348 -14
- regscale/integrations/commercial/microsoft_defender/defender_constants.py +157 -0
- regscale/integrations/commercial/qualys/__init__.py +167 -68
- regscale/integrations/commercial/qualys/scanner.py +305 -39
- regscale/integrations/commercial/sarif/sairf_importer.py +432 -0
- regscale/integrations/commercial/sarif/sarif_converter.py +67 -0
- regscale/integrations/commercial/sicura/api.py +79 -42
- regscale/integrations/commercial/sicura/commands.py +8 -2
- regscale/integrations/commercial/sicura/scanner.py +83 -44
- regscale/integrations/commercial/stigv2/ckl_parser.py +5 -5
- regscale/integrations/commercial/synqly/assets.py +133 -16
- regscale/integrations/commercial/synqly/edr.py +2 -8
- regscale/integrations/commercial/synqly/query_builder.py +536 -0
- regscale/integrations/commercial/synqly/ticketing.py +27 -0
- regscale/integrations/commercial/synqly/vulnerabilities.py +165 -28
- regscale/integrations/commercial/tenablev2/cis_parsers.py +453 -0
- regscale/integrations/commercial/tenablev2/cis_scanner.py +447 -0
- regscale/integrations/commercial/tenablev2/commands.py +146 -5
- regscale/integrations/commercial/tenablev2/scanner.py +1 -3
- regscale/integrations/commercial/tenablev2/stig_parsers.py +113 -57
- regscale/integrations/commercial/wizv2/WizDataMixin.py +1 -1
- regscale/integrations/commercial/wizv2/click.py +191 -76
- regscale/integrations/commercial/wizv2/compliance/__init__.py +15 -0
- regscale/integrations/commercial/wizv2/{policy_compliance_helpers.py → compliance/helpers.py} +78 -60
- regscale/integrations/commercial/wizv2/compliance_report.py +1592 -0
- regscale/integrations/commercial/wizv2/core/__init__.py +133 -0
- regscale/integrations/commercial/wizv2/{async_client.py → core/client.py} +7 -3
- regscale/integrations/commercial/wizv2/{constants.py → core/constants.py} +92 -89
- regscale/integrations/commercial/wizv2/core/file_operations.py +237 -0
- regscale/integrations/commercial/wizv2/fetchers/__init__.py +11 -0
- regscale/integrations/commercial/wizv2/{data_fetcher.py → fetchers/policy_assessment.py} +66 -9
- regscale/integrations/commercial/wizv2/file_cleanup.py +104 -0
- regscale/integrations/commercial/wizv2/issue.py +776 -28
- regscale/integrations/commercial/wizv2/models/__init__.py +0 -0
- regscale/integrations/commercial/wizv2/parsers/__init__.py +34 -0
- regscale/integrations/commercial/wizv2/{parsers.py → parsers/main.py} +1 -1
- regscale/integrations/commercial/wizv2/processors/__init__.py +11 -0
- regscale/integrations/commercial/wizv2/{finding_processor.py → processors/finding.py} +1 -1
- regscale/integrations/commercial/wizv2/reports.py +243 -0
- regscale/integrations/commercial/wizv2/sbom.py +1 -1
- regscale/integrations/commercial/wizv2/scanner.py +1031 -441
- regscale/integrations/commercial/wizv2/utils/__init__.py +48 -0
- regscale/integrations/commercial/wizv2/{utils.py → utils/main.py} +116 -61
- regscale/integrations/commercial/wizv2/variables.py +89 -3
- regscale/integrations/compliance_integration.py +1036 -151
- regscale/integrations/control_matcher.py +432 -0
- regscale/integrations/due_date_handler.py +333 -0
- regscale/integrations/milestone_manager.py +291 -0
- regscale/integrations/public/__init__.py +14 -0
- regscale/integrations/public/cci_importer.py +834 -0
- regscale/integrations/public/csam/__init__.py +0 -0
- regscale/integrations/public/csam/csam.py +938 -0
- regscale/integrations/public/csam/csam_agency_defined.py +179 -0
- regscale/integrations/public/csam/csam_common.py +154 -0
- regscale/integrations/public/csam/csam_controls.py +432 -0
- regscale/integrations/public/csam/csam_poam.py +124 -0
- regscale/integrations/public/fedramp/click.py +77 -6
- regscale/integrations/public/fedramp/docx_parser.py +10 -1
- regscale/integrations/public/fedramp/fedramp_cis_crm.py +675 -289
- regscale/integrations/public/fedramp/fedramp_five.py +1 -1
- regscale/integrations/public/fedramp/poam/scanner.py +75 -7
- regscale/integrations/public/fedramp/poam_export_v5.py +888 -0
- regscale/integrations/scanner_integration.py +1961 -430
- regscale/models/integration_models/CCI_List.xml +1 -0
- regscale/models/integration_models/aqua.py +2 -2
- regscale/models/integration_models/cisa_kev_data.json +805 -11
- regscale/models/integration_models/flat_file_importer/__init__.py +5 -8
- regscale/models/integration_models/nexpose.py +36 -10
- regscale/models/integration_models/qualys.py +3 -4
- regscale/models/integration_models/synqly_models/capabilities.json +1 -1
- regscale/models/integration_models/synqly_models/connectors/vulnerabilities.py +87 -18
- regscale/models/integration_models/synqly_models/filter_parser.py +332 -0
- regscale/models/integration_models/synqly_models/ocsf_mapper.py +124 -25
- regscale/models/integration_models/synqly_models/synqly_model.py +89 -16
- regscale/models/locking.py +12 -8
- regscale/models/platform.py +4 -2
- regscale/models/regscale_models/__init__.py +7 -0
- regscale/models/regscale_models/assessment.py +2 -1
- regscale/models/regscale_models/catalog.py +1 -1
- regscale/models/regscale_models/compliance_settings.py +251 -1
- regscale/models/regscale_models/component.py +1 -0
- regscale/models/regscale_models/control_implementation.py +236 -41
- regscale/models/regscale_models/control_objective.py +74 -5
- regscale/models/regscale_models/file.py +2 -0
- regscale/models/regscale_models/form_field_value.py +5 -3
- regscale/models/regscale_models/inheritance.py +44 -0
- regscale/models/regscale_models/issue.py +301 -102
- regscale/models/regscale_models/milestone.py +33 -14
- regscale/models/regscale_models/organization.py +3 -0
- regscale/models/regscale_models/regscale_model.py +310 -73
- regscale/models/regscale_models/security_plan.py +4 -2
- regscale/models/regscale_models/vulnerability.py +3 -3
- regscale/regscale.py +25 -4
- regscale/templates/__init__.py +0 -0
- regscale/utils/threading/threadhandler.py +20 -15
- regscale/validation/record.py +23 -1
- {regscale_cli-6.21.2.0.dist-info → regscale_cli-6.28.2.1.dist-info}/METADATA +17 -33
- {regscale_cli-6.21.2.0.dist-info → regscale_cli-6.28.2.1.dist-info}/RECORD +310 -111
- tests/core/__init__.py +0 -0
- tests/core/utils/__init__.py +0 -0
- tests/core/utils/test_async_graphql_client.py +472 -0
- tests/fixtures/test_fixture.py +13 -8
- tests/regscale/core/test_login.py +171 -4
- tests/regscale/integrations/commercial/__init__.py +0 -0
- tests/regscale/integrations/commercial/aws/__init__.py +0 -0
- tests/regscale/integrations/commercial/aws/test_audit_manager_compliance.py +1304 -0
- tests/regscale/integrations/commercial/aws/test_audit_manager_evidence_aggregation.py +341 -0
- tests/regscale/integrations/commercial/aws/test_aws_analytics_collector.py +260 -0
- tests/regscale/integrations/commercial/aws/test_aws_applications_collector.py +242 -0
- tests/regscale/integrations/commercial/aws/test_aws_audit_manager_collector.py +1155 -0
- tests/regscale/integrations/commercial/aws/test_aws_cloudtrail_collector.py +534 -0
- tests/regscale/integrations/commercial/aws/test_aws_config_collector.py +400 -0
- tests/regscale/integrations/commercial/aws/test_aws_developer_tools_collector.py +203 -0
- tests/regscale/integrations/commercial/aws/test_aws_guardduty_collector.py +315 -0
- tests/regscale/integrations/commercial/aws/test_aws_iam_collector.py +458 -0
- tests/regscale/integrations/commercial/aws/test_aws_inspector_collector.py +353 -0
- tests/regscale/integrations/commercial/aws/test_aws_inventory_integration.py +530 -0
- tests/regscale/integrations/commercial/aws/test_aws_kms_collector.py +919 -0
- tests/regscale/integrations/commercial/aws/test_aws_machine_learning_collector.py +237 -0
- tests/regscale/integrations/commercial/aws/test_aws_s3_collector.py +722 -0
- tests/regscale/integrations/commercial/aws/test_aws_scanner_integration.py +722 -0
- tests/regscale/integrations/commercial/aws/test_aws_securityhub_collector.py +792 -0
- tests/regscale/integrations/commercial/aws/test_aws_systems_manager_collector.py +918 -0
- tests/regscale/integrations/commercial/aws/test_aws_vpc_collector.py +996 -0
- tests/regscale/integrations/commercial/aws/test_cli_evidence.py +431 -0
- tests/regscale/integrations/commercial/aws/test_cloudtrail_control_mappings.py +452 -0
- tests/regscale/integrations/commercial/aws/test_cloudtrail_evidence.py +788 -0
- tests/regscale/integrations/commercial/aws/test_config_compliance.py +298 -0
- tests/regscale/integrations/commercial/aws/test_conformance_pack_mappings.py +200 -0
- tests/regscale/integrations/commercial/aws/test_control_compliance_analyzer.py +375 -0
- tests/regscale/integrations/commercial/aws/test_datetime_parsing.py +223 -0
- tests/regscale/integrations/commercial/aws/test_evidence_generator.py +386 -0
- tests/regscale/integrations/commercial/aws/test_guardduty_control_mappings.py +564 -0
- tests/regscale/integrations/commercial/aws/test_guardduty_evidence.py +1041 -0
- tests/regscale/integrations/commercial/aws/test_iam_control_mappings.py +718 -0
- tests/regscale/integrations/commercial/aws/test_iam_evidence.py +1375 -0
- tests/regscale/integrations/commercial/aws/test_kms_control_mappings.py +656 -0
- tests/regscale/integrations/commercial/aws/test_kms_evidence.py +1163 -0
- tests/regscale/integrations/commercial/aws/test_ocsf_mapper.py +370 -0
- tests/regscale/integrations/commercial/aws/test_org_control_mappings.py +546 -0
- tests/regscale/integrations/commercial/aws/test_org_evidence.py +1240 -0
- tests/regscale/integrations/commercial/aws/test_s3_control_mappings.py +672 -0
- tests/regscale/integrations/commercial/aws/test_s3_evidence.py +987 -0
- tests/regscale/integrations/commercial/aws/test_scanner_evidence.py +373 -0
- tests/regscale/integrations/commercial/aws/test_security_hub_config_filtering.py +539 -0
- tests/regscale/integrations/commercial/aws/test_session_manager.py +516 -0
- tests/regscale/integrations/commercial/aws/test_ssm_control_mappings.py +588 -0
- tests/regscale/integrations/commercial/aws/test_ssm_evidence.py +735 -0
- tests/regscale/integrations/commercial/conftest.py +28 -0
- tests/regscale/integrations/commercial/microsoft_defender/__init__.py +1 -0
- tests/regscale/integrations/commercial/microsoft_defender/test_defender.py +1517 -0
- tests/regscale/integrations/commercial/microsoft_defender/test_defender_api.py +1748 -0
- tests/regscale/integrations/commercial/microsoft_defender/test_defender_constants.py +327 -0
- tests/regscale/integrations/commercial/microsoft_defender/test_defender_scanner.py +487 -0
- tests/regscale/integrations/commercial/test_aws.py +3742 -0
- tests/regscale/integrations/commercial/test_burp.py +48 -0
- tests/regscale/integrations/commercial/test_crowdstrike.py +49 -0
- tests/regscale/integrations/commercial/test_dependabot.py +341 -0
- tests/regscale/integrations/commercial/test_gcp.py +1543 -0
- tests/regscale/integrations/commercial/test_gitlab.py +549 -0
- tests/regscale/integrations/commercial/test_ip_mac_address_length.py +84 -0
- tests/regscale/integrations/commercial/test_jira.py +2204 -0
- tests/regscale/integrations/commercial/test_npm_audit.py +42 -0
- tests/regscale/integrations/commercial/test_okta.py +1228 -0
- tests/regscale/integrations/commercial/test_sarif_converter.py +251 -0
- tests/regscale/integrations/commercial/test_sicura.py +349 -0
- tests/regscale/integrations/commercial/test_snow.py +423 -0
- tests/regscale/integrations/commercial/test_sonarcloud.py +394 -0
- tests/regscale/integrations/commercial/test_sqlserver.py +186 -0
- tests/regscale/integrations/commercial/test_stig.py +33 -0
- tests/regscale/integrations/commercial/test_stig_mapper.py +153 -0
- tests/regscale/integrations/commercial/test_stigv2.py +406 -0
- tests/regscale/integrations/commercial/test_wiz.py +1365 -0
- tests/regscale/integrations/commercial/test_wiz_inventory.py +256 -0
- tests/regscale/integrations/commercial/wizv2/__init__.py +339 -0
- tests/regscale/integrations/commercial/wizv2/compliance/__init__.py +1 -0
- tests/regscale/integrations/commercial/wizv2/compliance/test_helpers.py +903 -0
- tests/regscale/integrations/commercial/wizv2/core/__init__.py +1 -0
- tests/regscale/integrations/commercial/wizv2/core/test_auth.py +701 -0
- tests/regscale/integrations/commercial/wizv2/core/test_client.py +1037 -0
- tests/regscale/integrations/commercial/wizv2/core/test_file_operations.py +989 -0
- tests/regscale/integrations/commercial/wizv2/fetchers/__init__.py +1 -0
- tests/regscale/integrations/commercial/wizv2/fetchers/test_policy_assessment.py +805 -0
- tests/regscale/integrations/commercial/wizv2/parsers/__init__.py +1 -0
- tests/regscale/integrations/commercial/wizv2/parsers/test_main.py +1153 -0
- tests/regscale/integrations/commercial/wizv2/processors/__init__.py +1 -0
- tests/regscale/integrations/commercial/wizv2/processors/test_finding.py +671 -0
- tests/regscale/integrations/commercial/wizv2/test_WizDataMixin.py +537 -0
- tests/regscale/integrations/commercial/wizv2/test_click_comprehensive.py +851 -0
- tests/regscale/integrations/commercial/wizv2/test_compliance_report_comprehensive.py +910 -0
- tests/regscale/integrations/commercial/wizv2/test_compliance_report_normalization.py +138 -0
- tests/regscale/integrations/commercial/wizv2/test_file_cleanup.py +283 -0
- tests/regscale/integrations/commercial/wizv2/test_file_operations.py +260 -0
- tests/regscale/integrations/commercial/wizv2/test_issue.py +343 -0
- tests/regscale/integrations/commercial/wizv2/test_issue_comprehensive.py +1203 -0
- tests/regscale/integrations/commercial/wizv2/test_reports.py +497 -0
- tests/regscale/integrations/commercial/wizv2/test_sbom.py +643 -0
- tests/regscale/integrations/commercial/wizv2/test_scanner_comprehensive.py +805 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_click_client_id.py +165 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_compliance_report.py +1394 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_compliance_unit.py +341 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_control_normalization.py +138 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_findings_comprehensive.py +364 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_inventory_comprehensive.py +644 -0
- tests/regscale/integrations/commercial/wizv2/test_wiz_status_mapping.py +149 -0
- tests/regscale/integrations/commercial/wizv2/test_wizv2.py +1218 -0
- tests/regscale/integrations/commercial/wizv2/test_wizv2_utils.py +519 -0
- tests/regscale/integrations/commercial/wizv2/utils/__init__.py +1 -0
- tests/regscale/integrations/commercial/wizv2/utils/test_main.py +1523 -0
- tests/regscale/integrations/public/__init__.py +0 -0
- tests/regscale/integrations/public/fedramp/__init__.py +1 -0
- tests/regscale/integrations/public/fedramp/test_gen_asset_list.py +150 -0
- tests/regscale/integrations/public/fedramp/test_poam_export_v5.py +1293 -0
- tests/regscale/integrations/public/test_alienvault.py +220 -0
- tests/regscale/integrations/public/test_cci.py +1053 -0
- tests/regscale/integrations/public/test_cisa.py +1021 -0
- tests/regscale/integrations/public/test_emass.py +518 -0
- tests/regscale/integrations/public/test_fedramp.py +1152 -0
- tests/regscale/integrations/public/test_fedramp_cis_crm.py +3661 -0
- tests/regscale/integrations/public/test_file_uploads.py +506 -0
- tests/regscale/integrations/public/test_oscal.py +453 -0
- tests/regscale/integrations/test_compliance_status_mapping.py +406 -0
- tests/regscale/integrations/test_control_matcher.py +1421 -0
- tests/regscale/integrations/test_control_matching.py +155 -0
- tests/regscale/integrations/test_milestone_manager.py +408 -0
- tests/regscale/models/test_control_implementation.py +118 -3
- tests/regscale/models/test_form_field_value_integration.py +304 -0
- tests/regscale/models/test_issue.py +378 -1
- tests/regscale/models/test_module_integration.py +582 -0
- tests/regscale/models/test_tenable_integrations.py +811 -105
- regscale/integrations/commercial/wizv2/policy_compliance.py +0 -3057
- regscale/integrations/public/fedramp/mappings/fedramp_r4_parts.json +0 -7388
- regscale/integrations/public/fedramp/mappings/fedramp_r5_parts.json +0 -9605
- regscale/integrations/public/fedramp/parts_mapper.py +0 -107
- /regscale/integrations/commercial/{amazon → sarif}/__init__.py +0 -0
- /regscale/integrations/commercial/wizv2/{wiz_auth.py → core/auth.py} +0 -0
- {regscale_cli-6.21.2.0.dist-info → regscale_cli-6.28.2.1.dist-info}/LICENSE +0 -0
- {regscale_cli-6.21.2.0.dist-info → regscale_cli-6.28.2.1.dist-info}/WHEEL +0 -0
- {regscale_cli-6.21.2.0.dist-info → regscale_cli-6.28.2.1.dist-info}/entry_points.txt +0 -0
- {regscale_cli-6.21.2.0.dist-info → regscale_cli-6.28.2.1.dist-info}/top_level.txt +0 -0
regscale/dev/code_gen.py
CHANGED
|
@@ -7,9 +7,13 @@ if TYPE_CHECKING:
|
|
|
7
7
|
|
|
8
8
|
from regscale.models.integration_models.synqly_models.connector_types import ConnectorType
|
|
9
9
|
from regscale.models.integration_models.synqly_models.param import Param
|
|
10
|
+
from regscale.models.integration_models.synqly_models.filter_parser import FilterParser
|
|
10
11
|
|
|
11
12
|
SUPPORTED_CONNECTORS = [ConnectorType.Ticketing, ConnectorType.Vulnerabilities, ConnectorType.Assets, ConnectorType.Edr]
|
|
12
13
|
|
|
14
|
+
# Initialize FilterParser once at module level
|
|
15
|
+
filter_parser = FilterParser()
|
|
16
|
+
|
|
13
17
|
|
|
14
18
|
def generate_dags() -> None:
|
|
15
19
|
"""Generate Airflow DAGs for the platform"""
|
|
@@ -166,35 +170,49 @@ def _build_op_kwargs_and_docstring(
|
|
|
166
170
|
capabilities=capabilities,
|
|
167
171
|
)
|
|
168
172
|
|
|
169
|
-
if ConnectorType.Vulnerabilities.lower() in integration
|
|
170
|
-
|
|
173
|
+
if ConnectorType.Vulnerabilities.lower() in integration:
|
|
174
|
+
vuln_params = {}
|
|
175
|
+
if param_type == "optional_params":
|
|
171
176
|
vuln_params: dict[str, Param] = {
|
|
172
|
-
"vuln_filter": Param(
|
|
173
|
-
name="vuln_filter",
|
|
174
|
-
type="choice",
|
|
175
|
-
description="Filter the vulnerabilities for the selected severity. (Options: critical, high, medium, low, info)",
|
|
176
|
-
default=None,
|
|
177
|
-
),
|
|
178
177
|
"scan_date": Param(
|
|
179
178
|
name="scan_date",
|
|
180
179
|
type="string",
|
|
181
180
|
description="The date of the scan to sync vulnerabilities into RegScale.",
|
|
182
|
-
default=
|
|
181
|
+
default=None,
|
|
183
182
|
),
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
183
|
+
}
|
|
184
|
+
elif param_type == "expected_params":
|
|
185
|
+
vuln_params: dict[str, Param] = {
|
|
186
|
+
"minimum_severity_filter": Param(
|
|
187
|
+
name="minimum_severity_filter",
|
|
188
|
+
type="choice",
|
|
189
|
+
description="Minimum severity of the vulnerabilities to sync. (Options: critical, high, medium, low, info, all), e.g. providing 'high' will sync all vulnerabilities with a severity of high and critical.",
|
|
190
|
+
default=None,
|
|
189
191
|
),
|
|
190
192
|
}
|
|
191
|
-
|
|
193
|
+
config[param_type] = {**config[param_type], **vuln_params}
|
|
194
|
+
|
|
195
|
+
# Add filter parameter for Assets and Vulnerabilities connectors
|
|
196
|
+
if (
|
|
197
|
+
ConnectorType.Assets.lower() in integration or ConnectorType.Vulnerabilities.lower() in integration
|
|
198
|
+
) and param_type == "optional_params":
|
|
199
|
+
# Use 'asset_filter' for vulnerabilities, 'filter' for assets
|
|
200
|
+
param_name = "asset_filter" if ConnectorType.Vulnerabilities.lower() in integration else "filter"
|
|
201
|
+
filter_param = {
|
|
202
|
+
param_name: Param(
|
|
203
|
+
name=param_name,
|
|
204
|
+
type="string",
|
|
205
|
+
description="Semicolon separated filters of format filter[operator]value",
|
|
206
|
+
default=None,
|
|
207
|
+
)
|
|
208
|
+
}
|
|
209
|
+
config[param_type] = {**config.get(param_type, {}), **filter_param}
|
|
192
210
|
if config.get(param_type):
|
|
193
211
|
if proper_type not in doc_string:
|
|
194
212
|
doc_string += f"{proper_type}:\n"
|
|
195
213
|
for param in config[param_type]:
|
|
196
214
|
op_kwargs, doc_string = _build_other_params(
|
|
197
|
-
|
|
215
|
+
param_obj=config[param_type][param],
|
|
198
216
|
param=param,
|
|
199
217
|
param_type=param_type,
|
|
200
218
|
proper_type=proper_type,
|
|
@@ -238,11 +256,13 @@ def _build_expected_params(
|
|
|
238
256
|
|
|
239
257
|
|
|
240
258
|
def _build_other_params(
|
|
241
|
-
|
|
259
|
+
param_obj: Param, param: str, param_type: str, proper_type: str, integration: str, op_kwargs: str, doc_string: str
|
|
242
260
|
) -> tuple[str, str]:
|
|
243
261
|
"""
|
|
244
262
|
Build the other params for the DAG by adding them to the op_kwargs and docstring
|
|
245
263
|
|
|
264
|
+
:param Param param_obj: The parameter object
|
|
265
|
+
:param str param: The name of the parameter
|
|
246
266
|
:param str param_type: The type of parameter to build
|
|
247
267
|
:param str integration: The name of the integration, typically connector_integration
|
|
248
268
|
:param str op_kwargs: The op_kwargs to add to the DAG
|
|
@@ -250,7 +270,6 @@ def _build_other_params(
|
|
|
250
270
|
:return: The op_kwargs and docstring
|
|
251
271
|
:rtype: tuple[str, str]
|
|
252
272
|
"""
|
|
253
|
-
param_obj: Param = config[param_type][param]
|
|
254
273
|
param_name = f"{integration.lower()}_{param}" if param_type == "required_secrets" else param
|
|
255
274
|
jinja_key = f"'{param_name}'"
|
|
256
275
|
if default := param_obj.default:
|
|
@@ -290,6 +309,7 @@ def add_connector_specific_params(
|
|
|
290
309
|
sync_attachments_jinja = "'sync_attachments'"
|
|
291
310
|
op_kwargs += f'\n "sync_attachments": "{{{{ dag_run.conf[{sync_attachments_jinja}] if {sync_attachments_jinja} in dag_run.conf else False }}}}",'
|
|
292
311
|
doc_string += " sync_attachments: BOOLEAN Whether to sync attachments between integration and RegScale\n"
|
|
312
|
+
|
|
293
313
|
return op_kwargs, doc_string
|
|
294
314
|
|
|
295
315
|
|
|
@@ -353,6 +373,44 @@ def {connector}() -> None:
|
|
|
353
373
|
pass
|
|
354
374
|
"""
|
|
355
375
|
|
|
376
|
+
# Add build-query command for Assets and Vulnerabilities connectors
|
|
377
|
+
if connector in [ConnectorType.Assets, ConnectorType.Vulnerabilities]:
|
|
378
|
+
cli_code += f"""
|
|
379
|
+
|
|
380
|
+
@{connector}.command(name="build-query")
|
|
381
|
+
@click.option(
|
|
382
|
+
'--provider',
|
|
383
|
+
required=False,
|
|
384
|
+
help='Provider ID (e.g., {connector}_armis_centrix). If not specified, starts interactive mode.'
|
|
385
|
+
)
|
|
386
|
+
@click.option(
|
|
387
|
+
'--validate',
|
|
388
|
+
help='Validate a filter string against provider capabilities'
|
|
389
|
+
)
|
|
390
|
+
@click.option(
|
|
391
|
+
'--list-fields',
|
|
392
|
+
is_flag=True,
|
|
393
|
+
default=False,
|
|
394
|
+
help='List all available fields for the provider'
|
|
395
|
+
)
|
|
396
|
+
def build_query(provider, validate, list_fields):
|
|
397
|
+
\"\"\"
|
|
398
|
+
Build and validate filter queries for {connector.capitalize()} connectors.
|
|
399
|
+
|
|
400
|
+
Examples:
|
|
401
|
+
# Build a filter query
|
|
402
|
+
regscale {connector} build-query
|
|
403
|
+
|
|
404
|
+
# List all fields for a specific provider
|
|
405
|
+
regscale {connector} build-query --provider {connector}_armis_centrix --list-fields
|
|
406
|
+
|
|
407
|
+
# Validate a filter string
|
|
408
|
+
regscale {connector} build-query --provider {connector}_armis_centrix --validate "device.ip[eq]192.168.1.1"
|
|
409
|
+
\"\"\"
|
|
410
|
+
from regscale.integrations.commercial.synqly.query_builder import handle_build_query
|
|
411
|
+
handle_build_query('{connector}', provider, validate, list_fields)
|
|
412
|
+
"""
|
|
413
|
+
|
|
356
414
|
# replace the integration config with a flattened version
|
|
357
415
|
for integration, config in integration_configs.items():
|
|
358
416
|
capabilities = config.get("capabilities", [])
|
|
@@ -363,6 +421,7 @@ def {connector}() -> None:
|
|
|
363
421
|
connector=connector,
|
|
364
422
|
integration_name=integration_name,
|
|
365
423
|
capabilities=capabilities,
|
|
424
|
+
provider_id=integration, # Pass the full provider ID for filter support
|
|
366
425
|
)
|
|
367
426
|
cli_code += f"\n\n{click_options_and_command}"
|
|
368
427
|
integrations_count += 1
|
|
@@ -374,40 +433,65 @@ def {connector}() -> None:
|
|
|
374
433
|
print(f"Generated click commands for {integrations_count} {connector} connector(s).")
|
|
375
434
|
|
|
376
435
|
|
|
377
|
-
def _build_all_params(
|
|
436
|
+
def _build_all_params(
|
|
437
|
+
integration_name: str, connector: str, provider_id: str = None
|
|
438
|
+
) -> tuple[list[str], list[str], list[str]]:
|
|
378
439
|
"""
|
|
379
440
|
Function to build the click options, function params, and function kwargs for the integration
|
|
380
441
|
|
|
381
442
|
:param str integration_name: The name of the integration
|
|
382
443
|
:param str connector: The connector type
|
|
444
|
+
:param str provider_id: The provider ID for filter support (e.g., 'assets_armis_centrix')
|
|
383
445
|
:return: The click options, function params, and function kwargs
|
|
384
446
|
:rtype: tuple[list[str], list[str], list[str]]
|
|
385
447
|
"""
|
|
386
448
|
if connector == ConnectorType.Vulnerabilities:
|
|
387
|
-
vuln_filter_option = "@click.option(\n '--
|
|
449
|
+
vuln_filter_option = "@click.option(\n '--minimum_severity_filter','-s',\n help='Minimum severity of the vulnerabilities to sync. (Options: critical, high, medium, low, info), e.g. providing high will sync all vulnerabilities with a severity of high and critical.',\n required=False,\n type=click.Choice(['critical', 'high', 'medium', 'low', 'info']),\n default=None)\n"
|
|
388
450
|
scan_date_option = f"@click.option(\n '--scan_date',\n help='The date of the scan to sync vulnerabilities from {integration_name}',\n required=False,\n type=click.DateTime(formats=['%Y-%m-%d']),\n default=None)\n"
|
|
389
451
|
all_vulns_flag = f"@click.option(\n '--all_scans',\n help='Whether to sync all vulnerabilities from {integration_name}',\n required=False,\n is_flag=True,\n default=False)\n"
|
|
390
452
|
click_options = ["@regscale_ssp_id()", vuln_filter_option, scan_date_option, all_vulns_flag]
|
|
391
|
-
function_params = [
|
|
453
|
+
function_params = [
|
|
454
|
+
"regscale_ssp_id: int",
|
|
455
|
+
"minimum_severity_filter: str",
|
|
456
|
+
"scan_date: datetime",
|
|
457
|
+
"all_scans: bool",
|
|
458
|
+
]
|
|
392
459
|
function_kwargs = [
|
|
393
460
|
"regscale_ssp_id=regscale_ssp_id",
|
|
394
|
-
"
|
|
461
|
+
"minimum_severity_filter=minimum_severity_filter",
|
|
395
462
|
"scan_date=scan_date",
|
|
396
463
|
"all_scans=all_scans",
|
|
397
464
|
]
|
|
465
|
+
|
|
466
|
+
# Add filter option if provider supports filtering
|
|
467
|
+
if provider_id and filter_parser.has_filters(provider_id):
|
|
468
|
+
filter_option = "@click.option(\n '--asset_filter',\n help='STRING: Apply filters to asset queries. Can be a single filter \"field[operator]value\" or semicolon-separated filters \"field1[op]value1;field2[op]value2\"',\n required=False,\n type=str,\n default=None)\n"
|
|
469
|
+
click_options.append(filter_option)
|
|
470
|
+
function_params.append("asset_filter: str")
|
|
471
|
+
function_kwargs.append("filter=asset_filter.split(';') if asset_filter else []")
|
|
472
|
+
|
|
398
473
|
elif connector == ConnectorType.Ticketing:
|
|
399
474
|
click_options = ["@regscale_id()", "@regscale_module()"]
|
|
400
475
|
function_params = ["regscale_id: int", "regscale_module: str"]
|
|
401
476
|
function_kwargs = ["regscale_id=regscale_id", "regscale_module=regscale_module"]
|
|
402
477
|
else:
|
|
478
|
+
# Assets and other connectors
|
|
403
479
|
click_options = ["@regscale_ssp_id()"]
|
|
404
480
|
function_params = ["regscale_ssp_id: int"]
|
|
405
481
|
function_kwargs = ["regscale_ssp_id=regscale_ssp_id"]
|
|
482
|
+
|
|
483
|
+
# Add filter option for Assets if provider supports filtering
|
|
484
|
+
if connector == ConnectorType.Assets and provider_id and filter_parser.has_filters(provider_id):
|
|
485
|
+
filter_option = "@click.option(\n '--filter',\n help='STRING: Apply filters to the query. Can be a single filter \"field[operator]value\" or semicolon-separated filters \"field1[op]value1;field2[op]value2\"',\n required=False,\n type=str,\n default=None)\n"
|
|
486
|
+
click_options.append(filter_option)
|
|
487
|
+
function_params.append("filter: str")
|
|
488
|
+
function_kwargs.append("filter=filter.split(';') if filter else []")
|
|
489
|
+
|
|
406
490
|
return click_options, function_params, function_kwargs
|
|
407
491
|
|
|
408
492
|
|
|
409
493
|
def _build_click_options_and_command(
|
|
410
|
-
config: dict, connector: str, integration_name: str, capabilities: list[str]
|
|
494
|
+
config: dict, connector: str, integration_name: str, capabilities: list[str], provider_id: str = None
|
|
411
495
|
) -> str:
|
|
412
496
|
"""
|
|
413
497
|
Function to use the config to build the click options and command for the integration
|
|
@@ -416,12 +500,13 @@ def _build_click_options_and_command(
|
|
|
416
500
|
:param str connector: The connector type
|
|
417
501
|
:param str integration_name: The name of the integration
|
|
418
502
|
:param list[str] capabilities: The capabilities of the integration
|
|
503
|
+
:param str provider_id: The provider ID for filter support (e.g., 'assets_armis_centrix')
|
|
419
504
|
:return: The click options as a string
|
|
420
505
|
:rtype: str
|
|
421
506
|
"""
|
|
422
507
|
doc_string_name = integration_name.replace("_", " ").title()
|
|
423
508
|
# add regscale_ssp_id as a default option
|
|
424
|
-
click_options, function_params, function_kwargs = _build_all_params(doc_string_name, connector)
|
|
509
|
+
click_options, function_params, function_kwargs = _build_all_params(doc_string_name, connector, provider_id)
|
|
425
510
|
for param_type in ["expected_params", "optional_params"]:
|
|
426
511
|
for param in config.get(param_type, []):
|
|
427
512
|
param_data = config[param_type][param]
|
regscale/dev/version.py
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Version management script for regscale-cli."""
|
|
3
|
+
|
|
4
|
+
import re
|
|
5
|
+
import sys
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
|
|
9
|
+
console = Console()
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def update_version_in_pyproject_toml(version: str) -> None:
|
|
13
|
+
"""
|
|
14
|
+
Update the version in pyproject.toml.
|
|
15
|
+
|
|
16
|
+
:param str version: The version to update to
|
|
17
|
+
"""
|
|
18
|
+
pyproject_file = "pyproject.toml"
|
|
19
|
+
|
|
20
|
+
pyproject_path = Path(pyproject_file)
|
|
21
|
+
content = pyproject_path.read_text()
|
|
22
|
+
|
|
23
|
+
# Update the version
|
|
24
|
+
pattern = r'version\s*=\s*["\']([^"\']+)["\']'
|
|
25
|
+
replacement = f'version = "{version}"'
|
|
26
|
+
|
|
27
|
+
if re.search(pattern, content):
|
|
28
|
+
content = re.sub(pattern, replacement, content)
|
|
29
|
+
pyproject_path.write_text(content)
|
|
30
|
+
console.print(f"[green]Updated version to {version} in {pyproject_file}")
|
|
31
|
+
else:
|
|
32
|
+
console.print(f"[red]Could not find version in {pyproject_file}")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def update_fallback_version_in_version_py(version: str) -> None:
|
|
36
|
+
"""
|
|
37
|
+
Update the fallback version in regscale/_version.py.
|
|
38
|
+
|
|
39
|
+
:param str version: The version to update to
|
|
40
|
+
"""
|
|
41
|
+
version_py_path = Path("regscale/_version.py")
|
|
42
|
+
content = version_py_path.read_text()
|
|
43
|
+
pattern = r'return\s*["\'](\d+\.\d+\.\d+\.\d+)["\']\s*# fallback version'
|
|
44
|
+
replacement = f'return "{version}" # fallback version'
|
|
45
|
+
if re.search(pattern, content):
|
|
46
|
+
content = re.sub(pattern, replacement, content)
|
|
47
|
+
version_py_path.write_text(content)
|
|
48
|
+
console.print(f"[green]Updated fallback version to {version} in regscale/_version.py")
|
|
49
|
+
else:
|
|
50
|
+
console.print("[red]Could not find fallback version in regscale/_version.py")
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def get_current_version() -> str:
|
|
54
|
+
"""
|
|
55
|
+
Get the current version from the package.
|
|
56
|
+
|
|
57
|
+
:return: The current version
|
|
58
|
+
:rtype: str
|
|
59
|
+
"""
|
|
60
|
+
try:
|
|
61
|
+
# Add the project root to Python path to ensure we can import regscale
|
|
62
|
+
project_root = Path(__file__).parent.parent
|
|
63
|
+
if str(project_root) not in sys.path:
|
|
64
|
+
sys.path.insert(0, str(project_root))
|
|
65
|
+
|
|
66
|
+
from regscale import __version__
|
|
67
|
+
|
|
68
|
+
return __version__
|
|
69
|
+
except ImportError as e:
|
|
70
|
+
console.print(f"[red]Could not import version from regscale package: {e}")
|
|
71
|
+
console.print("[yellow]Make sure you're running this script from the project root directory")
|
|
72
|
+
sys.exit(1)
|
|
@@ -43,13 +43,27 @@ show_mapping(aqua, "aqua")
|
|
|
43
43
|
cls=LazyGroup,
|
|
44
44
|
lazy_subcommands={
|
|
45
45
|
"sync_assets": "regscale.integrations.commercial.aws.cli.sync_assets",
|
|
46
|
+
"sync_findings": "regscale.integrations.commercial.aws.cli.sync_findings",
|
|
46
47
|
"sync_findings_and_assets": "regscale.integrations.commercial.aws.cli.sync_findings_and_assets",
|
|
48
|
+
"sync_compliance": "regscale.integrations.commercial.aws.cli.sync_compliance",
|
|
49
|
+
"sync_config_compliance": "regscale.integrations.commercial.aws.cli.sync_config_compliance",
|
|
50
|
+
"sync_kms": "regscale.integrations.commercial.aws.cli.sync_kms",
|
|
51
|
+
"sync_org": "regscale.integrations.commercial.aws.cli.sync_org",
|
|
52
|
+
"sync_iam": "regscale.integrations.commercial.aws.cli.sync_iam",
|
|
53
|
+
"sync_guardduty": "regscale.integrations.commercial.aws.cli.sync_guardduty",
|
|
54
|
+
"sync_s3": "regscale.integrations.commercial.aws.cli.sync_s3",
|
|
55
|
+
"sync_cloudtrail": "regscale.integrations.commercial.aws.cli.sync_cloudtrail",
|
|
56
|
+
"sync_cloudwatch": "regscale.integrations.commercial.aws.cli.sync_cloudwatch",
|
|
57
|
+
"sync_ssm": "regscale.integrations.commercial.aws.cli.sync_ssm",
|
|
58
|
+
"inventory": "regscale.integrations.commercial.aws.cli.inventory",
|
|
59
|
+
"findings": "regscale.integrations.commercial.aws.cli.findings",
|
|
60
|
+
"auth": "regscale.integrations.commercial.aws.cli.auth",
|
|
47
61
|
"inspector": "regscale.integrations.commercial.aws.cli.inspector",
|
|
48
62
|
},
|
|
49
63
|
name="aws",
|
|
50
64
|
)
|
|
51
65
|
def aws():
|
|
52
|
-
"""AWS Integrations"""
|
|
66
|
+
"""AWS Integrations - Asset sync, findings, compliance, and inventory collection"""
|
|
53
67
|
pass
|
|
54
68
|
|
|
55
69
|
|
|
@@ -118,6 +132,8 @@ def crowdstrike():
|
|
|
118
132
|
"sync_cloud_alerts": "regscale.integrations.commercial.microsoft_defender.defender.sync_cloud_alerts",
|
|
119
133
|
"sync_cloud_recommendations": "regscale.integrations.commercial.microsoft_defender.defender.sync_cloud_recommendations",
|
|
120
134
|
"import_alerts": "regscale.integrations.commercial.microsoft_defender.defender.import_alerts",
|
|
135
|
+
"collect_entra_evidence": "regscale.integrations.commercial.microsoft_defender.defender.collect_entra_evidence",
|
|
136
|
+
"show_entra_mappings": "regscale.integrations.commercial.microsoft_defender.defender.show_entra_mappings",
|
|
121
137
|
},
|
|
122
138
|
name="defender",
|
|
123
139
|
)
|
|
@@ -319,6 +335,18 @@ def qualys():
|
|
|
319
335
|
show_mapping(group=qualys, import_name="qualys", file_type="csv")
|
|
320
336
|
|
|
321
337
|
|
|
338
|
+
@click.group(
|
|
339
|
+
cls=LazyGroup,
|
|
340
|
+
lazy_subcommands={
|
|
341
|
+
"import": "regscale.integrations.commercial.sarif.sarif_converter.import_sarif",
|
|
342
|
+
},
|
|
343
|
+
name="sarif",
|
|
344
|
+
)
|
|
345
|
+
def sarif():
|
|
346
|
+
"""Convert SARIF files to OCSF format via API."""
|
|
347
|
+
pass
|
|
348
|
+
|
|
349
|
+
|
|
322
350
|
@click.group(
|
|
323
351
|
cls=LazyGroup,
|
|
324
352
|
lazy_subcommands={
|
|
@@ -475,10 +503,10 @@ show_mapping(veracode, "veracode")
|
|
|
475
503
|
"inventory": "regscale.integrations.commercial.wizv2.click.inventory",
|
|
476
504
|
"issues": "regscale.integrations.commercial.wizv2.click.issues",
|
|
477
505
|
"attach_sbom": "regscale.integrations.commercial.wizv2.click.attach_sbom",
|
|
478
|
-
"threats": "regscale.integrations.commercial.wizv2.click.threats",
|
|
479
506
|
"vulnerabilities": "regscale.integrations.commercial.wizv2.click.vulnerabilities",
|
|
480
507
|
"add_report_evidence": "regscale.integrations.commercial.wizv2.click.add_report_evidence",
|
|
481
508
|
"sync_compliance": "regscale.integrations.commercial.wizv2.click.sync_compliance",
|
|
509
|
+
"compliance_report": "regscale.integrations.commercial.wizv2.click.compliance_report",
|
|
482
510
|
},
|
|
483
511
|
name="wiz",
|
|
484
512
|
)
|