iam-policy-validator 1.14.5__py3-none-any.whl → 1.14.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iam-policy-validator
3
- Version: 1.14.5
3
+ Version: 1.14.6
4
4
  Summary: Validate AWS IAM policies for correctness and security using AWS Service Reference API
5
5
  Project-URL: Homepage, https://github.com/boogy/iam-policy-validator
6
6
  Project-URL: Documentation, https://github.com/boogy/iam-policy-validator/tree/main/docs
@@ -1,6 +1,6 @@
1
1
  iam_validator/__init__.py,sha256=xHdUASOxFHwEXfT_GSr_KrkLlnxZ-pAAr1wW1PwAGko,693
2
2
  iam_validator/__main__.py,sha256=to_nz3n_IerJpVVZZ6WSFlFR5s_06J0csfPOTfQZG8g,197
3
- iam_validator/__version__.py,sha256=8ouM89pP7JLVFY6dwrTsOuZeWcu_xuQ3YwT7-1g9xn8,374
3
+ iam_validator/__version__.py,sha256=WpHTF6NviSa8VivWMnhlxgCYH_CGf0PJr8rvIQ0xQuQ,374
4
4
  iam_validator/checks/__init__.py,sha256=OTkPnmlelu4YjMO8krjhu2wXiTV72RzopA5u1SfPQA0,1990
5
5
  iam_validator/checks/action_condition_enforcement.py,sha256=2-XUMbof9tQ7SHZNmAHMkR1DgbOIzY2eFWlp9S9dwLk,60625
6
6
  iam_validator/checks/action_resource_matching.py,sha256=qND0hfDgNoxFEdLWwrxOPVDfdj3k50nzedT2qF7nK7o,19428
@@ -54,7 +54,7 @@ iam_validator/core/models.py,sha256=lXUadIsTpp_j0Vt89Ez7aJkTKs2GD2ty3Ukl2NeY9Zo,
54
54
  iam_validator/core/policy_checks.py,sha256=FNVuS2GTffwCjjrlupVIazC172gSxKYAAT_ObV6Apbo,8803
55
55
  iam_validator/core/policy_loader.py,sha256=iid3mGfDzSXASzKDqbLnrqJHBdVQvvebofVqNImsGKM,29201
56
56
  iam_validator/core/pr_commenter.py,sha256=IZu2FQqzw73U_8ugTUq197ECLqk9mRCQpTWXPu5qk0k,35490
57
- iam_validator/core/report.py,sha256=IEHjNe6v_9nvcGA8_FNbXdG0AoV-yHVjiP1KQKnpEys,41376
57
+ iam_validator/core/report.py,sha256=IDjBjSrzrE_JdkA8eTiSxyUL3g36sJMhTkxehEYzuBQ,45476
58
58
  iam_validator/core/aws_service/__init__.py,sha256=UqMh4HUdGlx2QF5OoueJJ2UlCnhX4QW_x3KeE_bxRQc,735
59
59
  iam_validator/core/aws_service/cache.py,sha256=DPuOOPPJC867KAYgV1e0RyQs_k3mtefMdYli3jPaN64,3589
60
60
  iam_validator/core/aws_service/client.py,sha256=Zv7rIpEFdUCDXKGp3migPDkj8L5eZltgrGe64M2t2Ko,7336
@@ -85,7 +85,7 @@ iam_validator/core/formatters/json.py,sha256=A7gZ8P32GEdbDvrSn6v56yQ4fOP_kyMaoFV
85
85
  iam_validator/core/formatters/markdown.py,sha256=dk4STeY-tOEZsVrlmolIEqZvWYP9JhRtygxxNA49DEE,2293
86
86
  iam_validator/core/formatters/sarif.py,sha256=03MHSyuZm9FlzaPeWg7wH-UTzzCDhSy6vMPrFpFNkS8,18884
87
87
  iam_validator/integrations/__init__.py,sha256=7Hlor_X9j0NZaEjFuSvoXAAuSKQ-zgY19Rk-Dz3JpKo,616
88
- iam_validator/integrations/github_integration.py,sha256=IKhJW_v_lGZiuyPN_xWULzv2YBbaXHn8zBfaOdUm28g,69054
88
+ iam_validator/integrations/github_integration.py,sha256=0aeQ_RPTZf5ij7dsBjmtIDz4oHl0BXLno9GperFzTbc,69004
89
89
  iam_validator/integrations/ms_teams.py,sha256=t2PlWuTDb6GGH-eDU1jnOKd8D1w4FCB68bahGA7MJcE,14475
