Allow `ScanExecutionPolicyResolver` to resolve group-level policies
Why are we doing this work
As part of the implementation for Group-level security policies (&4425 (closed)), we need to update ScanExecutionPolicyResolver to be able to return group-level security policies.
Relevant links
Non-functional requirements
-
Documentation: -
Feature flag: -
Performance: -
Testing:
Implementation plan
- Add a new scope to
OrchestrationPolicyConfigurationwhich will query all the policy configurations bynamespace.self_and_ancestors. - Create a new
PolicyFinderwhich will query all of the policy configurations, get all of their policies, and then merge them together. - Add a new
relationshipparameter to thescanExecutionPoliciesgraphql query which can have the valuesDIRECTorINHERITED.DIRECTwill be the default and will return policies belonging to the project only (current behavior).INHERITEDwill return the project's policies as well as the ancestor's policies. (This prevents breaking changes to facilitate Zero-downtime upgrades.)