Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIM RoleEligibilitySchedule is ignored if RoleEligibilityScheduleRequest is missing. #901

Closed
borondy opened this issue Oct 16, 2024 · 0 comments · Fixed by #902
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@borondy
Copy link
Contributor

borondy commented Oct 16, 2024

Describe the solution you'd like
PIM Eligibility assignments for a specific resource or scope is stored as Role Eligibility Schedules. Adding/removing/updating a Role Eligibility Schedule requires a RoleEligibilityScheduleRequest, which is also used for activating an eligible role assignment.

The function Get-AzOpsRoleEligibilityScheduleRequest starts by getting all RoleEligibilitySchedules for the specified scope and for each RoleEligibilitySchedule it then tries to get the RoleEligibilityScheduleRequest that was used to add the RoleEligibilitySchedule in order to create the RoleEligibilityScheduleRequest ARM template that is needed deploy the RoleEligibilitySchedule. So basically the RoleEligibilityScheduleRequest deployment template JSON file is created instead of RoleEligibilitySchedule JSON files since the resourcetype "Microsoft.Authorization/RoleEligibilitySchedules" doesn't have a Create API operation.

We noticed that PIM eligible assingments that are older than 30~40 days was ignored when doing Invoke-AzOpsPull because the RoleEligibilityScheduleRequest no longer exists. Recently deployed PIM eligible assignments were pulled but not older ones. Since RoleEligibilityScheduleRequests are created every time a role is Activated/Added/Removed/Updated the most logic thing is that Microsoft removes RoleEligibilityScheduleRequest after a specific time from creation.

In order to be able to update the Role Eligibility Schedule trough AzOps, we need to have RoleEligibilityScheduleRequest templates in the state repository even if the RoleEligibilityScheduleRequest resource does not exist in Azure anymore.

@Jefajers Jefajers added bug Something isn't working and removed triage labels Dec 2, 2024
@Jefajers Jefajers added this to AzOps Dec 2, 2024
@Jefajers Jefajers moved this to In progress in AzOps Dec 2, 2024
@Jefajers Jefajers added this to the v2.6.6 milestone Dec 2, 2024
@Jefajers Jefajers moved this from In progress to Pending release in AzOps Dec 11, 2024
@Jefajers Jefajers linked a pull request Dec 12, 2024 that will close this issue
5 tasks
@Jefajers Jefajers moved this from Pending release to Done in AzOps Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants