forked from gane5hvarma/panther
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update lint-staged scripts * update lint-staged * force prettier to run against whole repo * add .prettierignore * add .idea to prettierignore * remove trailing slash * alter mage fmt to run prettier on entire project * prettier changes on yml files * update .prettierignore * Revert "prettier changes on yml files" This reverts commit 60a3dde. * ignore prettier for all /testdata/ * prettier changes
- Loading branch information
Aggelos Arvanitakis
authored
Mar 6, 2020
1 parent
2079427
commit e2dc727
Showing
6 changed files
with
124 additions
and
122 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# General | ||
.git | ||
.idea | ||
.setup | ||
keys | ||
|
||
# Deps | ||
venv | ||
node_modules | ||
|
||
# Service artifacts | ||
out | ||
|
||
# Web artifacts | ||
web/dist | ||
|
||
# Docs | ||
docs/gitbook | ||
|
||
|
||
# Direct file content assertion | ||
tools/**/testdata |
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
144 changes: 70 additions & 74 deletions
144
...mpliance/aws_event_processor/processor/example_events/cloudtrail_put_event_selectors.json
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,79 +1,75 @@ | ||
{ | ||
"eventVersion": "1.05", | ||
"userIdentity": { | ||
"type": "AssumedRole", | ||
"principalId": "AROA4PIQ2YYOGH2G27YIM:nicholas_hakmiller", | ||
"arn": "arn:aws:sts::857418155548:assumed-role/PantherDevNickAdministrator/nicholas_hakmiller", | ||
"eventVersion": "1.05", | ||
"userIdentity": { | ||
"type": "AssumedRole", | ||
"principalId": "AROA4PIQ2YYOGH2G27YIM:nicholas_hakmiller", | ||
"arn": "arn:aws:sts::857418155548:assumed-role/PantherDevNickAdministrator/nicholas_hakmiller", | ||
"accountId": "857418155548", | ||
"accessKeyId": "ASIA4PIQ2YYODXL3QAZ3", | ||
"sessionContext": { | ||
"sessionIssuer": { | ||
"type": "Role", | ||
"principalId": "AROA4PIQ2YYOGH2G27YIM", | ||
"arn": "arn:aws:iam::857418155548:role/PantherDevNickAdministrator", | ||
"accountId": "857418155548", | ||
"accessKeyId": "ASIA4PIQ2YYODXL3QAZ3", | ||
"sessionContext": { | ||
"sessionIssuer": { | ||
"type": "Role", | ||
"principalId": "AROA4PIQ2YYOGH2G27YIM", | ||
"arn": "arn:aws:iam::857418155548:role/PantherDevNickAdministrator", | ||
"accountId": "857418155548", | ||
"userName": "PantherDevNickAdministrator" | ||
}, | ||
"webIdFederationData": {}, | ||
"attributes": { | ||
"mfaAuthenticated": "true", | ||
"creationDate": "2019-08-27T20:07:51Z" | ||
} | ||
} | ||
}, | ||
"eventTime": "2019-08-27T20:27:51Z", | ||
"eventSource": "cloudtrail.amazonaws.com", | ||
"eventName": "PutEventSelectors", | ||
"awsRegion": "us-west-2", | ||
"sourceIPAddress": "71.198.154.250", | ||
"userAgent": "console.amazonaws.com", | ||
"requestParameters": { | ||
"trailName": "arn:aws:cloudtrail:us-west-2:857418155548:trail/cloudtrail-public-s3", | ||
"eventSelectors": [ | ||
{ | ||
"readWriteType": "ReadOnly", | ||
"includeManagementEvents": true, | ||
"dataResources": [] | ||
}, | ||
{ | ||
"readWriteType": "All", | ||
"includeManagementEvents": false, | ||
"dataResources": [ | ||
{ | ||
"type": "AWS::S3::Object", | ||
"values": [ | ||
"arn:aws:s3:::s3-polling-test-bucket/" | ||
] | ||
} | ||
] | ||
} | ||
"userName": "PantherDevNickAdministrator" | ||
}, | ||
"webIdFederationData": {}, | ||
"attributes": { | ||
"mfaAuthenticated": "true", | ||
"creationDate": "2019-08-27T20:07:51Z" | ||
} | ||
} | ||
}, | ||
"eventTime": "2019-08-27T20:27:51Z", | ||
"eventSource": "cloudtrail.amazonaws.com", | ||
"eventName": "PutEventSelectors", | ||
"awsRegion": "us-west-2", | ||
"sourceIPAddress": "71.198.154.250", | ||
"userAgent": "console.amazonaws.com", | ||
"requestParameters": { | ||
"trailName": "arn:aws:cloudtrail:us-west-2:857418155548:trail/cloudtrail-public-s3", | ||
"eventSelectors": [ | ||
{ | ||
"readWriteType": "ReadOnly", | ||
"includeManagementEvents": true, | ||
"dataResources": [] | ||
}, | ||
{ | ||
"readWriteType": "All", | ||
"includeManagementEvents": false, | ||
"dataResources": [ | ||
{ | ||
"type": "AWS::S3::Object", | ||
"values": ["arn:aws:s3:::s3-polling-test-bucket/"] | ||
} | ||
] | ||
}, | ||
"responseElements": { | ||
"trailARN": "arn:aws:cloudtrail:us-west-2:857418155548:trail/cloudtrail-public-s3", | ||
"eventSelectors": [ | ||
{ | ||
"readWriteType": "ReadOnly", | ||
"includeManagementEvents": true, | ||
"dataResources": [] | ||
}, | ||
{ | ||
"readWriteType": "All", | ||
"includeManagementEvents": false, | ||
"dataResources": [ | ||
{ | ||
"type": "AWS::S3::Object", | ||
"values": [ | ||
"arn:aws:s3:::s3-polling-test-bucket/" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"responseElements": { | ||
"trailARN": "arn:aws:cloudtrail:us-west-2:857418155548:trail/cloudtrail-public-s3", | ||
"eventSelectors": [ | ||
{ | ||
"readWriteType": "ReadOnly", | ||
"includeManagementEvents": true, | ||
"dataResources": [] | ||
}, | ||
{ | ||
"readWriteType": "All", | ||
"includeManagementEvents": false, | ||
"dataResources": [ | ||
{ | ||
"type": "AWS::S3::Object", | ||
"values": ["arn:aws:s3:::s3-polling-test-bucket/"] | ||
} | ||
] | ||
}, | ||
"requestID": "8c23b35f-befd-4bef-ada7-65979032e589", | ||
"eventID": "5ce81ddc-351e-4e5f-bbc6-75be5db63eed", | ||
"readOnly": false, | ||
"eventType": "AwsApiCall", | ||
"recipientAccountId": "857418155548" | ||
} | ||
] | ||
}, | ||
"requestID": "8c23b35f-befd-4bef-ada7-65979032e589", | ||
"eventID": "5ce81ddc-351e-4e5f-bbc6-75be5db63eed", | ||
"readOnly": false, | ||
"eventType": "AwsApiCall", | ||
"recipientAccountId": "857418155548" | ||
} |
50 changes: 24 additions & 26 deletions
50
internal/core/analysis_api/main/test_policies/always_true.json
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,28 +1,26 @@ | ||
{ | ||
"ActionDelaySeconds": 10, | ||
"AnalysisType": "policy", | ||
"AutoRemediationID": "fix-it", | ||
"AutoRemediationParameters": { | ||
"hello": "goodbye" | ||
}, | ||
"Description": "Matches every resource", | ||
"DisplayName": "AlwaysTrue", | ||
"Enabled": true, | ||
"Filename": "always_true.py", | ||
"PolicyID": "Test:Policy:JSON", | ||
"ResourceTypes": [ | ||
"AWS.S3.Bucket" | ||
], | ||
"Severity": "Medium", | ||
"Tags": [], | ||
"Tests": [ | ||
{ | ||
"ExpectedResult": true, | ||
"Name": "This will be True", | ||
"Resource": { | ||
"Bucket": "empty" | ||
}, | ||
"ResourceType": "AWS.S3.Bucket" | ||
} | ||
] | ||
"ActionDelaySeconds": 10, | ||
"AnalysisType": "policy", | ||
"AutoRemediationID": "fix-it", | ||
"AutoRemediationParameters": { | ||
"hello": "goodbye" | ||
}, | ||
"Description": "Matches every resource", | ||
"DisplayName": "AlwaysTrue", | ||
"Enabled": true, | ||
"Filename": "always_true.py", | ||
"PolicyID": "Test:Policy:JSON", | ||
"ResourceTypes": ["AWS.S3.Bucket"], | ||
"Severity": "Medium", | ||
"Tags": [], | ||
"Tests": [ | ||
{ | ||
"ExpectedResult": true, | ||
"Name": "This will be True", | ||
"Resource": { | ||
"Bucket": "empty" | ||
}, | ||
"ResourceType": "AWS.S3.Bucket" | ||
} | ||
] | ||
} |
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