Skip to content

CIEM-45:fix split#34

Merged
Tohar-orca merged 6 commits into
mainfrom
CIEM-45/Fix-statement-split
May 25, 2025
Merged

CIEM-45:fix split#34
Tohar-orca merged 6 commits into
mainfrom
CIEM-45/Fix-statement-split

Conversation

@deniss-orca

@deniss-orca deniss-orca commented May 21, 2025

Copy link
Copy Markdown
Collaborator

This PR fixes a bug in our policy compression logic where multiple condition operators from the same policy statement were not being properly preserved. Specifically, when a statement included both StringEquals and StringEqualsIfExists condition operators, only one of them would be retained after compression—resulting in loss of policy intent.

To address this, the logic has been updated to group and merge Action objects that originate from the same source statement. This grouping is based on matching the source, action, resource, and not_resource fields. When such matches are found, their conditions are merged to ensure that all applicable operators are retained in the final compressed policy.

@deniss-orca deniss-orca requested a review from Copilot May 21, 2025 07:05

This comment was marked as outdated.

@deniss-orca deniss-orca requested a review from Copilot May 21, 2025 08:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses the split issue by enhancing the policy expansion logic to group and merge actions based on their source, action, resource, and not_resource.

  • Introduces grouping of actions into a dictionary by source/action/resource/not_resource.
  • Implements merging of multiple actions’ conditions when they share the same key.
  • Updates subsequent processing to iterate over the merged actions.

Comment thread iam-ape/iam_ape/expand_policy.py
@deniss-orca deniss-orca marked this pull request as ready for review May 21, 2025 08:11
@Tohar-orca Tohar-orca merged commit 80ad2eb into main May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants