-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from Skyscanner/load_rules_config_file
- Loading branch information
Showing
9 changed files
with
135 additions
and
6 deletions.
There are no files selected for viewing
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 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 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 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 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 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 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
19 changes: 19 additions & 0 deletions
19
tests/test_files/config/rules_config_CrossAccountTrustRule.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from cfripper.config.filter import Filter | ||
from cfripper.config.rule_config import RuleConfig | ||
from cfripper.model.enums import RuleMode | ||
|
||
RULES_CONFIG = { | ||
"CrossAccountTrustRule": RuleConfig( | ||
filters=[ | ||
Filter( | ||
rule_mode=RuleMode.WHITELISTED, | ||
eval={ | ||
"and": [ | ||
{"eq": [{"ref": "config.stack_name"}, "mockstack"]}, | ||
{"eq": [{"ref": "logical_id"}, "RootRoleOne"]}, | ||
] | ||
}, | ||
) | ||
], | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from cfripper.config.filter import Filter | ||
from cfripper.config.rule_config import RuleConfig | ||
from cfripper.model.enums import RuleMode | ||
|
||
# RULES_CONFIG is here a list of RuleConfig instead of a dict with the rule names as keys | ||
RULES_CONFIG = [ | ||
RuleConfig( | ||
filters=[ | ||
Filter( | ||
rule_mode=RuleMode.WHITELISTED, | ||
eval={ | ||
"and": [ | ||
{"eq": [{"ref": "config.stack_name"}, "mockstack"]}, | ||
{"eq": [{"ref": "logical_id"}, "RootRoleOne"]}, | ||
] | ||
}, | ||
) | ||
], | ||
) | ||
] |