cisagov / ScubaGear

Automation to assess the state of your M365 tenant against CISA's baselines
https://www.cisa.gov/resources-tools/services/secure-cloud-business-applications-scuba-project
Creative Commons Zero v1.0 Universal
1.65k stars 221 forks source link

Enhance AAD Functional Testplans to use configuration file inputs #836

Open crutchfield opened 9 months ago

crutchfield commented 9 months ago

💡 Summary

Enhance AAD Functional Testplans to use configuration file inputs. Many test cases are using RunCached driver but do not include test paths that would be transversed if configuration data (e.g., MS.AAD.7.4v1 RoleExclusion) was provided.

Motivation and context

This would be useful because it will provide more comprehensive testing.

Implementation notes

Please provide details for implementation, such as:

Acceptance criteria

How do we know when this work is done?

tkol2022 commented 6 months ago

Upon review of the Rego code for the policies that reference the config file (there are numerous), it seems that all we might need to do is add functional test cases that modify the input.scuba_config part of the JSON. I don't think we need to read a config file. The capability to modify the JSON is already present since all of the AAD test cases do that. See two of the Rego policies that take exclusion inputs below:

7.4 count({y | some y in input.scuba_config.Aad[PolicyID].RoleExclusions.Users; y != null}) == 0

1.1 ExemptedUsers := input.scuba_config.Aad[PolicyID].CapExclusions.Users

Below is an example of how we might craft functional test cases that include exclusions:

image