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

Refactor rego for each baseline to include detailed message in report #90

Closed
10 tasks done
amart241 opened this issue Dec 7, 2023 · 2 comments
Closed
10 tasks done
Labels
enhancement epic A high-level objective issue encompassing multiple issues instead of a specific unit of work Medium
Milestone

Comments

@amart241
Copy link
Collaborator

amart241 commented Dec 7, 2023

As part of implementing the Multiple OU's use case for each of the baseline, the earlier implemented detailed report messages will get replaced by a more generic message on whether the baseline policy is complaint in all the OU's or not.

Since the detailed report message is similar to the report details on M365 and was added as per request (on the M365 side), this may be something we may need to revisit and implement on the GWS side as well.

To be able to re-use the existing detailed message from each baseline, this issue will serve as an epic for each of the issues/baseline.

In each of these issues, you may find the obsolete code with the detailed report messages that can be re-used whenever this feature is added to the code base.

@buidav buidav added this to the Backlog milestone Dec 8, 2023
@adhilto
Copy link
Collaborator

adhilto commented Feb 5, 2024

Documenting the approach I used on #176:

  1. I created a new function in the Utils file ReportDetails. Because it's in the Utils file, when implementing this change for other baselines, there won't be any need to implement this again.
  2. For each control:
    a. Determine an appropriate SettingDescription for the setting in question
    b. Determine if the LastEvent.NewValue value is user-friendly; if not, create a GetFriendlyValuex_x function that translates the values to user-friendly strings (see Add Detailed Report Messages to Chat #176 for examples)
    c. Refactor the NonCompliantOUsx_x rule so that it includes both "Name" and "Value" keys
    d. Change the ReportDetailsOUs call to ReportDetails (include the SettingDescription from step a)
    e. Test and ensure it works as expected
    f. Update the unit tests to reflect the change

Scenarios that aren't covered by the above workflow:

  • Handling settings that aren't controlled at the OU level
  • Controls that depend on multiple settings

@adhilto
Copy link
Collaborator

adhilto commented Feb 16, 2024

See #204 for how this would look post group bug fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement epic A high-level objective issue encompassing multiple issues instead of a specific unit of work Medium
Projects
None yet
Development

No branches or pull requests

4 participants