-
Notifications
You must be signed in to change notification settings - Fork 334
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 #624 from airbnb/jacknaglieri-req-subkeys-fix
Required Sub-key Bug Fix, Community Rules Update, and More
- Loading branch information
Showing
29 changed files
with
147 additions
and
165 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
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
14 changes: 5 additions & 9 deletions
14
rules/community/duo_administrator/duo_bypass_code_create_non_auto_generated.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 |
---|---|---|
@@ -1,20 +1,16 @@ | ||
"""Alert when a DUO bypass code is artisanly crafted and not auto-generated.""" | ||
import json | ||
from helpers.base import safe_json_loads | ||
from stream_alert.rule_processor.rules_engine import StreamRules | ||
|
||
rule = StreamRules.rule | ||
|
||
@rule(logs=['duo:administrator'], | ||
outputs=['aws-s3:sample-bucket', | ||
'pagerduty:sample-integration', | ||
'slack:sample-channel']) | ||
|
||
@rule(logs=['duo:administrator'], outputs=['aws-firehose:alerts']) | ||
def duo_bypass_code_create_non_auto_generated(rec): | ||
""" | ||
author: @mimeframe | ||
description: Alert when a DUO bypass code is artisanly crafted and not auto-generated. | ||
reference: https://duo.com/docs/administration-users#generating-a-bypass-code | ||
""" | ||
return ( | ||
rec['action'] == 'bypass_create' and | ||
json.loads(rec['description']).get('auto_generated') is False | ||
) | ||
return (rec['action'] == 'bypass_create' | ||
and safe_json_loads(rec['description']).get('auto_generated') is False) |
14 changes: 5 additions & 9 deletions
14
rules/community/duo_administrator/duo_bypass_code_create_non_expiring.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 |
---|---|---|
@@ -1,20 +1,16 @@ | ||
"""Alert when a DUO bypass code is created that is non-expiring.""" | ||
import json | ||
from helpers.base import safe_json_loads | ||
from stream_alert.rule_processor.rules_engine import StreamRules | ||
|
||
rule = StreamRules.rule | ||
|
||
@rule(logs=['duo:administrator'], | ||
outputs=['aws-s3:sample-bucket', | ||
'pagerduty:sample-integration', | ||
'slack:sample-channel']) | ||
|
||
@rule(logs=['duo:administrator'], outputs=['aws-firehose:alerts']) | ||
def duo_bypass_code_create_non_expiring(rec): | ||
""" | ||
author: @mimeframe | ||
description: Alert when a DUO bypass code is created that is non-expiring. | ||
reference: https://duo.com/docs/administration-users#generating-a-bypass-code | ||
""" | ||
return ( | ||
rec['action'] == 'bypass_create' and | ||
json.loads(rec['description']).get('valid_secs') is None | ||
) | ||
return (rec['action'] == 'bypass_create' | ||
and safe_json_loads(rec['description']).get('valid_secs') is None) |
14 changes: 5 additions & 9 deletions
14
rules/community/duo_administrator/duo_bypass_code_create_unlimited_use.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 |
---|---|---|
@@ -1,20 +1,16 @@ | ||
"""Alert when a DUO bypass code is created that has unlimited use.""" | ||
import json | ||
from helpers.base import safe_json_loads | ||
from stream_alert.rule_processor.rules_engine import StreamRules | ||
|
||
rule = StreamRules.rule | ||
|
||
@rule(logs=['duo:administrator'], | ||
outputs=['aws-s3:sample-bucket', | ||
'pagerduty:sample-integration', | ||
'slack:sample-channel']) | ||
|
||
@rule(logs=['duo:administrator'], outputs=['aws-firehose:alerts']) | ||
def duo_bypass_code_create_unlimited_use(rec): | ||
""" | ||
author: @mimeframe | ||
description: Alert when a DUO bypass code is created that has unlimited use. | ||
reference: https://duo.com/docs/administration-users#generating-a-bypass-code | ||
""" | ||
return ( | ||
rec['action'] == 'bypass_create' and | ||
json.loads(rec['description']).get('remaining_uses') is None | ||
) | ||
return (rec['action'] == 'bypass_create' | ||
and safe_json_loads(rec['description']).get('remaining_uses') is None) |
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
Oops, something went wrong.