Fix incorrect fields in detection AdminPromoAfterRoleMgmtAppPermissionGrant.yaml
Required items, please complete
Change(s):
- Use distinct query_frequency and query_period parameters.
- Interchange left and right join sides.
- Use join kind inner instead of innerunique.
- Parse
ServicePrincipal.ObjectIDby name instead of positionmodifiedProperties[3]. - Remove the
AADOperationType == "AssignEligibleRole". - Take into account any
"RoleManagement"and"Assign"operation.
Reason for Change(s):
- If the permission grant operation happened 2h10m before the query execution, and the role assignment operation happened 1h50m before the query execution, this detection would have not triggered any alert, thus the detection was not working in some cases.
- This detection should trigger only if a
"RoleManagement"and"Assign"operation happens, it should be the first thing to check as it has the lower timescope. -
inneruniquekind deduplicates left side instead of the right side, so there could have been (very improbable) cases were the conditionTimeRoleMgGrant < TimeAdminPromodoes not evaluate totrue, thus the detection was not working in some cases. - Not every event or environment has
ServicePrincipal.ObjectIDin position 3 ofmodifiedProperties, thus the detection was not working in some cases. - Operation
Add eligible member to roleinCore DirectoryhasAADOperationType == "Assign", not"AssignEligibleRole". - Custom role definition assignments could be considered by this detection too if the custom role contains
Admin.
Version Updated:
- Yes
Testing Completed:
- Need help, because I don't have available events of this privilege escalation. I have tried this query by adding some columns so the join works.
Checked that the validations are passing and have addressed any issues that are present:
- Yes
@aprakash13 : Please review the Analytics and provide your feedback. Thanks!
Hi @devikamehra, Can you please review and share your feedback. Thanks
Reached out to Roberto to review this PR.
Waiting for Roberto' s feedback. Thanks.
Waiting for Roberto' s feedback. Thanks
Hi @devikamehra, can you please review and share your feedback. Thanks
Hi @aprakash13 we still waiting for Roberto' s feedback. Thanks
Hi @aprakash13 we still waiting for Roberto' s feedback. Thanks
Hi @aprakash13 we still waiting for Roberto' s feedback. Thanks
Hi @aprakash13, waiting for Roberto' s feedback. Thanks
Hi @aprakash13, please review this long pending PR. Thanks
Hi @devikamehra @rushriva @vakohl, can you please look into this long pending PR. Thanks.
Hi @devikamehra @rushriva @vakohl, could you please review this PR and provide your comments. Thanks
Hi @devikamehra @rushriva @vakohl, can you please look into this long pending PR. Thanks.
Hi @devikamehra @rushriva @vakohl, could you please review this PR and provide your comments. Thanks
Hi @devikamehra @rushriva @vakohl, can you please look into this long pending PR. Thanks.
Hi @devikamehra @rushriva @vakohl, could you please review this PR and provide your comments. Thanks
@v-atulyadav We are working on improving the code of this query and the interpretation of the query made by PR author doesn't seems to be correct.
Please, could I know what doesn't seem to be correct?
Would you prefer the alternate order of the join sides?
Hi @devikamehra, please respond on @ep3p's comment. Thanks
I have reviewed the query for correctness but please note, the author is already working to improve the query and thus this version might not get merged. Also, why do we require to change the order of join?
@devikamehra thank you very much.
The order of the join is not strictly required to be changed, but, if one side is going to check 1h of events and the other side is going to check 2h of events, AND the join type is inner; then, it is more efficient to check first the side that has 1h of events.
I am okay if this version does not get merged, as long as the improvements get passed.
I will alternate the order of the join sides, for clarity.
Hi @devikamehra, please provide your feedback as @ep3p has made some changes. Thanks
Hi @devikamehra, could you please provide your feedback. Thanks
@v-atulyadav The author is already working on this and thus we would have to wait.
Hi @ep3p, waiting for your response. Thanks
Hi @ep3p, waiting for your response. Thanks
@v-atulyadav by author they must mean Roberto haha I am not the original author of this detection. This PR version might not get merged.
Hi @ep3p, waiting for your response. Thanks
@v-atulyadav by author they must mean Roberto haha I am not the original author of this detection. This PR version might not get merged.
@ep3p, we would like to know if this PR is needed in that case since you mentioned it might not get merged. In that case, we can close it if no longer needed. Thanks!
Hi @ep3p, waiting for your response. Thanks
@v-atulyadav by author they must mean Roberto haha I am not the original author of this detection. This PR version might not get merged.
@ep3p, we would like to know if this PR is needed in that case since you mentioned it might not get merged. In that case, we can close it if no longer needed. Thanks!
@v-dvedak Please, I am not the one who initially said it might not get merged, it was @devikamehra
I personally consider this detection needs a change. I will not be the one who has to decide if that change will come by this PR or another.
Hi @ep3p, would it be possible to mark this PR as a draft until we hear from the author?. Thanks.