mirror of
https://github.com/awslabs/iam-policy-autopilot.git
synced 2026-04-26 00:15:57 +03:00
[PR #84] [MERGED] feat: add --explain #229
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/iam-policy-autopilot#229
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/awslabs/iam-policy-autopilot/pull/84
Author: @mschlaipfer
Created: 12/17/2025
Status: ✅ Merged
Merged: 1/15/2026
Merged by: @mschlaipfer
Base:
main← Head:feat-explain📝 Commits (10+)
55776b2feat: add--explain33fae3bfeat: refactor based on PR comments07e2bb9refactor: refactor Locationfc36e6dRefactor resource_matcher and operation4cf972eOutput explanation documentationf59160fcargo fmt645cdbfDocumentation comments and minor refactoringe098cddUpdate changeloged39391Remove FasExpansionBuilderdbea148Custom PartialEq, Hash for Operation to fix test📊 Changes
38 files changed (+2700 additions, -1580 deletions)
View changed files
📝
CHANGELOG.md(+6 -0)📝
Cargo.toml(+2 -1)📝
iam-policy-autopilot-cli/src/main.rs(+20 -32)📝
iam-policy-autopilot-cli/src/output.rs(+6 -54)📝
iam-policy-autopilot-mcp-server/src/tools/generate_policy.rs(+20 -14)📝
iam-policy-autopilot-policy-generation/Cargo.toml(+1 -0)📝
iam-policy-autopilot-policy-generation/src/api/generate_policies.rs(+23 -30)📝
iam-policy-autopilot-policy-generation/src/api/model.rs(+17 -5)📝
iam-policy-autopilot-policy-generation/src/enrichment/mod.rs(+647 -15)📝
iam-policy-autopilot-policy-generation/src/enrichment/operation_fas_map.rs(+6 -49)📝
iam-policy-autopilot-policy-generation/src/enrichment/resource_matcher.rs(+373 -371)📝
iam-policy-autopilot-policy-generation/src/extraction/engine.rs(+1 -1)📝
iam-policy-autopilot-policy-generation/src/extraction/extractor.rs(+7 -20)📝
iam-policy-autopilot-policy-generation/src/extraction/go/disambiguation.rs(+22 -20)📝
iam-policy-autopilot-policy-generation/src/extraction/go/extractor.rs(+63 -33)📝
iam-policy-autopilot-policy-generation/src/extraction/go/features_extractor.rs(+25 -24)📝
iam-policy-autopilot-policy-generation/src/extraction/go/paginator_extractor.rs(+41 -41)📝
iam-policy-autopilot-policy-generation/src/extraction/go/waiter_extractor.rs(+105 -70)📝
iam-policy-autopilot-policy-generation/src/extraction/javascript/argument_extractor.rs(+4 -2)📝
iam-policy-autopilot-policy-generation/src/extraction/javascript/extractor.rs(+18 -8)...and 18 more files
📄 Description
Issue #, if available:
Description of changes: This PR adds an experimental explanation feature to the CLI (
--explain) which, for every action in the generated policy, provides a reason for why it has been added, including the expression and code location where IPA found an AWS operation call that led to its inclusion. It also provides information about FAS expansion, if it occurred.We believe that this feature, together with
--service-hints, will help creating policies with fewer unwanted permissions.Example:
This PR adds file and raw expression information and expands location information in multiple places throughout the extraction phase so this data is available in the
SdkMethodCall. There is currently a lot of code duplication, which I have not cleaned up as part of this pull request. See https://github.com/awslabs/iam-policy-autopilot/issues/88.During enrichment it adds the FAS expansion information. The location format follows the one here. It is clickable, so it navigates to the location in VS Code (I have not tested with other editors).
This PR removes the (hidden)
--show-action-mappingscommand which had a similar purpose, but did not support location, expression, or FAS information.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.