90
90
  iam_validator/sdk/__init__.py,sha256=AZLnfdn3A9AWb0pMhsbu3GAOAzt6rV7Fi3E3d9_3ZdI,6388
91
91
  iam_validator/sdk/arn_matching.py,sha256=HSDpLltOYISq-SoPebAlM89mKOaUaghq_04urchEFDA,12778
@@ -99,8 +99,8 @@ iam_validator/utils/__init__.py,sha256=NveA2F3G1E6-ANZzFr7J6Q6u5mogvMp862iFokmYu
99
99
  iam_validator/utils/cache.py,sha256=wOQKOBeoG6QqC5f0oXcHz63Cjtu_-SsSS-0pTSwyAiM,3254
100
100
  iam_validator/utils/regex.py,sha256=xHoMECttb7qaMhts-c9b0GIxdhHNZTt-UBr7wNhWfzg,6219
101
101
  iam_validator/utils/terminal.py,sha256=FsRaRMH_JAyDgXWBCOgOEhbS89cs17HCmKYoughq5io,724
102
- iam_policy_validator-1.14.5.dist-info/METADATA,sha256=h6M6__GqJW5fWPtV0cEDqZ4sK259K5ulz68Jgt6COQE,34456
103
- iam_policy_validator-1.14.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
104
- iam_policy_validator-1.14.5.dist-info/entry_points.txt,sha256=8HtWd8O7mvPiPdZR5YbzY8or_qcqLM4-pKaFdhtFT8M,62
105
- iam_policy_validator-1.14.5.dist-info/licenses/LICENSE,sha256=AMnbFTBDcK4_MITe2wiQBkj0vg-jjBBhsc43ydC7tt4,1098
106
- iam_policy_validator-1.14.5.dist-info/RECORD,,
102
+ iam_policy_validator-1.14.6.dist-info/METADATA,sha256=pAPaTarqbLi7q_cdHu3bkCVeu9BHed34jIQHgMXlj5I,34456
103
+ iam_policy_validator-1.14.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
104
+ iam_policy_validator-1.14.6.dist-info/entry_points.txt,sha256=8HtWd8O7mvPiPdZR5YbzY8or_qcqLM4-pKaFdhtFT8M,62
105
+ iam_policy_validator-1.14.6.dist-info/licenses/LICENSE,sha256=AMnbFTBDcK4_MITe2wiQBkj0vg-jjBBhsc43ydC7tt4,1098
106
+ iam_policy_validator-1.14.6.dist-info/RECORD,,
@@ -3,7 +3,7 @@
3
3
  This file is the single source of truth for the package version.
4
4
  """
5
5
 
6
- __version__ = "1.14.5"
6
+ __version__ = "1.14.6"
7
7
  # Parse version, handling pre-release suffixes like -rc, -alpha, -beta
8
8
  _version_base = __version__.split("-", maxsplit=1)[0] # Remove pre-release suffix if present
9
9
  __version_info__ = tuple(int(part) for part in _version_base.split("."))
@@ -478,13 +478,14 @@ class ReportGenerator:
478
478
 
479
479
  # Issue breakdown
480
480
  if report.total_issues > 0:
481
- # Count issues - support both IAM validity and security severities
482
- errors = sum(
483
- 1
484
- for r in report.results
485
- for i in r.issues
486
- if i.severity in constants.HIGH_SEVERITY_LEVELS
481
+ # Count issues - separate validity errors from security findings
482
+ validity_errors = sum(
483
+ 1 for r in report.results for i in r.issues if i.severity == "error"
487
484
  )
485
+ critical_findings = sum(
486
+ 1 for r in report.results for i in r.issues if i.severity == "critical"
487
+ )
488
+ high_findings = sum(1 for r in report.results for i in r.issues if i.severity == "high")
488
489
  warnings = sum(
489
490
  1 for r in report.results for i in r.issues if i.severity in ("warning", "medium")
490
491
  )
@@ -496,8 +497,12 @@ class ReportGenerator:
496
497
  lines.append("")
497
498
  lines.append("| Severity | Count |")
498
499
  lines.append("|----------|------:|")
499
- if errors > 0:
500
- lines.append(f"| 🔴 **Errors** | {errors} |")
500
+ if validity_errors > 0:
501
+ lines.append(f"| 🔴 **Errors** | {validity_errors} |")
502
+ if critical_findings > 0:
503
+ lines.append(f"| 🟣 **Critical** | {critical_findings} |")
504
+ if high_findings > 0:
505
+ lines.append(f"| 🔶 **High** | {high_findings} |")
501
506
  if warnings > 0:
502
507
  lines.append(f"| 🟡 **Warnings** | {warnings} |")
503
508
  if infos > 0:
@@ -578,15 +583,31 @@ class ReportGenerator:
578
583
  )
579
584
  lines.append("")
580
585
 
581
- # Group issues by severity - support both IAM validity and security severities
582
- errors = [i for i in result.issues if i.severity in constants.HIGH_SEVERITY_LEVELS]
586
+ # Group issues by severity - separate validity errors from security findings
587
+ validity_errors = [i for i in result.issues if i.severity == "error"]
588
+ critical_findings = [i for i in result.issues if i.severity == "critical"]
589
+ high_findings = [i for i in result.issues if i.severity == "high"]
583
590
  warnings = [i for i in result.issues if i.severity in constants.MEDIUM_SEVERITY_LEVELS]
584
591
  infos = [i for i in result.issues if i.severity in constants.LOW_SEVERITY_LEVELS]
585
592
 
586
- if errors:
593
+ if validity_errors:
587
594
  lines.append("### 🔴 Errors")
588
595
  lines.append("")
589
- for issue in errors:
596
+ for issue in validity_errors:
597
+ lines.append(self._format_issue_markdown(issue, result.policy_file))
598
+ lines.append("")
599
+
600
+ if critical_findings:
601
+ lines.append("### 🟣 Critical")
602
+ lines.append("")
603
+ for issue in critical_findings:
604
+ lines.append(self._format_issue_markdown(issue, result.policy_file))
605
+ lines.append("")
606
+
607
+ if high_findings:
608
+ lines.append("### 🔶 High")
609
+ lines.append("")
610
+ for issue in high_findings:
590
611
  lines.append(self._format_issue_markdown(issue, result.policy_file))
591
612
  lines.append("")
592
613
 
@@ -693,13 +714,14 @@ class ReportGenerator:
693
714
 
694
715
  # Issue breakdown
695
716
  if report.total_issues > 0:
696
- # Count issues - support both IAM validity and security severities
697
- errors = sum(
698
- 1
699
- for r in report.results
700
- for i in r.issues
701
- if i.severity in constants.HIGH_SEVERITY_LEVELS
717
+ # Count issues - separate validity errors from security findings
718
+ validity_errors = sum(
719
+ 1 for r in report.results for i in r.issues if i.severity == "error"
702
720
  )
721
+ critical_findings = sum(
722
+ 1 for r in report.results for i in r.issues if i.severity == "critical"
723
+ )
724
+ high_findings = sum(1 for r in report.results for i in r.issues if i.severity == "high")
703
725
  warnings = sum(
704
726
  1 for r in report.results for i in r.issues if i.severity in ("warning", "medium")
705
727
  )
@@ -711,8 +733,12 @@ class ReportGenerator:
711
733
  lines.append("")
712
734
  lines.append("| Severity | Count |")
713
735
  lines.append("|----------|------:|")
714
- if errors > 0:
715
- lines.append(f"| 🔴 **Errors** | {errors} |")
736
+ if validity_errors > 0:
737
+ lines.append(f"| 🔴 **Errors** | {validity_errors} |")
738
+ if critical_findings > 0:
739
+ lines.append(f"| 🟣 **Critical** | {critical_findings} |")
740
+ if high_findings > 0:
741
+ lines.append(f"| 🔶 **High** | {high_findings} |")
716
742
  if warnings > 0:
717
743
  lines.append(f"| 🟡 **Warnings** | {warnings} |")
718
744
  if infos > 0:
@@ -789,15 +815,21 @@ class ReportGenerator:
789
815
 
790
816
  policy_lines = []
791
817
 
792
- # Group issues by severity - support both IAM validity and security severities
793
- errors = [i for i in result.issues if i.severity in constants.HIGH_SEVERITY_LEVELS]
818
+ # Group issues by severity - separate validity errors from security findings
819
+ validity_errors = [i for i in result.issues if i.severity == "error"]
820
+ critical_findings = [i for i in result.issues if i.severity == "critical"]
821
+ high_findings = [i for i in result.issues if i.severity == "high"]
794
822
  warnings = [i for i in result.issues if i.severity in ("warning", "medium")]
795
823
  infos = [i for i in result.issues if i.severity in ("info", "low")]
796
824
 
797
825
  # Build severity summary for header
798
826
  severity_parts = []
799
- if errors:
800
- severity_parts.append(f"🔴 {len(errors)}")
827
+ if validity_errors:
828
+ severity_parts.append(f"🔴 {len(validity_errors)}")
829
+ if critical_findings:
830
+ severity_parts.append(f"🟣 {len(critical_findings)}")
831
+ if high_findings:
832
+ severity_parts.append(f"🔶 {len(high_findings)}")
801
833
  if warnings:
802
834
  severity_parts.append(f"🟡 {len(warnings)}")
803
835
  if infos:
@@ -812,11 +844,57 @@ class ReportGenerator:
812
844
  )
813
845
  policy_lines.append("")
814
846
 
815
- # Add errors (prioritized)
816
- if errors:
847
+ # Add validity errors (prioritized)
848
+ if validity_errors:
817
849
  policy_lines.append("### 🔴 Errors")
818
850
  policy_lines.append("")
819
- for i, issue in enumerate(errors):
851
+ for i, issue in enumerate(validity_errors):
852
+ issue_content = self._format_issue_markdown(issue, result.policy_file)
853
+ test_length = len("\n".join(details_lines + policy_lines)) + len(
854
+ issue_content
855
+ )
856
+ if test_length > available_length:
857
+ truncated = True
858
+ break
859
+ policy_lines.append(issue_content)
860
+ issues_shown += 1
861
+ # Add separator between issues within same severity
862
+ if i < len(validity_errors) - 1:
863
+ policy_lines.append("---")
864
+ policy_lines.append("")
865
+ policy_lines.append("")
866
+
867
+ if truncated:
868
+ break
869
+
870
+ # Add critical security findings
871
+ if critical_findings:
872
+ policy_lines.append("### 🟣 Critical")
873
+ policy_lines.append("")
874
+ for i, issue in enumerate(critical_findings):
875
+ issue_content = self._format_issue_markdown(issue, result.policy_file)
876
+ test_length = len("\n".join(details_lines + policy_lines)) + len(
877
+ issue_content
878
+ )
879
+ if test_length > available_length:
880
+ truncated = True
881
+ break
882
+ policy_lines.append(issue_content)
883
+ issues_shown += 1
884
+ # Add separator between issues within same severity
885
+ if i < len(critical_findings) - 1:
886
+ policy_lines.append("---")
887
+ policy_lines.append("")
888
+ policy_lines.append("")
889
+
890
+ if truncated:
891
+ break
892
+
893
+ # Add high security findings
894
+ if high_findings:
895
+ policy_lines.append("### 🔶 High")
896
+ policy_lines.append("")
897
+ for i, issue in enumerate(high_findings):
820
898
  issue_content = self._format_issue_markdown(issue, result.policy_file)
821
899
  test_length = len("\n".join(details_lines + policy_lines)) + len(
822
900
  issue_content
@@ -827,7 +905,7 @@ class ReportGenerator:
827
905
  policy_lines.append(issue_content)
828
906
  issues_shown += 1
829
907
  # Add separator between issues within same severity
830
- if i < len(errors) - 1:
908
+ if i < len(high_findings) - 1:
831
909
  policy_lines.append("---")
832
910
  policy_lines.append("")
833
911
  policy_lines.append("")
@@ -1278,7 +1278,7 @@ class GitHubIntegration:
1278
1278
  logger.info(f"Submitting {event.value} review (no inline comments)")
1279
1279
  success = await self.create_review_with_comments(
1280
1280
  comments=[],
1281
- body=body or f"<!-- {identifier} -->\nValidation complete.",
1281
+ body=body,
1282
1282
  event=event,
1283
1283
  )
1284
1284
  if not success: