You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This enables policy templates to use a custom template for meta parent policy generation. To make use of this new functionality, place a .pt.template file in the same directory as the child policy template and put the name of the file in the meta_template field in the info block. For example:
This will cause the automation that generates meta parent policy templates to use the specified template instead of the default one. The intended use-case here is for policy templates where simply combining incidents results in undesired behavior. An example is with the other change made with this PR.
Tag Cardinality Report Meta Parent Fix
When combining incidents from child policy templates, the meta parent for the Tag Cardinality Report policy templates would list the same key multiple times if it appears in multiple cloud accounts. As a result, it was not actually correctly reporting cardinality and was instead reporting per-account cardinality.
Using the functionality above, these policies now have custom meta parent templates with additional logic to properly combine the incidents into a single, correct cardinality report.
Issues Resolved
In addition to the above, this fixes an issue where the publish flag was incorrectly being used to determine the deprecated flag in meta parent policies. This flag is now correctly aligned with the deprecated flag in the child policy.
Link to Example Applied Policy
Contribution Check List
New functionality includes testing.
New functionality has been documented in the README if applicable
New functionality has been documented in CHANGELOG.MD
Policy template updated but associated README.md file has not been. Please verify that any necessary changes have been made to the README.
1 Message
📖
Github Pull Request
Pull Request is missing READY-FOR-REVIEW label. Please add this label if this Pull Request is ready for review.
Please note that this message may be a false positive if you've added the label after Dangerfile tests were run, since adding labels does not trigger them to run again. In these cases, simply ignore this message.
XOmniverse
changed the title
POL-1307 Custom Meta Parent Templates / AWS Tag Cardinality Report Fix
POL-1307 Custom Meta Parent Templates / Tag Cardinality Report Fix
Aug 15, 2024
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Meta Parent Custom Templates
This enables policy templates to use a custom template for meta parent policy generation. To make use of this new functionality, place a
.pt.template
file in the same directory as the child policy template and put the name of the file in themeta_template
field in the info block. For example:This will cause the automation that generates meta parent policy templates to use the specified template instead of the default one. The intended use-case here is for policy templates where simply combining incidents results in undesired behavior. An example is with the other change made with this PR.
Tag Cardinality Report Meta Parent Fix
When combining incidents from child policy templates, the meta parent for the Tag Cardinality Report policy templates would list the same key multiple times if it appears in multiple cloud accounts. As a result, it was not actually correctly reporting cardinality and was instead reporting per-account cardinality.
Using the functionality above, these policies now have custom meta parent templates with additional logic to properly combine the incidents into a single, correct cardinality report.
Issues Resolved
In addition to the above, this fixes an issue where the publish flag was incorrectly being used to determine the deprecated flag in meta parent policies. This flag is now correctly aligned with the deprecated flag in the child policy.
Link to Example Applied Policy
Contribution Check List