From 0e84d94844d0d169f5196d1030d280d009f11295 Mon Sep 17 00:00:00 2001 From: Nick <49166439+nhakmiller@users.noreply.github.com> Date: Fri, 24 Jul 2020 10:57:12 -0700 Subject: [PATCH] add support for destination overrides (#36) --- panther_analysis_tool/main.py | 5 +++-- panther_analysis_tool/schemas.py | 2 ++ tests/fixtures/valid_analysis/policies/example_policy.yml | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/panther_analysis_tool/main.py b/panther_analysis_tool/main.py index 310cadf5..e6aea23a 100644 --- a/panther_analysis_tool/main.py +++ b/panther_analysis_tool/main.py @@ -47,7 +47,8 @@ class TestCase(): def __init__(self, data: Dict[str, Any]) -> None: """ Args: - data (Dict[str, Any]): An AWS Resource representation or Log event to test the policy or rule against respectively. + data (Dict[str, Any]): An AWS Resource representation or Log event to test the policy + or rule against respectively. """ self._data = data @@ -307,7 +308,7 @@ def test_analysis(args: argparse.Namespace) -> Tuple[int, list]: return int(bool(failed_tests or invalid_specs)), invalid_specs -def print_summary(test_path: str, num_tests: int, failed_tests: List[Any], +def print_summary(test_path: str, num_tests: int, failed_tests: Dict[str, list], invalid_specs: List[Any]) -> None: '''Print a summary of passed, failed, and invalid specs''' print('--------------------------') diff --git a/panther_analysis_tool/schemas.py b/panther_analysis_tool/schemas.py index 04689649..baccab4e 100644 --- a/panther_analysis_tool/schemas.py +++ b/panther_analysis_tool/schemas.py @@ -54,6 +54,7 @@ str, Optional('DisplayName'): str, + Optional('OutputIds'): [str], Optional('Reference'): str, Optional('Runbook'): @@ -92,6 +93,7 @@ int, Optional('DisplayName'): str, + Optional('OutputIds'): [str], Optional('Reference'): str, Optional('Runbook'): diff --git a/tests/fixtures/valid_analysis/policies/example_policy.yml b/tests/fixtures/valid_analysis/policies/example_policy.yml index 17221fc5..27dda149 100644 --- a/tests/fixtures/valid_analysis/policies/example_policy.yml +++ b/tests/fixtures/valid_analysis/policies/example_policy.yml @@ -4,6 +4,8 @@ DisplayName: MFA Is Enabled For User Description: MFA is a security best practice that adds an extra layer of protection for your AWS account logins. Severity: Critical PolicyID: AWS.IAM.MFAEnabled +OutputIds: + - 00000-01-00000 Enabled: true ResourceTypes: - AWS.IAM.RootUser.Snapshot