regscale-cli 6.23.0.1__py3-none-any.whl → 6.24.0.0__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.

Potentially problematic release.


This version of regscale-cli might be problematic. Click here for more details.

Files changed (43) hide show
  1. regscale/_version.py +1 -1
  2. regscale/core/app/application.py +2 -0
  3. regscale/integrations/commercial/__init__.py +1 -0
  4. regscale/integrations/commercial/sarif/sarif_converter.py +1 -1
  5. regscale/integrations/commercial/wizv2/click.py +109 -2
  6. regscale/integrations/commercial/wizv2/compliance_report.py +1485 -0
  7. regscale/integrations/commercial/wizv2/constants.py +72 -2
  8. regscale/integrations/commercial/wizv2/data_fetcher.py +61 -0
  9. regscale/integrations/commercial/wizv2/file_cleanup.py +104 -0
  10. regscale/integrations/commercial/wizv2/issue.py +775 -27
  11. regscale/integrations/commercial/wizv2/policy_compliance.py +599 -181
  12. regscale/integrations/commercial/wizv2/reports.py +243 -0
  13. regscale/integrations/commercial/wizv2/scanner.py +668 -245
  14. regscale/integrations/compliance_integration.py +304 -51
  15. regscale/integrations/due_date_handler.py +210 -0
  16. regscale/integrations/public/cci_importer.py +444 -0
  17. regscale/integrations/scanner_integration.py +718 -153
  18. regscale/models/integration_models/CCI_List.xml +1 -0
  19. regscale/models/integration_models/cisa_kev_data.json +18 -3
  20. regscale/models/integration_models/synqly_models/capabilities.json +1 -1
  21. regscale/models/regscale_models/form_field_value.py +1 -1
  22. regscale/models/regscale_models/milestone.py +1 -0
  23. regscale/models/regscale_models/regscale_model.py +225 -60
  24. regscale/models/regscale_models/security_plan.py +3 -2
  25. regscale/regscale.py +7 -0
  26. {regscale_cli-6.23.0.1.dist-info → regscale_cli-6.24.0.0.dist-info}/METADATA +9 -9
  27. {regscale_cli-6.23.0.1.dist-info → regscale_cli-6.24.0.0.dist-info}/RECORD +43 -26
  28. tests/fixtures/test_fixture.py +13 -8
  29. tests/regscale/integrations/public/__init__.py +0 -0
  30. tests/regscale/integrations/public/test_alienvault.py +220 -0
  31. tests/regscale/integrations/public/test_cci.py +458 -0
  32. tests/regscale/integrations/public/test_cisa.py +1021 -0
  33. tests/regscale/integrations/public/test_emass.py +518 -0
  34. tests/regscale/integrations/public/test_fedramp.py +851 -0
  35. tests/regscale/integrations/public/test_fedramp_cis_crm.py +3661 -0
  36. tests/regscale/integrations/public/test_file_uploads.py +506 -0
  37. tests/regscale/integrations/public/test_oscal.py +453 -0
  38. tests/regscale/models/test_form_field_value_integration.py +304 -0
  39. tests/regscale/models/test_module_integration.py +582 -0
  40. {regscale_cli-6.23.0.1.dist-info → regscale_cli-6.24.0.0.dist-info}/LICENSE +0 -0
  41. {regscale_cli-6.23.0.1.dist-info → regscale_cli-6.24.0.0.dist-info}/WHEEL +0 -0
  42. {regscale_cli-6.23.0.1.dist-info → regscale_cli-6.24.0.0.dist-info}/entry_points.txt +0 -0
  43. {regscale_cli-6.23.0.1.dist-info → regscale_cli-6.24.0.0.dist-info}/top_level.txt +0 -0
regscale/_version.py CHANGED
@@ -33,7 +33,7 @@ def get_version_from_pyproject() -> str:
33
33
  return match.group(1)
34
34
  except Exception:
35
35
  pass
36
- return "6.23.0.1" # fallback version
36
+ return "6.24.0.0" # fallback version
37
37
 
38
38
 
39
39
  __version__ = get_version_from_pyproject()
@@ -214,6 +214,7 @@ class Application(metaclass=Singleton):
214
214
  "low": 365,
215
215
  "medium": 90,
216
216
  "status": "Open",
217
+ "minimumSeverity": "low",
217
218
  },
218
219
  "xray": {
219
220
  "critical": 30,
@@ -264,6 +265,7 @@ class Application(metaclass=Singleton):
264
265
  "token": DEFAULT_POPULATED,
265
266
  "userId": "enter RegScale user id here",
266
267
  "useMilestones": False,
268
+ "preventAutoClose": True,
267
269
  "otx": "enter AlienVault API key here",
268
270
  "wizAccessToken": DEFAULT_POPULATED,
269
271
  "wizAuthUrl": "https://auth.wiz.io/oauth/token",
@@ -491,6 +491,7 @@ show_mapping(veracode, "veracode")
491
491
  "vulnerabilities": "regscale.integrations.commercial.wizv2.click.vulnerabilities",
492
492
  "add_report_evidence": "regscale.integrations.commercial.wizv2.click.add_report_evidence",
493
493
  "sync_compliance": "regscale.integrations.commercial.wizv2.click.sync_compliance",
494
+ "compliance_report": "regscale.integrations.commercial.wizv2.click.compliance_report",
494
495
  },
495
496
  name="wiz",
496
497
  )
