Skip to content

Commit

Permalink
Merge pull request #214 from JupiterOne/add-ignorePreviousResults-flag
Browse files Browse the repository at this point in the history
Add ignore previous results flag to rule
  • Loading branch information
jzolo22 authored Aug 22, 2024
2 parents 8bc435b + 78db647 commit b92fe3e
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 57 deletions.
58 changes: 29 additions & 29 deletions jupiterone/cassettes/TestInlineRuleInstance_Basic.yaml

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions jupiterone/cassettes/TestInlineRuleInstance_BasicImport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ interactions:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 995
content_length: 1044
transfer_encoding: []
trailer: {}
host: graphql.us.jupiterone.io
remote_addr: ""
request_uri: ""
body: '{"query":"\nmutation CreateInlineQuestionRuleInstance ($instance: CreateInlineQuestionRuleInstanceInput!) {\n\tcreateQuestionRuleInstance: createInlineQuestionRuleInstance(instance: $instance) {\n\t\tid\n\t\tversion\n\t\tspecVersion\n\t\tquestion {\n\t\t\tqueries {\n\t\t\t\tname\n\t\t\t\tquery\n\t\t\t\tversion\n\t\t\t\tincludeDeleted\n\t\t\t}\n\t\t}\n\t\toperations {\n\t\t\twhen\n\t\t\tactions\n\t\t}\n\t}\n}\n","variables":{"instance":{"question":{"queries":[{"query":"Find DataStore with classification=(''critical'' or ''sensitive'' or ''confidential'' or ''restricted'') and encrypted!=true","name":"query0","version":"v1","includeDeleted":false}]},"templates":null,"tags":["tf_acc:1","tf_acc:2"],"name":"tf-provider-test-rule","description":"test","specVersion":1,"operations":[],"outputs":["queries.query0.total","alertLevel"],"pollingInterval":"ONE_DAY","notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"remediationSteps":""}},"operationName":"CreateInlineQuestionRuleInstance"}'
body: '{"query":"\nmutation CreateInlineQuestionRuleInstance ($instance: CreateInlineQuestionRuleInstanceInput!) {\n\tcreateQuestionRuleInstance: createInlineQuestionRuleInstance(instance: $instance) {\n\t\tid\n\t\tversion\n\t\tspecVersion\n\t\tquestion {\n\t\t\tqueries {\n\t\t\t\tname\n\t\t\t\tquery\n\t\t\t\tversion\n\t\t\t\tincludeDeleted\n\t\t\t}\n\t\t}\n\t\toperations {\n\t\t\twhen\n\t\t\tactions\n\t\t}\n\t}\n}\n","variables":{"instance":{"question":{"queries":[{"query":"Find DataStore with classification=(''critical'' or ''sensitive'' or ''confidential'' or ''restricted'') and encrypted!=true","name":"query0","version":"v1","includeDeleted":false}]},"templates":null,"tags":["tf_acc:1","tf_acc:2"],"name":"tf-provider-test-rule","description":"test","specVersion":1,"operations":[],"outputs":["queries.query0.total","alertLevel"],"pollingInterval":"ONE_DAY","notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"ignorePreviousResults":false,"remediationSteps":"","j1Internal":false}},"operationName":"CreateInlineQuestionRuleInstance"}'
form: {}
headers:
Cache-Control:
Expand All @@ -30,7 +30,7 @@ interactions:
content_length: 338
uncompressed: false
body: |
{"data":{"createQuestionRuleInstance":{"id":"df1ddec6-838f-4065-b6eb-2ecd51de58f1","version":1,"specVersion":1,"question":{"queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false}]},"operations":[]}}}
{"data":{"createQuestionRuleInstance":{"id":"c8649b0d-362d-4246-ba79-1d54b1e13cba","version":1,"specVersion":1,"question":{"queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false}]},"operations":[]}}}
headers:
Access-Control-Allow-Credentials:
- "true"
Expand Down Expand Up @@ -78,19 +78,19 @@ interactions:
- "0"
status: 200 OK
code: 200
duration: 1.3022135s
duration: 683.644792ms
- id: 1
request:
proto: HTTP/1.1
proto_major: 1
proto_minor: 1
content_length: 605
content_length: 632
transfer_encoding: []
trailer: {}
host: graphql.us.jupiterone.io
remote_addr: ""
request_uri: ""
body: '{"query":"\nquery GetQuestionRuleInstance ($id: ID!) {\n\tquestionRuleInstance(id: $id) {\n\t\tid\n\t\tname\n\t\tdescription\n\t\tversion\n\t\tspecVersion\n\t\tlatest\n\t\tpollingInterval\n\t\tdeleted\n\t\ttype\n\t\ttemplates\n\t\tnotifyOnFailure\n\t\ttriggerActionsOnNewEntitiesOnly\n\t\tquestionId\n\t\tquestion {\n\t\t\tqueries {\n\t\t\t\tname\n\t\t\t\tquery\n\t\t\t\tversion\n\t\t\t\tincludeDeleted\n\t\t\t}\n\t\t}\n\t\toperations {\n\t\t\twhen\n\t\t\tactions\n\t\t}\n\t\toutputs\n\t\ttags\n\t}\n}\n","variables":{"id":"df1ddec6-838f-4065-b6eb-2ecd51de58f1"},"operationName":"GetQuestionRuleInstance"}'
body: '{"query":"\nquery GetQuestionRuleInstance ($id: ID!) {\n\tquestionRuleInstance(id: $id) {\n\t\tid\n\t\tname\n\t\tdescription\n\t\tversion\n\t\tspecVersion\n\t\tlatest\n\t\tpollingInterval\n\t\tdeleted\n\t\ttype\n\t\ttemplates\n\t\tnotifyOnFailure\n\t\ttriggerActionsOnNewEntitiesOnly\n\t\tignorePreviousResults\n\t\tquestionId\n\t\tquestion {\n\t\t\tqueries {\n\t\t\t\tname\n\t\t\t\tquery\n\t\t\t\tversion\n\t\t\t\tincludeDeleted\n\t\t\t}\n\t\t}\n\t\toperations {\n\t\t\twhen\n\t\t\tactions\n\t\t}\n\t\toutputs\n\t\ttags\n\t}\n}\n","variables":{"id":"c8649b0d-362d-4246-ba79-1d54b1e13cba"},"operationName":"GetQuestionRuleInstance"}'
form: {}
headers:
Cache-Control:
Expand All @@ -105,15 +105,15 @@ interactions:
proto_minor: 0
transfer_encoding: []
trailer: {}
content_length: 638
content_length: 668
uncompressed: false
body: |
{"data":{"questionRuleInstance":{"id":"df1ddec6-838f-4065-b6eb-2ecd51de58f1","name":"tf-provider-test-rule","description":"test","version":1,"specVersion":1,"latest":true,"pollingInterval":"ONE_DAY","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"questionId":null,"question":{"queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false}]},"operations":[],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}}
{"data":{"questionRuleInstance":{"id":"c8649b0d-362d-4246-ba79-1d54b1e13cba","name":"tf-provider-test-rule","description":"test","version":1,"specVersion":1,"latest":true,"pollingInterval":"ONE_DAY","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"ignorePreviousResults":false,"questionId":null,"question":{"queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false}]},"operations":[],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}}
headers:
Access-Control-Allow-Credentials:
- "true"
Content-Length:
- "638"
- "668"
Content-Security-Policy:
- 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' https: data:;form-action ''self'';frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests'
Content-Type:
Expand Down Expand Up @@ -156,7 +156,7 @@ interactions:
- "0"
status: 200 OK
code: 200
duration: 318.138292ms
duration: 206.76975ms
- id: 2
request:
proto: HTTP/1.1
Expand All @@ -168,7 +168,7 @@ interactions:
host: graphql.us.jupiterone.io
remote_addr: ""
request_uri: ""
body: '{"query":"\nmutation DeleteRuleInstance ($id: ID!) {\n\tdeleteRuleInstance(id: $id) {\n\t\tid\n\t}\n}\n","variables":{"id":"df1ddec6-838f-4065-b6eb-2ecd51de58f1"},"operationName":"DeleteRuleInstance"}'
body: '{"query":"\nmutation DeleteRuleInstance ($id: ID!) {\n\tdeleteRuleInstance(id: $id) {\n\t\tid\n\t}\n}\n","variables":{"id":"c8649b0d-362d-4246-ba79-1d54b1e13cba"},"operationName":"DeleteRuleInstance"}'
form: {}
headers:
Cache-Control:
Expand All @@ -186,7 +186,7 @@ interactions:
content_length: 78
uncompressed: false
body: |
{"data":{"deleteRuleInstance":{"id":"df1ddec6-838f-4065-b6eb-2ecd51de58f1"}}}
{"data":{"deleteRuleInstance":{"id":"c8649b0d-362d-4246-ba79-1d54b1e13cba"}}}
headers:
Access-Control-Allow-Credentials:
- "true"
Expand Down Expand Up @@ -234,4 +234,4 @@ interactions:
- "0"
status: 200 OK
code: 200
duration: 321.64175ms
duration: 266.413584ms
31 changes: 31 additions & 0 deletions jupiterone/internal/client/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions jupiterone/internal/client/rule.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ query GetQuestionRuleInstance($id: ID!) {
templates
notifyOnFailure
triggerActionsOnNewEntitiesOnly
ignorePreviousResults
questionId
question {
queries {
Expand Down
Loading

0 comments on commit b92fe3e

Please sign in to comment.