-
Notifications
You must be signed in to change notification settings - Fork 221
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
Perform detailed code review of AAD Rego policies that check conditional access #1184
Comments
Conditional Access Policies which need to be updatedGeneral notes for the updates needed are to use PolicyConditionsMatch more for consistency and prevent code repetition. MS.AAD.1.1v1Similar to 3.7, currently 1.1 checks if Exchange ActiveSync clients and Other clients are clicked, but doesn't check to ensure that those two are the only boxes checked. MS.AAD.2.3v1For consistency update line 141 from MS.AAD.3.1v1Check if we can use PolicyConditionsMatch rather than the 3 lines (183-185) used together
with MS.AAD.3.2v1For consistency update line 221 from MS.AAD.3.6v1Missing check for Target resources > Cloud apps > All cloud apps MS.AAD.3.8v1Use 3.7 as a model for this one as they are very similar
|
@tkol2022 @Sloane4 @mitchelbaker-cisa |
Nice job! Here are my comments.
|
Created issue #1323 and updated the comment with your suggestions, if there isn't anything else I will be closing this issue |
Thanks for the final updates. |
💡 Summary
Recently we identified that a couple of the AAD Rego rulesets dealing with AAD conditional access, do not check that the tenant policies were configured exactly as specified in the baseline document instructions. The purpose of this issue is to review the code for all the Rego rulesets that examine conditional access to ensure they are coded consistent with each of the configuration characteristics described the baseline implementation instructions.
Example policy 3.7
This describes a problem that was found with AAD Rego policy 3.7. In the baseline document instructions the following three characteristics of the Access controls > Grant > Grant Access configuration of the conditional access policy are described. Before it was fixed, in some cases 3.7 could have been configured incorrectly in the tenant but still pass the ScubaGear check.
The original Rego code examined if the user ticked the box Require device to be marked as compliant or if they ticked the box Require Microsoft Entra hybrid joined device but nothing else. It did not check if the box Require one of the selected controls was checked and it did not check if the user checked any irrelevant boxes such as Example terms of us (which would fundamentally change the way the access policy is applied). In this context, Example terms of us should not be checked and the code should validate that.
Because of the original code flaw, the non compliant configuration in the screenshot below would Pass in ScubaGear.
Implementation notes
Perform a review of the Rego policies related to conditional access as describe above. Helper rulesets are within the scope of this review.
Review the pull request linked here for a reference of how the code flaw described above for 3.7 was corrected.
For any Rego policies identified as needed an update, examine the respective unit tests and functional tests to determine if any new tests (or updates to existing tests) are needed to exercise additional logic paths.
Create new coding issues to rectify any problems found
The text was updated successfully, but these errors were encountered: