-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* check return is non-None for dedup/title methods * add passing and failed tests for dedup/title non-None check * update key name; added clarifying comment * Update tests/fixtures/example_rule_missing_field.yml convert to all yaml Co-authored-by: Austin Byers <austin.byers@runpanther.io> * fixing format/adding newline to end of tile * fixing lint error * update comment; fix key name Co-authored-by: Austin Byers <austin.byers@runpanther.io>
- Loading branch information
Showing
5 changed files
with
99 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from panther import test_helper # pylint: disable=import-error | ||
|
||
IGNORED_USERS = {} | ||
|
||
|
||
def rule(event): | ||
if event['UserName'] in IGNORED_USERS: | ||
return False | ||
|
||
cred_report = event.get('CredentialReport', {}) | ||
if not cred_report: | ||
return True | ||
|
||
return (test_helper() and | ||
cred_report.get('PasswordEnabled', False) and | ||
cred_report.get('MfaActive', False)) | ||
|
||
def dedup(event): | ||
return None | ||
|
||
def title(event): | ||
return '{} does not have MFA enabled'.format(event['UserName']) |
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,31 @@ | ||
AnalysisType: rule | ||
Filename: example_rule.py | ||
DisplayName: MFA Rule | ||
Description: MFA is a security best practice that adds an extra layer of protection for your AWS account logins. | ||
Severity: Critical | ||
Threshold: 5 | ||
RuleID: AWS.CloudTrail.MFAEnabled | ||
Enabled: true | ||
SummaryAttributes: | ||
- p_log_type | ||
- p_any_ip_addresses | ||
LogTypes: | ||
- AWS.CloudTrail | ||
Tags: | ||
- AWS Managed Rules - Security, Identity & Compliance | ||
- AWS | ||
- CIS | ||
- SOC2 | ||
Runbook: > | ||
Find out who disabled MFA on the account. | ||
Reference: https://www.link-to-info.io | ||
Tests: | ||
- | ||
Name: User MFA enabled passes compliance but fails dedup check. | ||
ExpectedResult: true | ||
Log: | ||
Arn: arn:aws:iam::123456789012:user/test | ||
CreateDate: '2019-01-01T00:00:00' | ||
CredentialReport: | ||
MfaActive: true | ||
PasswordEnabled: true |
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