Skip to content

Commit

Permalink
Update RuleConfig documentation (#216)
Browse files Browse the repository at this point in the history
* update config documentation

* update version, requirements and changelog

* fix format

* fix merge with master

Co-authored-by: Ramon <ramon.guimera@skyscanner.net>
  • Loading branch information
w0rmr1d3r and Ramon committed Apr 1, 2022
1 parent 59bfb22 commit d442689
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ All notable changes to this project will be documented in this file.
- Add support to `EC2SecurityGroupOpenToWorldRule` for use cases where ports are not defined in the CloudFormation template. By default, this means all ports are included.
### Updates
- Updated `EBSVolumeHasSSERule` to iterate only over `AWS::EC2::Volume` resources.
- Update `RuleConfig` documentation.
### Improvements
- Bump `pycfmodel` to `0.18.0`.

## [1.7.0]
### Updates
Expand Down
10 changes: 10 additions & 0 deletions cfripper/config/rule_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,15 @@


class RuleConfig(BaseModel):
"""
Allows to overwrite the default behaviour of the rule, such as changing the rule mode and risk value.
Although this config has `None` as default values, `Rule` will use the following values as
default if no config is given.
```
RULE_MODE = RuleMode.BLOCKING
RISK_VALUE = RuleRisk.MEDIUM
```
"""

rule_mode: Optional[RuleMode] = None
risk_value: Optional[RuleRisk] = None
7 changes: 6 additions & 1 deletion docs/rule_config_and_filters.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Rule Config
Allows to overwrite the default behaviour of the rule, such as changing the rule mode and risk value.
Although this config has `None` as default values, `Rule` will use the following values as default if no config is given.
```python3
RULE_MODE = RuleMode.BLOCKING
RISK_VALUE = RuleRisk.MEDIUM
```

{{ inline_source('cfripper.config.rule_config.RuleConfig') }}

Expand Down Expand Up @@ -65,4 +70,4 @@ Filter(
rules={"TestRule"},
debug=True
)
```
```

0 comments on commit d442689

Please sign in to comment.