@@ -44,7 +44,7 @@ def sarif():
44
44
  type=click.DateTime(formats=["%Y-%m-%d"]),
45
45
  help="The scan date of the file.",
46
46
  required=False,
47
- default=get_current_datetime(),
47
+ default=get_current_datetime("%Y-%m-%d"),
48
48
  )
49
49
  def import_sarif(file_path: Path, asset_id: int, scan_date: Optional[datetime.datetime] = None) -> None:
50
50
  """Convert a SARIF file(s) to OCSF format using an API converter."""
@@ -154,7 +154,7 @@ def issues(
154
154
  scanner = WizIssue(plan_id=regscale_ssp_id)
155
155
  scanner.sync_findings(
156
156
  plan_id=regscale_ssp_id,
157
- filter_by_override=filter_by_override, # type: ignore
157
+ filter_by_override=filter_by, # Pass the processed dict with project ID
158
158
  client_id=client_id, # type: ignore
159
159
  client_secret=client_secret, # type: ignore
160
160
  wiz_project_id=wiz_project_id,
@@ -328,7 +328,11 @@ def add_report_evidence(
328
328
  )
329
329
 
330
330
 
331
- @wiz.command("sync_compliance")
331
+ @wiz.command(
332
+ "sync_compliance",
333
+ deprecated=True,
334
+ help="[BETA] This command shows an experimental feature. Use with caution. Use compliance report instead for Compliance sync from Wiz.",
335
+ )
332
336
  @click.option( # type: ignore
333
337
  "--wiz_project_id",
334
338
  "-p",
@@ -476,3 +480,106 @@ def sync_compliance(
476
480
  create_issues=create_issues,
477
481
  update_control_status=update_control_status,
478
482
  )
483
+
484
+
485
+ @wiz.command(name="compliance_report")
486
+ @click.option(
487
+ "--wiz_project_id",
488
+ "-p",
489
+ prompt="Enter the Wiz project ID",
490
+ help="Enter the Wiz Project ID for compliance report processing.",
491
+ required=True,
492
+ )
493
+ @regscale_id(help="RegScale will create and update control assessments as children of this record.")
494
+ @regscale_module(required=True, default="securityplans", prompt=False)
495
+ @click.option(
496
+ "--client_id",
497
+ "-i",
498
+ help="Wiz Client ID, or can be set as environment variable wizClientId",
499
+ default="",
500
+ hide_input=False,
501
+ required=False,
502
+ )
503
+ @click.option(
504
+ "--client_secret",
505
+ "-s",
506
+ help="Wiz Client Secret, or can be set as environment variable wizClientSecret",
507
+ default="",
508
+ hide_input=True,
509
+ required=False,
510
+ )
511
+ @click.option(
512
+ "--report_file_path",
513
+ "-f",
514
+ help="Path to existing CSV compliance report file (optional - will create new report if not provided)",
515
+ default=None,
516
+ required=False,
517
+ )
518
+ @click.option(
519
+ "--create-issues/--no-create-issues",
520
+ "-ci/-ni",
521
+ default=True,
522
+ help="Create issues for failed compliance assessments (default: enabled)",
523
+ )
524
+ @click.option(
525
+ "--update-control-status/--no-update-control-status",
526
+ "-ucs/-nucs",
527
+ default=True,
528
+ help="Update control implementation status based on assessment results (default: enabled)",
529
+ )
530
+ @click.option(
531
+ "--create-poams/--no-create-poams",
532
+ "-cp/-ncp",
533
+ default=False,
534
+ help="Mark created issues as POAMs (default: disabled)",
535
+ )
536
+ def compliance_report(
537
+ wiz_project_id,
538
+ regscale_id,
539
+ regscale_module,
540
+ client_id,
541
+ client_secret,
542
+ report_file_path,
543
+ create_issues,
544
+ update_control_status,
545
+ create_poams,
546
+ ):
547
+ """
548
+ Process Wiz compliance reports and create assessments in RegScale.
549
+
550
+ This command can either:
551
+ 1. Create a new compliance report from Wiz and process it
552
+ 2. Process an existing compliance report CSV file
553
+
554
+ The command will:
555
+ - Parse compliance assessment data from CSV format
556
+ - Create control assessments based on compliance results
557
+ - Create issues for failed compliance assessments (if --create-issues enabled)
558
+ - Update control implementation status (if --update-control-status enabled)
559
+ - Support POAM creation for compliance issues
560
+ """
561
+ from regscale.integrations.commercial.wizv2.compliance_report import WizComplianceReportProcessor
562
+
563
+ # Use environment variables if not provided
564
+ if not client_secret:
565
+ client_secret = WizVariables.wizClientSecret
566
+ if not client_id:
567
+ client_id = WizVariables.wizClientId
568
+
569
+ # Create and run the compliance report processor
570
+ # Enable bypass_control_filtering by default for performance with large control sets
571
+ processor = WizComplianceReportProcessor(
572
+ plan_id=regscale_id,
573
+ wiz_project_id=wiz_project_id,
574
+ client_id=client_id,
575
+ client_secret=client_secret,
576
+ regscale_module=regscale_module,
577
+ create_poams=create_poams,
578
+ create_issues=create_issues,
579
+ update_control_status=update_control_status,
580
+ report_file_path=report_file_path,
581
+ bypass_control_filtering=True, # Bypass filtering for performance with large control sets
582
+ )
583
+
584
+ # Process the compliance report using new ComplianceIntegration pattern
585
+ processor.process_compliance_sync()