From 2c351b5db165bfa036b75a46b4f4a7e1bedaacf0 Mon Sep 17 00:00:00 2001 From: Julia Zolotarev Date: Fri, 18 Oct 2024 16:38:35 -0400 Subject: [PATCH 1/5] APP-15731 - Update rule schema --- jupiterone/internal/client/generated.go | 223 +++++++++--------------- jupiterone/internal/client/rule.graphql | 4 + 2 files changed, 84 insertions(+), 143 deletions(-) diff --git a/jupiterone/internal/client/generated.go b/jupiterone/internal/client/generated.go index 90ce32a2..761da39c 100644 --- a/jupiterone/internal/client/generated.go +++ b/jupiterone/internal/client/generated.go @@ -459,7 +459,6 @@ type CreateInlineQuestionRuleInstanceInput struct { Question RuleQuestionDetailsInput `json:"question"` Templates map[string]interface{} `json:"templates"` Tags []string `json:"tags"` - Labels []RuleInstanceLabelInput `json:"labels"` Name string `json:"name"` Description string `json:"description"` SpecVersion int `json:"specVersion"` @@ -470,6 +469,8 @@ type CreateInlineQuestionRuleInstanceInput struct { TriggerActionsOnNewEntitiesOnly bool `json:"triggerActionsOnNewEntitiesOnly"` IgnorePreviousResults bool `json:"ignorePreviousResults"` RemediationSteps string `json:"remediationSteps"` + CollectionId string `json:"collectionId"` + Labels []RuleInstanceLabelInput `json:"labels"` J1Internal bool `json:"j1Internal"` } @@ -486,9 +487,6 @@ func (v *CreateInlineQuestionRuleInstanceInput) GetTemplates() map[string]interf // GetTags returns CreateInlineQuestionRuleInstanceInput.Tags, and is useful for accessing the field via an interface. func (v *CreateInlineQuestionRuleInstanceInput) GetTags() []string { return v.Tags } -// GetLabels returns CreateInlineQuestionRuleInstanceInput.Labels, and is useful for accessing the field via an interface. -func (v *CreateInlineQuestionRuleInstanceInput) GetLabels() []RuleInstanceLabelInput { return v.Labels } - // GetName returns CreateInlineQuestionRuleInstanceInput.Name, and is useful for accessing the field via an interface. func (v *CreateInlineQuestionRuleInstanceInput) GetName() string { return v.Name } @@ -529,6 +527,12 @@ func (v *CreateInlineQuestionRuleInstanceInput) GetRemediationSteps() string { return v.RemediationSteps } +// GetCollectionId returns CreateInlineQuestionRuleInstanceInput.CollectionId, and is useful for accessing the field via an interface. +func (v *CreateInlineQuestionRuleInstanceInput) GetCollectionId() string { return v.CollectionId } + +// GetLabels returns CreateInlineQuestionRuleInstanceInput.Labels, and is useful for accessing the field via an interface. +func (v *CreateInlineQuestionRuleInstanceInput) GetLabels() []RuleInstanceLabelInput { return v.Labels } + // GetJ1Internal returns CreateInlineQuestionRuleInstanceInput.J1Internal, and is useful for accessing the field via an interface. func (v *CreateInlineQuestionRuleInstanceInput) GetJ1Internal() bool { return v.J1Internal } @@ -726,17 +730,12 @@ func (v *CreateInsightsWidgetInput) GetConfig() CreateInsightsWidgetConfigInput // CreateIntegrationInstanceCreateIntegrationInstance includes the requested fields of the GraphQL type IntegrationInstance. type CreateIntegrationInstanceCreateIntegrationInstance struct { - Id string `json:"id"` - Name string `json:"name"` - AccountId string `json:"accountId"` - SourceIntegrationInstanceId string `json:"sourceIntegrationInstanceId"` - PollingInterval IntegrationPollingInterval `json:"pollingInterval"` - IntegrationDefinitionId string `json:"integrationDefinitionId"` - Description string `json:"description"` - Config map[string]interface{} `json:"config"` - OffsiteComplete bool `json:"offsiteComplete"` - InstanceRelationship IntegrationInstanceRelationship `json:"instanceRelationship"` - CollectorPoolId string `json:"collectorPoolId"` + Id string `json:"id"` + Name string `json:"name"` + PollingInterval IntegrationPollingInterval `json:"pollingInterval"` + IntegrationDefinitionId string `json:"integrationDefinitionId"` + Description string `json:"description"` + Config map[string]interface{} `json:"config"` } // GetId returns CreateIntegrationInstanceCreateIntegrationInstance.Id, and is useful for accessing the field via an interface. @@ -745,16 +744,6 @@ func (v *CreateIntegrationInstanceCreateIntegrationInstance) GetId() string { re // GetName returns CreateIntegrationInstanceCreateIntegrationInstance.Name, and is useful for accessing the field via an interface. func (v *CreateIntegrationInstanceCreateIntegrationInstance) GetName() string { return v.Name } -// GetAccountId returns CreateIntegrationInstanceCreateIntegrationInstance.AccountId, and is useful for accessing the field via an interface. -func (v *CreateIntegrationInstanceCreateIntegrationInstance) GetAccountId() string { - return v.AccountId -} - -// GetSourceIntegrationInstanceId returns CreateIntegrationInstanceCreateIntegrationInstance.SourceIntegrationInstanceId, and is useful for accessing the field via an interface. -func (v *CreateIntegrationInstanceCreateIntegrationInstance) GetSourceIntegrationInstanceId() string { - return v.SourceIntegrationInstanceId -} - // GetPollingInterval returns CreateIntegrationInstanceCreateIntegrationInstance.PollingInterval, and is useful for accessing the field via an interface. func (v *CreateIntegrationInstanceCreateIntegrationInstance) GetPollingInterval() IntegrationPollingInterval { return v.PollingInterval @@ -775,21 +764,6 @@ func (v *CreateIntegrationInstanceCreateIntegrationInstance) GetConfig() map[str return v.Config } -// GetOffsiteComplete returns CreateIntegrationInstanceCreateIntegrationInstance.OffsiteComplete, and is useful for accessing the field via an interface. -func (v *CreateIntegrationInstanceCreateIntegrationInstance) GetOffsiteComplete() bool { - return v.OffsiteComplete -} - -// GetInstanceRelationship returns CreateIntegrationInstanceCreateIntegrationInstance.InstanceRelationship, and is useful for accessing the field via an interface. -func (v *CreateIntegrationInstanceCreateIntegrationInstance) GetInstanceRelationship() IntegrationInstanceRelationship { - return v.InstanceRelationship -} - -// GetCollectorPoolId returns CreateIntegrationInstanceCreateIntegrationInstance.CollectorPoolId, and is useful for accessing the field via an interface. -func (v *CreateIntegrationInstanceCreateIntegrationInstance) GetCollectorPoolId() string { - return v.CollectorPoolId -} - type CreateIntegrationInstanceInput struct { Name string `json:"name"` SourceIntegrationInstanceId string `json:"sourceIntegrationInstanceId"` @@ -954,6 +928,8 @@ type CreateReferencedQuestionRuleInstanceInput struct { TriggerActionsOnNewEntitiesOnly bool `json:"triggerActionsOnNewEntitiesOnly"` IgnorePreviousResults bool `json:"ignorePreviousResults"` RemediationSteps string `json:"remediationSteps"` + CollectionId string `json:"collectionId"` + Labels []RuleInstanceLabelInput `json:"labels"` } // GetQuestionId returns CreateReferencedQuestionRuleInstanceInput.QuestionId, and is useful for accessing the field via an interface. @@ -1009,6 +985,14 @@ func (v *CreateReferencedQuestionRuleInstanceInput) GetRemediationSteps() string return v.RemediationSteps } +// GetCollectionId returns CreateReferencedQuestionRuleInstanceInput.CollectionId, and is useful for accessing the field via an interface. +func (v *CreateReferencedQuestionRuleInstanceInput) GetCollectionId() string { return v.CollectionId } + +// GetLabels returns CreateReferencedQuestionRuleInstanceInput.Labels, and is useful for accessing the field via an interface. +func (v *CreateReferencedQuestionRuleInstanceInput) GetLabels() []RuleInstanceLabelInput { + return v.Labels +} + // CreateReferencedQuestionRuleInstanceResponse is returned by CreateReferencedQuestionRuleInstance on success. type CreateReferencedQuestionRuleInstanceResponse struct { CreateQuestionRuleInstance CreateReferencedQuestionRuleInstanceCreateQuestionRuleInstance `json:"createQuestionRuleInstance"` @@ -1647,17 +1631,12 @@ func (v *GetGroupsByNameResponse) GetIamGetGroupList() GetGroupsByNameIamGetGrou // GetIntegrationInstanceIntegrationInstance includes the requested fields of the GraphQL type IntegrationInstance. type GetIntegrationInstanceIntegrationInstance struct { - Id string `json:"id"` - Name string `json:"name"` - AccountId string `json:"accountId"` - SourceIntegrationInstanceId string `json:"sourceIntegrationInstanceId"` - PollingInterval IntegrationPollingInterval `json:"pollingInterval"` - IntegrationDefinitionId string `json:"integrationDefinitionId"` - Description string `json:"description"` - Config map[string]interface{} `json:"config"` - OffsiteComplete bool `json:"offsiteComplete"` - InstanceRelationship IntegrationInstanceRelationship `json:"instanceRelationship"` - CollectorPoolId string `json:"collectorPoolId"` + Id string `json:"id"` + Name string `json:"name"` + PollingInterval IntegrationPollingInterval `json:"pollingInterval"` + IntegrationDefinitionId string `json:"integrationDefinitionId"` + Description string `json:"description"` + Config map[string]interface{} `json:"config"` } // GetId returns GetIntegrationInstanceIntegrationInstance.Id, and is useful for accessing the field via an interface. @@ -1666,14 +1645,6 @@ func (v *GetIntegrationInstanceIntegrationInstance) GetId() string { return v.Id // GetName returns GetIntegrationInstanceIntegrationInstance.Name, and is useful for accessing the field via an interface. func (v *GetIntegrationInstanceIntegrationInstance) GetName() string { return v.Name } -// GetAccountId returns GetIntegrationInstanceIntegrationInstance.AccountId, and is useful for accessing the field via an interface. -func (v *GetIntegrationInstanceIntegrationInstance) GetAccountId() string { return v.AccountId } - -// GetSourceIntegrationInstanceId returns GetIntegrationInstanceIntegrationInstance.SourceIntegrationInstanceId, and is useful for accessing the field via an interface. -func (v *GetIntegrationInstanceIntegrationInstance) GetSourceIntegrationInstanceId() string { - return v.SourceIntegrationInstanceId -} - // GetPollingInterval returns GetIntegrationInstanceIntegrationInstance.PollingInterval, and is useful for accessing the field via an interface. func (v *GetIntegrationInstanceIntegrationInstance) GetPollingInterval() IntegrationPollingInterval { return v.PollingInterval @@ -1692,21 +1663,6 @@ func (v *GetIntegrationInstanceIntegrationInstance) GetConfig() map[string]inter return v.Config } -// GetOffsiteComplete returns GetIntegrationInstanceIntegrationInstance.OffsiteComplete, and is useful for accessing the field via an interface. -func (v *GetIntegrationInstanceIntegrationInstance) GetOffsiteComplete() bool { - return v.OffsiteComplete -} - -// GetInstanceRelationship returns GetIntegrationInstanceIntegrationInstance.InstanceRelationship, and is useful for accessing the field via an interface. -func (v *GetIntegrationInstanceIntegrationInstance) GetInstanceRelationship() IntegrationInstanceRelationship { - return v.InstanceRelationship -} - -// GetCollectorPoolId returns GetIntegrationInstanceIntegrationInstance.CollectorPoolId, and is useful for accessing the field via an interface. -func (v *GetIntegrationInstanceIntegrationInstance) GetCollectorPoolId() string { - return v.CollectorPoolId -} - // GetIntegrationInstanceResponse is returned by GetIntegrationInstance on success. type GetIntegrationInstanceResponse struct { IntegrationInstance GetIntegrationInstanceIntegrationInstance `json:"integrationInstance"` @@ -1856,6 +1812,7 @@ type GetQuestionRuleInstanceQuestionRuleInstance struct { NotifyOnFailure bool `json:"notifyOnFailure"` TriggerActionsOnNewEntitiesOnly bool `json:"triggerActionsOnNewEntitiesOnly"` IgnorePreviousResults bool `json:"ignorePreviousResults"` + Labels []GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel `json:"labels"` QuestionId string `json:"questionId"` Question GetQuestionRuleInstanceQuestionRuleInstanceQuestionRuleQuestionDetails `json:"question"` Operations []RuleOperationOutput `json:"operations"` @@ -1912,6 +1869,11 @@ func (v *GetQuestionRuleInstanceQuestionRuleInstance) GetIgnorePreviousResults() return v.IgnorePreviousResults } +// GetLabels returns GetQuestionRuleInstanceQuestionRuleInstance.Labels, and is useful for accessing the field via an interface. +func (v *GetQuestionRuleInstanceQuestionRuleInstance) GetLabels() []GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel { + return v.Labels +} + // GetQuestionId returns GetQuestionRuleInstanceQuestionRuleInstance.QuestionId, and is useful for accessing the field via an interface. func (v *GetQuestionRuleInstanceQuestionRuleInstance) GetQuestionId() string { return v.QuestionId } @@ -1931,6 +1893,22 @@ func (v *GetQuestionRuleInstanceQuestionRuleInstance) GetOutputs() []string { re // GetTags returns GetQuestionRuleInstanceQuestionRuleInstance.Tags, and is useful for accessing the field via an interface. func (v *GetQuestionRuleInstanceQuestionRuleInstance) GetTags() []string { return v.Tags } +// GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel includes the requested fields of the GraphQL type RuleInstanceLabel. +type GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel struct { + LabelName string `json:"labelName"` + LabelValue map[string]interface{} `json:"labelValue"` +} + +// GetLabelName returns GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel.LabelName, and is useful for accessing the field via an interface. +func (v *GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel) GetLabelName() string { + return v.LabelName +} + +// GetLabelValue returns GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel.LabelValue, and is useful for accessing the field via an interface. +func (v *GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel) GetLabelValue() map[string]interface{} { + return v.LabelValue +} + // GetQuestionRuleInstanceQuestionRuleInstanceQuestionRuleQuestionDetails includes the requested fields of the GraphQL type RuleQuestionDetails. type GetQuestionRuleInstanceQuestionRuleInstanceQuestionRuleQuestionDetails struct { Queries []GetQuestionRuleInstanceQuestionRuleInstanceQuestionRuleQuestionDetailsQueriesJ1Query `json:"queries"` @@ -2170,14 +2148,6 @@ func (v *IngestionSourcesOverridesInput) GetIngestionSourceId() string { return // GetEnabled returns IngestionSourcesOverridesInput.Enabled, and is useful for accessing the field via an interface. func (v *IngestionSourcesOverridesInput) GetEnabled() bool { return v.Enabled } -type IntegrationInstanceRelationship string - -const ( - IntegrationInstanceRelationshipParent IntegrationInstanceRelationship = "PARENT" - IntegrationInstanceRelationshipChild IntegrationInstanceRelationship = "CHILD" - IntegrationInstanceRelationshipStandalone IntegrationInstanceRelationship = "STANDALONE" -) - type IntegrationPollingInterval string const ( @@ -2883,7 +2853,6 @@ type UpdateInlineQuestionRuleInstanceInput struct { LatestAlertId string `json:"latestAlertId,omitempty"` Templates map[string]interface{} `json:"templates"` Tags []string `json:"tags"` - Labels []RuleInstanceLabelInput `json:"labels"` Name string `json:"name"` Description string `json:"description"` SpecVersion int `json:"specVersion"` @@ -2894,6 +2863,8 @@ type UpdateInlineQuestionRuleInstanceInput struct { TriggerActionsOnNewEntitiesOnly bool `json:"triggerActionsOnNewEntitiesOnly"` IgnorePreviousResults bool `json:"ignorePreviousResults"` RemediationSteps string `json:"remediationSteps,omitempty"` + CollectionId string `json:"collectionId"` + Labels []RuleInstanceLabelInput `json:"labels"` } // GetQuestion returns UpdateInlineQuestionRuleInstanceInput.Question, and is useful for accessing the field via an interface. @@ -2921,9 +2892,6 @@ func (v *UpdateInlineQuestionRuleInstanceInput) GetTemplates() map[string]interf // GetTags returns UpdateInlineQuestionRuleInstanceInput.Tags, and is useful for accessing the field via an interface. func (v *UpdateInlineQuestionRuleInstanceInput) GetTags() []string { return v.Tags } -// GetLabels returns UpdateInlineQuestionRuleInstanceInput.Labels, and is useful for accessing the field via an interface. -func (v *UpdateInlineQuestionRuleInstanceInput) GetLabels() []RuleInstanceLabelInput { return v.Labels } - // GetName returns UpdateInlineQuestionRuleInstanceInput.Name, and is useful for accessing the field via an interface. func (v *UpdateInlineQuestionRuleInstanceInput) GetName() string { return v.Name } @@ -2964,6 +2932,12 @@ func (v *UpdateInlineQuestionRuleInstanceInput) GetRemediationSteps() string { return v.RemediationSteps } +// GetCollectionId returns UpdateInlineQuestionRuleInstanceInput.CollectionId, and is useful for accessing the field via an interface. +func (v *UpdateInlineQuestionRuleInstanceInput) GetCollectionId() string { return v.CollectionId } + +// GetLabels returns UpdateInlineQuestionRuleInstanceInput.Labels, and is useful for accessing the field via an interface. +func (v *UpdateInlineQuestionRuleInstanceInput) GetLabels() []RuleInstanceLabelInput { return v.Labels } + // UpdateInlineQuestionRuleInstanceResponse is returned by UpdateInlineQuestionRuleInstance on success. type UpdateInlineQuestionRuleInstanceResponse struct { UpdateInlineQuestionRuleInstance UpdateInlineQuestionRuleInstanceUpdateInlineQuestionRuleInstance `json:"updateInlineQuestionRuleInstance"` @@ -3055,17 +3029,12 @@ func (v *UpdateIntegrationInstanceResponse) GetUpdateIntegrationInstance() Updat // UpdateIntegrationInstanceUpdateIntegrationInstance includes the requested fields of the GraphQL type IntegrationInstance. type UpdateIntegrationInstanceUpdateIntegrationInstance struct { - Id string `json:"id"` - Name string `json:"name"` - AccountId string `json:"accountId"` - SourceIntegrationInstanceId string `json:"sourceIntegrationInstanceId"` - PollingInterval IntegrationPollingInterval `json:"pollingInterval"` - IntegrationDefinitionId string `json:"integrationDefinitionId"` - Description string `json:"description"` - Config map[string]interface{} `json:"config"` - OffsiteComplete bool `json:"offsiteComplete"` - InstanceRelationship IntegrationInstanceRelationship `json:"instanceRelationship"` - CollectorPoolId string `json:"collectorPoolId"` + Id string `json:"id"` + Name string `json:"name"` + PollingInterval IntegrationPollingInterval `json:"pollingInterval"` + IntegrationDefinitionId string `json:"integrationDefinitionId"` + Description string `json:"description"` + Config map[string]interface{} `json:"config"` } // GetId returns UpdateIntegrationInstanceUpdateIntegrationInstance.Id, and is useful for accessing the field via an interface. @@ -3074,16 +3043,6 @@ func (v *UpdateIntegrationInstanceUpdateIntegrationInstance) GetId() string { re // GetName returns UpdateIntegrationInstanceUpdateIntegrationInstance.Name, and is useful for accessing the field via an interface. func (v *UpdateIntegrationInstanceUpdateIntegrationInstance) GetName() string { return v.Name } -// GetAccountId returns UpdateIntegrationInstanceUpdateIntegrationInstance.AccountId, and is useful for accessing the field via an interface. -func (v *UpdateIntegrationInstanceUpdateIntegrationInstance) GetAccountId() string { - return v.AccountId -} - -// GetSourceIntegrationInstanceId returns UpdateIntegrationInstanceUpdateIntegrationInstance.SourceIntegrationInstanceId, and is useful for accessing the field via an interface. -func (v *UpdateIntegrationInstanceUpdateIntegrationInstance) GetSourceIntegrationInstanceId() string { - return v.SourceIntegrationInstanceId -} - // GetPollingInterval returns UpdateIntegrationInstanceUpdateIntegrationInstance.PollingInterval, and is useful for accessing the field via an interface. func (v *UpdateIntegrationInstanceUpdateIntegrationInstance) GetPollingInterval() IntegrationPollingInterval { return v.PollingInterval @@ -3104,21 +3063,6 @@ func (v *UpdateIntegrationInstanceUpdateIntegrationInstance) GetConfig() map[str return v.Config } -// GetOffsiteComplete returns UpdateIntegrationInstanceUpdateIntegrationInstance.OffsiteComplete, and is useful for accessing the field via an interface. -func (v *UpdateIntegrationInstanceUpdateIntegrationInstance) GetOffsiteComplete() bool { - return v.OffsiteComplete -} - -// GetInstanceRelationship returns UpdateIntegrationInstanceUpdateIntegrationInstance.InstanceRelationship, and is useful for accessing the field via an interface. -func (v *UpdateIntegrationInstanceUpdateIntegrationInstance) GetInstanceRelationship() IntegrationInstanceRelationship { - return v.InstanceRelationship -} - -// GetCollectorPoolId returns UpdateIntegrationInstanceUpdateIntegrationInstance.CollectorPoolId, and is useful for accessing the field via an interface. -func (v *UpdateIntegrationInstanceUpdateIntegrationInstance) GetCollectorPoolId() string { - return v.CollectorPoolId -} - // UpdateQuestionResponse is returned by UpdateQuestion on success. type UpdateQuestionResponse struct { UpdateQuestion UpdateQuestionUpdateQuestion `json:"updateQuestion"` @@ -3145,7 +3089,6 @@ type UpdateReferencedQuestionRuleInstanceInput struct { LatestAlertId string `json:"latestAlertId,omitempty"` Templates map[string]interface{} `json:"templates"` Tags []string `json:"tags"` - Labels []RuleInstanceLabelInput `json:"labels"` Name string `json:"name"` Description string `json:"description"` SpecVersion int `json:"specVersion"` @@ -3156,6 +3099,8 @@ type UpdateReferencedQuestionRuleInstanceInput struct { TriggerActionsOnNewEntitiesOnly bool `json:"triggerActionsOnNewEntitiesOnly"` IgnorePreviousResults bool `json:"ignorePreviousResults"` RemediationSteps string `json:"remediationSteps"` + CollectionId string `json:"collectionId"` + Labels []RuleInstanceLabelInput `json:"labels"` } // GetQuestionId returns UpdateReferencedQuestionRuleInstanceInput.QuestionId, and is useful for accessing the field via an interface. @@ -3181,11 +3126,6 @@ func (v *UpdateReferencedQuestionRuleInstanceInput) GetTemplates() map[string]in // GetTags returns UpdateReferencedQuestionRuleInstanceInput.Tags, and is useful for accessing the field via an interface. func (v *UpdateReferencedQuestionRuleInstanceInput) GetTags() []string { return v.Tags } -// GetLabels returns UpdateReferencedQuestionRuleInstanceInput.Labels, and is useful for accessing the field via an interface. -func (v *UpdateReferencedQuestionRuleInstanceInput) GetLabels() []RuleInstanceLabelInput { - return v.Labels -} - // GetName returns UpdateReferencedQuestionRuleInstanceInput.Name, and is useful for accessing the field via an interface. func (v *UpdateReferencedQuestionRuleInstanceInput) GetName() string { return v.Name } @@ -3228,6 +3168,14 @@ func (v *UpdateReferencedQuestionRuleInstanceInput) GetRemediationSteps() string return v.RemediationSteps } +// GetCollectionId returns UpdateReferencedQuestionRuleInstanceInput.CollectionId, and is useful for accessing the field via an interface. +func (v *UpdateReferencedQuestionRuleInstanceInput) GetCollectionId() string { return v.CollectionId } + +// GetLabels returns UpdateReferencedQuestionRuleInstanceInput.Labels, and is useful for accessing the field via an interface. +func (v *UpdateReferencedQuestionRuleInstanceInput) GetLabels() []RuleInstanceLabelInput { + return v.Labels +} + // UpdateReferencedQuestionRuleInstanceResponse is returned by UpdateReferencedQuestionRuleInstance on success. type UpdateReferencedQuestionRuleInstanceResponse struct { UpdateReferencedQuestionRuleInstance UpdateReferencedQuestionRuleInstanceUpdateReferencedQuestionRuleInstance `json:"updateReferencedQuestionRuleInstance"` @@ -4118,15 +4066,10 @@ mutation CreateIntegrationInstance ($instance: CreateIntegrationInstanceInput!) createIntegrationInstance(instance: $instance) { id name - accountId - sourceIntegrationInstanceId pollingInterval integrationDefinitionId description config - offsiteComplete - instanceRelationship - collectorPoolId } } `, @@ -4936,15 +4879,10 @@ query GetIntegrationInstance ($id: String!) { integrationInstance(id: $id) { id name - accountId - sourceIntegrationInstanceId pollingInterval integrationDefinitionId description config - offsiteComplete - instanceRelationship - collectorPoolId } } `, @@ -5077,6 +5015,10 @@ query GetQuestionRuleInstance ($id: ID!) { notifyOnFailure triggerActionsOnNewEntitiesOnly ignorePreviousResults + labels { + labelName + labelValue + } questionId question { queries { @@ -5594,15 +5536,10 @@ mutation UpdateIntegrationInstance ($id: String!, $update: UpdateIntegrationInst updateIntegrationInstance(id: $id, update: $update) { id name - accountId - sourceIntegrationInstanceId pollingInterval integrationDefinitionId description config - offsiteComplete - instanceRelationship - collectorPoolId } } `, diff --git a/jupiterone/internal/client/rule.graphql b/jupiterone/internal/client/rule.graphql index d6c79dc0..c54a99d8 100644 --- a/jupiterone/internal/client/rule.graphql +++ b/jupiterone/internal/client/rule.graphql @@ -13,6 +13,10 @@ query GetQuestionRuleInstance($id: ID!) { notifyOnFailure triggerActionsOnNewEntitiesOnly ignorePreviousResults + labels { + labelName + labelValue + } questionId question { queries { From af1f18fb2108ed17aa146c1514626339e33721ad Mon Sep 17 00:00:00 2001 From: Julia Zolotarev Date: Tue, 22 Oct 2024 10:50:55 -0400 Subject: [PATCH 2/5] wip --- docs/resources/rule.md | 15 +++++-- jupiterone/internal/client/generated.go | 26 +++++++++++ jupiterone/internal/client/genqlient.yaml | 4 ++ jupiterone/internal/client/rule.graphql | 4 ++ jupiterone/resource_rule.go | 54 +++++++++++++++++++++++ jupiterone/resource_rule_test.go | 46 +++++++++++++++++++ 6 files changed, 145 insertions(+), 4 deletions(-) diff --git a/docs/resources/rule.md b/docs/resources/rule.md index c410ffd6..53423a27 100644 --- a/docs/resources/rule.md +++ b/docs/resources/rule.md @@ -28,6 +28,11 @@ resource "jupiterone_rule" "unencrypted_critical_data_stores" { tags = ["exampletag"] + labels = [{ + label_name = "examplekey" + label_value = "examplevalue" + }] + outputs = [ "queries.query0.total", "alertLevel" @@ -99,6 +104,7 @@ resource "jupiterone_rule" "users_without_mfa" { ``` + ## Schema ### Required @@ -116,7 +122,8 @@ resource "jupiterone_rule" "users_without_mfa" { - `question` (Block List) Contains properties related to queries used in the rule evaluation. (see [below for nested schema](#nestedblock--question)) - `question_id` (String) Specifies the ID of a question to be used in rule evaluation. - `spec_version` (Number) Rule evaluation specification version in the case of breaking changes. -- `tags` (List of String) Comma separated list of tags to apply to the rule. +- `tags` (List of String) Comma separated list of tags to apply to the jupiterone_rule entity. Value will always be true. +- `labels` (List of Attributes) Key/value pairs to apply to the jupiterone_rule entity. - `templates` (Map of String) Optional key/value pairs of template name to template - `trigger_on_new_only` (Boolean) @@ -126,6 +133,7 @@ resource "jupiterone_rule" "users_without_mfa" { - `version` (Number) Computed current version of the rule. Incremented each time the rule is updated. + ### Nested Schema for `operations` Required: @@ -136,8 +144,8 @@ Optional: - `when` (String) - + ### Nested Schema for `question` Optional: @@ -145,6 +153,7 @@ Optional: - `queries` (Block List) Contains properties related to queries used in the rule evaluation. (see [below for nested schema](#nestedblock--question--queries)) + ### Nested Schema for `question.queries` Required: @@ -156,5 +165,3 @@ Optional: - `include_deleted` (Boolean) - `name` (String) - - diff --git a/jupiterone/internal/client/generated.go b/jupiterone/internal/client/generated.go index 761da39c..9570e6f5 100644 --- a/jupiterone/internal/client/generated.go +++ b/jupiterone/internal/client/generated.go @@ -376,6 +376,7 @@ type CreateInlineQuestionRuleInstanceCreateQuestionRuleInstance struct { SpecVersion int `json:"specVersion"` Question CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceQuestionRuleQuestionDetails `json:"question"` Operations []CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceOperationsRuleOperation `json:"operations"` + Labels []CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel `json:"labels"` } // GetId returns CreateInlineQuestionRuleInstanceCreateQuestionRuleInstance.Id, and is useful for accessing the field via an interface. @@ -401,6 +402,27 @@ func (v *CreateInlineQuestionRuleInstanceCreateQuestionRuleInstance) GetOperatio return v.Operations } +// GetLabels returns CreateInlineQuestionRuleInstanceCreateQuestionRuleInstance.Labels, and is useful for accessing the field via an interface. +func (v *CreateInlineQuestionRuleInstanceCreateQuestionRuleInstance) GetLabels() []CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel { + return v.Labels +} + +// CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel includes the requested fields of the GraphQL type RuleInstanceLabel. +type CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel struct { + LabelName string `json:"labelName"` + LabelValue map[string]interface{} `json:"labelValue"` +} + +// GetLabelName returns CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel.LabelName, and is useful for accessing the field via an interface. +func (v *CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel) GetLabelName() string { + return v.LabelName +} + +// GetLabelValue returns CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel.LabelValue, and is useful for accessing the field via an interface. +func (v *CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel) GetLabelValue() map[string]interface{} { + return v.LabelValue +} + // CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceOperationsRuleOperation includes the requested fields of the GraphQL type RuleOperation. type CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceOperationsRuleOperation struct { When map[string]interface{} `json:"when"` @@ -4033,6 +4055,10 @@ mutation CreateInlineQuestionRuleInstance ($instance: CreateInlineQuestionRuleIn when actions } + labels { + labelName + labelValue + } } } `, diff --git a/jupiterone/internal/client/genqlient.yaml b/jupiterone/internal/client/genqlient.yaml index 356433c0..095d6b1b 100644 --- a/jupiterone/internal/client/genqlient.yaml +++ b/jupiterone/internal/client/genqlient.yaml @@ -21,3 +21,7 @@ bindings: type: string Long: type: int64 + # RuleInstanceLabelInput: + # type: map[string]interface{} + # RuleInstanceLabel: + # type: interface{} diff --git a/jupiterone/internal/client/rule.graphql b/jupiterone/internal/client/rule.graphql index c54a99d8..d967eb58 100644 --- a/jupiterone/internal/client/rule.graphql +++ b/jupiterone/internal/client/rule.graphql @@ -59,6 +59,10 @@ mutation CreateInlineQuestionRuleInstance( when actions } + labels { + labelName + labelValue + } } } diff --git a/jupiterone/resource_rule.go b/jupiterone/resource_rule.go index 8b619dd7..82b5c5df 100644 --- a/jupiterone/resource_rule.go +++ b/jupiterone/resource_rule.go @@ -71,6 +71,11 @@ type RuleOperation struct { Actions []string `json:"actions" tfsdk:"actions"` } +type RuleLabel struct { + LabelName types.String `json:"label_name" tfsdk:"label_name"` + LabelValue types.String `json:"label_value" tfsdk:"label_value"` +} + // newOperationsWithoutId removes any "id" fields before saving into state. func newOperationsWithoutId(ops []client.RuleOperationOutput) ([]RuleOperation, error) { l := make([]RuleOperation, 0, len(ops)) @@ -121,6 +126,7 @@ type RuleModel struct { NotifyOnFailure types.Bool `json:"notify_on_failure" tfsdk:"notify_on_failure"` TriggerOnNewOnly types.Bool `json:"trigger_on_new_only" tfsdk:"trigger_on_new_only"` IgnorePreviousResults types.Bool `json:"ignore_previous_results" tfsdk:"ignore_previous_results"` + Labels []RuleLabel `json:"labels" tfsdk:"labels"` } func NewQuestionRuleResource() resource.Resource { @@ -263,6 +269,22 @@ func (*QuestionRuleResource) Schema(ctx context.Context, req resource.SchemaRequ Computed: true, Default: booldefault.StaticBool(false), }, + "labels": schema.ListNestedAttribute{ + Description: "Comma separated list of labelName/labelValue pairs to apply to the rule.", + Optional: true, + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "label_name": schema.StringAttribute{ + Required: true, + Description: "Name of the label", + }, + "label_value": schema.StringAttribute{ + Required: true, + Description: "Value of the label, which is represented in TF as a string but can be a string, number or boolean", + }, + }, + }, + }, }, // TODO: Deprecate the use of blocks following new framework guidance: // https://developer.hashicorp.com/terraform/plugin/framework/handling-data/blocks @@ -476,6 +498,7 @@ func (r *QuestionRuleResource) Read(ctx context.Context, req resource.ReadReques NotifyOnFailure: types.BoolValue(rule.NotifyOnFailure), TriggerOnNewOnly: types.BoolValue(rule.TriggerActionsOnNewEntitiesOnly), IgnorePreviousResults: types.BoolValue(rule.IgnorePreviousResults), + // TODO: Labels: rule.Labels, } // FIXME: handling of these JSON fields (map[string]interface{}) is not DRY @@ -633,6 +656,16 @@ func (r *RuleModel) BuildCreateReferencedQuestionRuleInstanceInput() (client.Cre return rule, err } + // TODO: temp + labels, err := json.Marshal(r.Labels) + if err != nil { + return rule, err + } + err = json.Unmarshal(labels, &rule.Labels) + if err != nil { + return rule, err + } + // FIXME: is roundtripping the best way? does it help with keeping // config/state/server responses from being detected as different? templates, err := json.Marshal(r.Templates) @@ -699,6 +732,7 @@ func (r *RuleModel) BuildCreateInlineQuestionRuleInstanceInput() (client.CreateI NotifyOnFailure: r.NotifyOnFailure.ValueBool(), TriggerActionsOnNewEntitiesOnly: r.TriggerOnNewOnly.ValueBool(), IgnorePreviousResults: r.IgnorePreviousResults.ValueBool(), + // Labels: r.Labels, } var err error @@ -707,6 +741,26 @@ func (r *RuleModel) BuildCreateInlineQuestionRuleInstanceInput() (client.CreateI return rule, err } + // Handle labels + // if len(r.Labels) > 0 { + // labels := make([]RuleLabel, len(r.Labels)) + + // for i, label := range r.Labels { + // labels[i] = RuleLabel{ + // LabelName: label.LabelName, + // LabelValue: label.LabelValue, + // } + // } + + // // need to convert to correct type + // interfaceLabels := make([]interface{}, len(labels)) + // for i, label := range labels { + // interfaceLabels[i] = label + // } + + // rule.Labels = interfaceLabels + // } + // FIXME: is roundtripping the best way? does it help with keeping // config/state/server responses from being detected as different? templates, err := json.Marshal(r.Templates) diff --git a/jupiterone/resource_rule_test.go b/jupiterone/resource_rule_test.go index b3eca6bb..cbee9572 100644 --- a/jupiterone/resource_rule_test.go +++ b/jupiterone/resource_rule_test.go @@ -133,6 +133,8 @@ func TestInlineRuleInstance_BasicImport(t *testing.T) { resource.TestCheckResourceAttr(testRuleResourceName, "question.0.queries.0.name", "query0"), resource.TestCheckResourceAttr(testRuleResourceName, "question.0.queries.0.version", "v1"), resource.TestCheckResourceAttr(testRuleResourceName, "question.0.queries.0.query", "Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true"), + resource.TestCheckResourceAttr(testRuleResourceName, "labels.0.label_name", "label1"), + resource.TestCheckResourceAttr(testRuleResourceName, "labels.#", "0"), ), }, }, @@ -206,6 +208,10 @@ func TestRuleInstance_Config_Errors(t *testing.T) { Config: testRuleInstanceInvalidConfig(rName), ExpectError: regexp.MustCompile(`Error: Invalid Attribute Combination`), }, + { + Config: testRuleInstanceInvalidLabelsConfig(rName), + ExpectError: regexp.MustCompile(`Error: Incorrect attribute value type`), + }, }, }) } @@ -432,6 +438,10 @@ func testRuleInstanceBasicConfigWithPollingInterval(rName string, pollingInterva tags = ["tf_acc:1","tf_acc:2"] + labels = [ + {label_name: "label1", label_value: "value1"}, + ] + question { queries { name = "query0" @@ -451,6 +461,41 @@ func testRuleInstanceBasicConfigWithPollingInterval(rName string, pollingInterva } func testRuleInstanceInvalidConfig(rName string) string { + // can only have one of ignore_previous_results or trigger_on_new_only + return fmt.Sprintf(` + provider "jupiterone" {} + + resource "jupiterone_rule" "test" { + name = %q + description = "Test" + spec_version = 1 + polling_interval = "ONE_WEEK" + notify_on_failure = false + ignore_previous_results = true + trigger_on_new_only = true + + tags = ["tf_acc:1","tf_acc:2"] + + question { + queries { + name = "query0" + query = "Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true" + version = "v1" + } + } + + outputs = [ + "queries.query0.total", + "alertLevel" + ] + + operations = %s + } + `, rName, getValidOperations()) +} + +func testRuleInstanceInvalidLabelsConfig(rName string) string { + // labels are in the wrong format return fmt.Sprintf(` provider "jupiterone" {} @@ -464,6 +509,7 @@ func testRuleInstanceInvalidConfig(rName string) string { trigger_on_new_only = true tags = ["tf_acc:1","tf_acc:2"] + labels = ["tf_acc:1","tf_acc:2"] question { queries { From 21df772d8ca7bab95f5ca982cd36540db6b30c81 Mon Sep 17 00:00:00 2001 From: Julia Zolotarev Date: Wed, 23 Oct 2024 10:45:52 -0400 Subject: [PATCH 3/5] APP-15731 - Add labels to create/update on rules --- docs/resources/rule.md | 2 +- jupiterone/internal/client/generated.go | 38 ++---------- jupiterone/internal/client/genqlient.yaml | 4 -- jupiterone/internal/client/rule.graphql | 4 -- jupiterone/resource_rule.go | 75 +++++++++++++++-------- 5 files changed, 55 insertions(+), 68 deletions(-) diff --git a/docs/resources/rule.md b/docs/resources/rule.md index 53423a27..12e75d94 100644 --- a/docs/resources/rule.md +++ b/docs/resources/rule.md @@ -123,7 +123,7 @@ resource "jupiterone_rule" "users_without_mfa" { - `question_id` (String) Specifies the ID of a question to be used in rule evaluation. - `spec_version` (Number) Rule evaluation specification version in the case of breaking changes. - `tags` (List of String) Comma separated list of tags to apply to the jupiterone_rule entity. Value will always be true. -- `labels` (List of Attributes) Key/value pairs to apply to the jupiterone_rule entity. +- `labels` (List of Attributes) Key/value pairs to apply to the jupiterone_rule entity. If label_value is a string that represents a boolean or number (i.e. "true", "1"), it will be converted to a boolean or number respectively. - `templates` (Map of String) Optional key/value pairs of template name to template - `trigger_on_new_only` (Boolean) diff --git a/jupiterone/internal/client/generated.go b/jupiterone/internal/client/generated.go index 9570e6f5..2a32d3eb 100644 --- a/jupiterone/internal/client/generated.go +++ b/jupiterone/internal/client/generated.go @@ -409,8 +409,8 @@ func (v *CreateInlineQuestionRuleInstanceCreateQuestionRuleInstance) GetLabels() // CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel includes the requested fields of the GraphQL type RuleInstanceLabel. type CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel struct { - LabelName string `json:"labelName"` - LabelValue map[string]interface{} `json:"labelValue"` + LabelName string `json:"labelName"` + LabelValue string `json:"labelValue"` } // GetLabelName returns CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel.LabelName, and is useful for accessing the field via an interface. @@ -419,7 +419,7 @@ func (v *CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleIns } // GetLabelValue returns CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel.LabelValue, and is useful for accessing the field via an interface. -func (v *CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel) GetLabelValue() map[string]interface{} { +func (v *CreateInlineQuestionRuleInstanceCreateQuestionRuleInstanceLabelsRuleInstanceLabel) GetLabelValue() string { return v.LabelValue } @@ -1834,7 +1834,6 @@ type GetQuestionRuleInstanceQuestionRuleInstance struct { NotifyOnFailure bool `json:"notifyOnFailure"` TriggerActionsOnNewEntitiesOnly bool `json:"triggerActionsOnNewEntitiesOnly"` IgnorePreviousResults bool `json:"ignorePreviousResults"` - Labels []GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel `json:"labels"` QuestionId string `json:"questionId"` Question GetQuestionRuleInstanceQuestionRuleInstanceQuestionRuleQuestionDetails `json:"question"` Operations []RuleOperationOutput `json:"operations"` @@ -1891,11 +1890,6 @@ func (v *GetQuestionRuleInstanceQuestionRuleInstance) GetIgnorePreviousResults() return v.IgnorePreviousResults } -// GetLabels returns GetQuestionRuleInstanceQuestionRuleInstance.Labels, and is useful for accessing the field via an interface. -func (v *GetQuestionRuleInstanceQuestionRuleInstance) GetLabels() []GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel { - return v.Labels -} - // GetQuestionId returns GetQuestionRuleInstanceQuestionRuleInstance.QuestionId, and is useful for accessing the field via an interface. func (v *GetQuestionRuleInstanceQuestionRuleInstance) GetQuestionId() string { return v.QuestionId } @@ -1915,22 +1909,6 @@ func (v *GetQuestionRuleInstanceQuestionRuleInstance) GetOutputs() []string { re // GetTags returns GetQuestionRuleInstanceQuestionRuleInstance.Tags, and is useful for accessing the field via an interface. func (v *GetQuestionRuleInstanceQuestionRuleInstance) GetTags() []string { return v.Tags } -// GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel includes the requested fields of the GraphQL type RuleInstanceLabel. -type GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel struct { - LabelName string `json:"labelName"` - LabelValue map[string]interface{} `json:"labelValue"` -} - -// GetLabelName returns GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel.LabelName, and is useful for accessing the field via an interface. -func (v *GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel) GetLabelName() string { - return v.LabelName -} - -// GetLabelValue returns GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel.LabelValue, and is useful for accessing the field via an interface. -func (v *GetQuestionRuleInstanceQuestionRuleInstanceLabelsRuleInstanceLabel) GetLabelValue() map[string]interface{} { - return v.LabelValue -} - // GetQuestionRuleInstanceQuestionRuleInstanceQuestionRuleQuestionDetails includes the requested fields of the GraphQL type RuleQuestionDetails. type GetQuestionRuleInstanceQuestionRuleInstanceQuestionRuleQuestionDetails struct { Queries []GetQuestionRuleInstanceQuestionRuleInstanceQuestionRuleQuestionDetailsQueriesJ1Query `json:"queries"` @@ -2555,15 +2533,15 @@ func (v *RevokeInvitationUpdateInvitationIamInvitation) GetId() string { return func (v *RevokeInvitationUpdateInvitationIamInvitation) GetStatus() string { return v.Status } type RuleInstanceLabelInput struct { - LabelName string `json:"labelName"` - LabelValue map[string]interface{} `json:"labelValue"` + LabelName string `json:"labelName"` + LabelValue string `json:"labelValue"` } // GetLabelName returns RuleInstanceLabelInput.LabelName, and is useful for accessing the field via an interface. func (v *RuleInstanceLabelInput) GetLabelName() string { return v.LabelName } // GetLabelValue returns RuleInstanceLabelInput.LabelValue, and is useful for accessing the field via an interface. -func (v *RuleInstanceLabelInput) GetLabelValue() map[string]interface{} { return v.LabelValue } +func (v *RuleInstanceLabelInput) GetLabelValue() string { return v.LabelValue } type RuleInstanceType string @@ -5041,10 +5019,6 @@ query GetQuestionRuleInstance ($id: ID!) { notifyOnFailure triggerActionsOnNewEntitiesOnly ignorePreviousResults - labels { - labelName - labelValue - } questionId question { queries { diff --git a/jupiterone/internal/client/genqlient.yaml b/jupiterone/internal/client/genqlient.yaml index 095d6b1b..356433c0 100644 --- a/jupiterone/internal/client/genqlient.yaml +++ b/jupiterone/internal/client/genqlient.yaml @@ -21,7 +21,3 @@ bindings: type: string Long: type: int64 - # RuleInstanceLabelInput: - # type: map[string]interface{} - # RuleInstanceLabel: - # type: interface{} diff --git a/jupiterone/internal/client/rule.graphql b/jupiterone/internal/client/rule.graphql index d967eb58..f6570cd4 100644 --- a/jupiterone/internal/client/rule.graphql +++ b/jupiterone/internal/client/rule.graphql @@ -13,10 +13,6 @@ query GetQuestionRuleInstance($id: ID!) { notifyOnFailure triggerActionsOnNewEntitiesOnly ignorePreviousResults - labels { - labelName - labelValue - } questionId question { queries { diff --git a/jupiterone/resource_rule.go b/jupiterone/resource_rule.go index 82b5c5df..0380faa1 100644 --- a/jupiterone/resource_rule.go +++ b/jupiterone/resource_rule.go @@ -280,7 +280,7 @@ func (*QuestionRuleResource) Schema(ctx context.Context, req resource.SchemaRequ }, "label_value": schema.StringAttribute{ Required: true, - Description: "Value of the label, which is represented in TF as a string but can be a string, number or boolean", + Description: "Value of the label, which is represented in TF as a string but will be treated as string, number or boolean in the application", }, }, }, @@ -498,7 +498,6 @@ func (r *QuestionRuleResource) Read(ctx context.Context, req resource.ReadReques NotifyOnFailure: types.BoolValue(rule.NotifyOnFailure), TriggerOnNewOnly: types.BoolValue(rule.TriggerActionsOnNewEntitiesOnly), IgnorePreviousResults: types.BoolValue(rule.IgnorePreviousResults), - // TODO: Labels: rule.Labels, } // FIXME: handling of these JSON fields (map[string]interface{}) is not DRY @@ -656,14 +655,17 @@ func (r *RuleModel) BuildCreateReferencedQuestionRuleInstanceInput() (client.Cre return rule, err } - // TODO: temp - labels, err := json.Marshal(r.Labels) - if err != nil { - return rule, err - } - err = json.Unmarshal(labels, &rule.Labels) - if err != nil { - return rule, err + if len(r.Labels) > 0 { + labels := make([]client.RuleInstanceLabelInput, len(r.Labels)) + + for i, label := range r.Labels { + labels[i] = client.RuleInstanceLabelInput{ + LabelName: label.LabelName.ValueString(), + LabelValue: label.LabelValue.ValueString(), + } + } + + rule.Labels = labels } // FIXME: is roundtripping the best way? does it help with keeping @@ -702,6 +704,19 @@ func (r *RuleModel) BuildUpdateReferencedQuestionRuleInstanceInput() (client.Upd return rule, err } + if len(r.Labels) > 0 { + labels := make([]client.RuleInstanceLabelInput, len(r.Labels)) + + for i, label := range r.Labels { + labels[i] = client.RuleInstanceLabelInput{ + LabelName: label.LabelName.ValueString(), + LabelValue: label.LabelValue.ValueString(), + } + } + + rule.Labels = labels + } + // FIXME: is roundtripping the best way? does it help with keeping // config/state/server responses from being detected as different? templates, err := json.Marshal(r.Templates) @@ -741,25 +756,18 @@ func (r *RuleModel) BuildCreateInlineQuestionRuleInstanceInput() (client.CreateI return rule, err } - // Handle labels - // if len(r.Labels) > 0 { - // labels := make([]RuleLabel, len(r.Labels)) - - // for i, label := range r.Labels { - // labels[i] = RuleLabel{ - // LabelName: label.LabelName, - // LabelValue: label.LabelValue, - // } - // } + if len(r.Labels) > 0 { + labels := make([]client.RuleInstanceLabelInput, len(r.Labels)) - // // need to convert to correct type - // interfaceLabels := make([]interface{}, len(labels)) - // for i, label := range labels { - // interfaceLabels[i] = label - // } + for i, label := range r.Labels { + labels[i] = client.RuleInstanceLabelInput{ + LabelName: label.LabelName.ValueString(), + LabelValue: label.LabelValue.ValueString(), + } + } - // rule.Labels = interfaceLabels - // } + rule.Labels = labels + } // FIXME: is roundtripping the best way? does it help with keeping // config/state/server responses from being detected as different? @@ -812,6 +820,19 @@ func (r *RuleModel) BuildUpdateInlineQuestionRuleInstanceInput() (client.UpdateI return rule, err } + if len(r.Labels) > 0 { + labels := make([]client.RuleInstanceLabelInput, len(r.Labels)) + + for i, label := range r.Labels { + labels[i] = client.RuleInstanceLabelInput{ + LabelName: label.LabelName.ValueString(), + LabelValue: label.LabelValue.ValueString(), + } + } + + rule.Labels = labels + } + // FIXME: is roundtripping the best way? does it help with keeping // config/state/server responses from being detected as different? templates, err := json.Marshal(r.Templates) From 189df22c61e1a5210f9be263d0871a01bfd8157a Mon Sep 17 00:00:00 2001 From: Julia Zolotarev Date: Wed, 23 Oct 2024 10:50:43 -0400 Subject: [PATCH 4/5] APP-15731 - Re-record cassettes --- .../TestInlineRuleInstance_Basic.yaml | 421 +----------------- .../TestInlineRuleInstance_BasicImport.yaml | 187 +------- 2 files changed, 22 insertions(+), 586 deletions(-) diff --git a/jupiterone/cassettes/TestInlineRuleInstance_Basic.yaml b/jupiterone/cassettes/TestInlineRuleInstance_Basic.yaml index 6b7d6e1d..17666e73 100644 --- a/jupiterone/cassettes/TestInlineRuleInstance_Basic.yaml +++ b/jupiterone/cassettes/TestInlineRuleInstance_Basic.yaml @@ -6,20 +6,20 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1241 + content_length: 1329 transfer_encoding: [] trailer: {} - host: graphql.us.jupiterone.io + 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":[{"when":{"condition":"{{queries.query0.total != 0}}","specVersion":1,"type":"FILTER"},"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY"},{"type":"CREATE_ALERT"}]}],"outputs":["queries.query0.total","alertLevel"],"pollingInterval":"ONE_WEEK","notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":true,"ignorePreviousResults":false,"remediationSteps":"","j1Internal":false}},"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\tlabels {\n\t\t\tlabelName\n\t\t\tlabelValue\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":[{"when":{"condition":"{{queries.query0.total != 0}}","specVersion":1,"type":"FILTER"},"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY"},{"type":"CREATE_ALERT"}]}],"outputs":["queries.query0.total","alertLevel"],"pollingInterval":"ONE_WEEK","notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":true,"ignorePreviousResults":false,"remediationSteps":"","collectionId":"","labels":null,"j1Internal":false}},"operationName":"CreateInlineQuestionRuleInstance"}' form: {} headers: Cache-Control: - no-cache Content-Type: - application/json - url: https://graphql.us.jupiterone.io/ + url: https://graphql.US.jupiterone.io/ method: POST response: proto: HTTP/2.0 @@ -27,409 +27,18 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 623 + content_length: 12 uncompressed: false - body: | - {"data":{"createQuestionRuleInstance":{"id":"d60ce635-56a3-409a-9fdd-7382c68c48e2","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":[{"when":{"condition":"{{queries.query0.total != 0}}","specVersion":1,"type":"FILTER"},"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY","id":"d72a63b0-400c-4461-8196-d9a6fda9e80b"},{"type":"CREATE_ALERT","id":"8fc45c32-a616-460a-967d-fb1e41bca533"}]}]}}} + body: Unauthorized headers: Access-Control-Allow-Credentials: - "true" Content-Length: - - "623" + - "12" 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: - - application/json - Cross-Origin-Embedder-Policy: - - require-corp - Cross-Origin-Opener-Policy: - - same-origin - Cross-Origin-Resource-Policy: - - same-origin - Expect-Ct: - - max-age=0 - Origin-Agent-Cluster: - - ?1 - Ratelimit-Limit: - - "1000" - Ratelimit-Remaining: - - "999" - Ratelimit-Requested: - - "1" - Ratelimit-Reset: - - "1" - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Xss-Protection: - - "0" - status: 200 OK - code: 200 - duration: 1.39989s - - id: 1 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - 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\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":"d60ce635-56a3-409a-9fdd-7382c68c48e2"},"operationName":"GetQuestionRuleInstance"}' - form: {} - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json - url: https://graphql.us.jupiterone.io/ - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: 953 - uncompressed: false - body: | - {"data":{"questionRuleInstance":{"id":"d60ce635-56a3-409a-9fdd-7382c68c48e2","name":"tf-provider-test-rule","description":"Test","version":1,"specVersion":1,"latest":true,"pollingInterval":"ONE_WEEK","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":true,"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":[{"when":{"type":"FILTER","condition":"{{queries.query0.total != 0}}","specVersion":1},"actions":[{"targetValue":"HIGH","id":"d72a63b0-400c-4461-8196-d9a6fda9e80b","type":"SET_PROPERTY","targetProperty":"alertLevel"},{"type":"CREATE_ALERT","id":"8fc45c32-a616-460a-967d-fb1e41bca533"}]}],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}} - headers: - Access-Control-Allow-Credentials: - - "true" - Content-Length: - - "953" - 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: - - application/json - Cross-Origin-Embedder-Policy: - - require-corp - Cross-Origin-Opener-Policy: - - same-origin - Cross-Origin-Resource-Policy: - - same-origin - Expect-Ct: - - max-age=0 - Origin-Agent-Cluster: - - ?1 - Ratelimit-Limit: - - "1000" - Ratelimit-Remaining: - - "999" - Ratelimit-Requested: - - "1" - Ratelimit-Reset: - - "1" - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Xss-Protection: - - "0" - status: 200 OK - code: 200 - duration: 210.564917ms - - id: 2 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - 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\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":"d60ce635-56a3-409a-9fdd-7382c68c48e2"},"operationName":"GetQuestionRuleInstance"}' - form: {} - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json - url: https://graphql.us.jupiterone.io/ - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: 953 - uncompressed: false - body: | - {"data":{"questionRuleInstance":{"id":"d60ce635-56a3-409a-9fdd-7382c68c48e2","name":"tf-provider-test-rule","description":"Test","version":1,"specVersion":1,"latest":true,"pollingInterval":"ONE_WEEK","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":true,"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":[{"when":{"type":"FILTER","condition":"{{queries.query0.total != 0}}","specVersion":1},"actions":[{"targetValue":"HIGH","id":"d72a63b0-400c-4461-8196-d9a6fda9e80b","type":"SET_PROPERTY","targetProperty":"alertLevel"},{"type":"CREATE_ALERT","id":"8fc45c32-a616-460a-967d-fb1e41bca533"}]}],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}} - headers: - Access-Control-Allow-Credentials: - - "true" - Content-Length: - - "953" - 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: - - application/json - Cross-Origin-Embedder-Policy: - - require-corp - Cross-Origin-Opener-Policy: - - same-origin - Cross-Origin-Resource-Policy: - - same-origin - Expect-Ct: - - max-age=0 - Origin-Agent-Cluster: - - ?1 - Ratelimit-Limit: - - "1000" - Ratelimit-Remaining: - - "999" - Ratelimit-Requested: - - "1" - Ratelimit-Reset: - - "1" - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Xss-Protection: - - "0" - status: 200 OK - code: 200 - duration: 203.527208ms - - id: 3 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 1041 - transfer_encoding: [] - trailer: {} - host: graphql.us.jupiterone.io - remote_addr: "" - request_uri: "" - body: '{"query":"\nmutation UpdateInlineQuestionRuleInstance ($instance: UpdateInlineQuestionRuleInstanceInput!) {\n\tupdateInlineQuestionRuleInstance(instance: $instance) {\n\t\tversion\n\t\tspecVersion\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}]},"id":"d60ce635-56a3-409a-9fdd-7382c68c48e2","version":1,"state":{"actions":null},"templates":null,"tags":["tf_acc:1","tf_acc:2"],"name":"tf-provider-test-rule","description":"Test","specVersion":1,"operations":[{"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY"},{"type":"CREATE_ALERT"}]}],"outputs":["queries.query0.total","alertLevel"],"pollingInterval":"ONE_WEEK","notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":true,"ignorePreviousResults":false}},"operationName":"UpdateInlineQuestionRuleInstance"}' - form: {} - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json - url: https://graphql.us.jupiterone.io/ - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: 304 - uncompressed: false - body: | - {"data":{"updateInlineQuestionRuleInstance":{"version":2,"specVersion":1,"operations":[{"when":null,"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY","id":"1d35768f-4ffd-4a0c-b55b-1f9749d6ce32"},{"type":"CREATE_ALERT","id":"dbf14332-def8-4895-96f6-52707404c121"}]}]}}} - headers: - Access-Control-Allow-Credentials: - - "true" - Content-Length: - - "304" - 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: - - application/json - Cross-Origin-Embedder-Policy: - - require-corp - Cross-Origin-Opener-Policy: - - same-origin - Cross-Origin-Resource-Policy: - - same-origin - Expect-Ct: - - max-age=0 - Origin-Agent-Cluster: - - ?1 - Ratelimit-Limit: - - "1000" - Ratelimit-Remaining: - - "999" - Ratelimit-Requested: - - "1" - Ratelimit-Reset: - - "1" - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Xss-Protection: - - "0" - status: 200 OK - code: 200 - duration: 452.12475ms - - id: 4 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - 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\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":"d60ce635-56a3-409a-9fdd-7382c68c48e2"},"operationName":"GetQuestionRuleInstance"}' - form: {} - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json - url: https://graphql.us.jupiterone.io/ - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: 880 - uncompressed: false - body: | - {"data":{"questionRuleInstance":{"id":"d60ce635-56a3-409a-9fdd-7382c68c48e2","name":"tf-provider-test-rule","description":"Test","version":2,"specVersion":1,"latest":true,"pollingInterval":"ONE_WEEK","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":true,"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":[{"when":null,"actions":[{"targetValue":"HIGH","id":"1d35768f-4ffd-4a0c-b55b-1f9749d6ce32","type":"SET_PROPERTY","targetProperty":"alertLevel"},{"type":"CREATE_ALERT","id":"dbf14332-def8-4895-96f6-52707404c121"}]}],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}} - headers: - Access-Control-Allow-Credentials: - - "true" - Content-Length: - - "880" - 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: - - application/json - Cross-Origin-Embedder-Policy: - - require-corp - Cross-Origin-Opener-Policy: - - same-origin - Cross-Origin-Resource-Policy: - - same-origin - Expect-Ct: - - max-age=0 - Origin-Agent-Cluster: - - ?1 - Ratelimit-Limit: - - "1000" - Ratelimit-Remaining: - - "999" - Ratelimit-Requested: - - "1" - Ratelimit-Reset: - - "1" - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Xss-Protection: - - "0" - status: 200 OK - code: 200 - duration: 415.201334ms - - id: 5 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 200 - transfer_encoding: [] - trailer: {} - 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":"d60ce635-56a3-409a-9fdd-7382c68c48e2"},"operationName":"DeleteRuleInstance"}' - form: {} - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json - url: https://graphql.us.jupiterone.io/ - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: 78 - uncompressed: false - body: | - {"data":{"deleteRuleInstance":{"id":"d60ce635-56a3-409a-9fdd-7382c68c48e2"}}} - headers: - Access-Control-Allow-Credentials: - - "true" - Content-Length: - - "78" - 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: - - application/json + - text/plain; charset=utf-8 Cross-Origin-Embedder-Policy: - require-corp Cross-Origin-Opener-Policy: @@ -440,14 +49,6 @@ interactions: - max-age=0 Origin-Agent-Cluster: - ?1 - Ratelimit-Limit: - - "1000" - Ratelimit-Remaining: - - "999" - Ratelimit-Requested: - - "1" - Ratelimit-Reset: - - "1" Referrer-Policy: - no-referrer Strict-Transport-Security: @@ -466,6 +67,6 @@ interactions: - none X-Xss-Protection: - "0" - status: 200 OK - code: 200 - duration: 221.148792ms + status: 401 Unauthorized + code: 401 + duration: 214.218417ms diff --git a/jupiterone/cassettes/TestInlineRuleInstance_BasicImport.yaml b/jupiterone/cassettes/TestInlineRuleInstance_BasicImport.yaml index ccf1bca5..0246746e 100644 --- a/jupiterone/cassettes/TestInlineRuleInstance_BasicImport.yaml +++ b/jupiterone/cassettes/TestInlineRuleInstance_BasicImport.yaml @@ -6,20 +6,20 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1044 + content_length: 1132 transfer_encoding: [] trailer: {} - host: graphql.us.jupiterone.io + 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,"ignorePreviousResults":false,"remediationSteps":"","j1Internal":false}},"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\tlabels {\n\t\t\tlabelName\n\t\t\tlabelValue\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":"","collectionId":"","labels":null,"j1Internal":false}},"operationName":"CreateInlineQuestionRuleInstance"}' form: {} headers: Cache-Control: - no-cache Content-Type: - application/json - url: https://graphql.us.jupiterone.io/ + url: https://graphql.US.jupiterone.io/ method: POST response: proto: HTTP/2.0 @@ -27,175 +27,18 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 338 + content_length: 12 uncompressed: false - body: | - {"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":[]}}} + body: Unauthorized headers: Access-Control-Allow-Credentials: - "true" Content-Length: - - "338" + - "12" 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: - - application/json - Cross-Origin-Embedder-Policy: - - require-corp - Cross-Origin-Opener-Policy: - - same-origin - Cross-Origin-Resource-Policy: - - same-origin - Expect-Ct: - - max-age=0 - Origin-Agent-Cluster: - - ?1 - Ratelimit-Limit: - - "1000" - Ratelimit-Remaining: - - "999" - Ratelimit-Requested: - - "1" - Ratelimit-Reset: - - "1" - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Xss-Protection: - - "0" - status: 200 OK - code: 200 - duration: 683.644792ms - - id: 1 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - 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\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: - - no-cache - Content-Type: - - application/json - url: https://graphql.us.jupiterone.io/ - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: 668 - uncompressed: false - body: | - {"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: - - "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: - - application/json - Cross-Origin-Embedder-Policy: - - require-corp - Cross-Origin-Opener-Policy: - - same-origin - Cross-Origin-Resource-Policy: - - same-origin - Expect-Ct: - - max-age=0 - Origin-Agent-Cluster: - - ?1 - Ratelimit-Limit: - - "1000" - Ratelimit-Remaining: - - "999" - Ratelimit-Requested: - - "1" - Ratelimit-Reset: - - "1" - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Xss-Protection: - - "0" - status: 200 OK - code: 200 - duration: 206.76975ms - - id: 2 - request: - proto: HTTP/1.1 - proto_major: 1 - proto_minor: 1 - content_length: 200 - transfer_encoding: [] - trailer: {} - 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":"c8649b0d-362d-4246-ba79-1d54b1e13cba"},"operationName":"DeleteRuleInstance"}' - form: {} - headers: - Cache-Control: - - no-cache - Content-Type: - - application/json - url: https://graphql.us.jupiterone.io/ - method: POST - response: - proto: HTTP/2.0 - proto_major: 2 - proto_minor: 0 - transfer_encoding: [] - trailer: {} - content_length: 78 - uncompressed: false - body: | - {"data":{"deleteRuleInstance":{"id":"c8649b0d-362d-4246-ba79-1d54b1e13cba"}}} - headers: - Access-Control-Allow-Credentials: - - "true" - Content-Length: - - "78" - 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: - - application/json + - text/plain; charset=utf-8 Cross-Origin-Embedder-Policy: - require-corp Cross-Origin-Opener-Policy: @@ -206,14 +49,6 @@ interactions: - max-age=0 Origin-Agent-Cluster: - ?1 - Ratelimit-Limit: - - "1000" - Ratelimit-Remaining: - - "999" - Ratelimit-Requested: - - "1" - Ratelimit-Reset: - - "1" Referrer-Policy: - no-referrer Strict-Transport-Security: @@ -232,6 +67,6 @@ interactions: - none X-Xss-Protection: - "0" - status: 200 OK - code: 200 - duration: 266.413584ms + status: 401 Unauthorized + code: 401 + duration: 175.596125ms From a9115105c5b571051360aa19e58daaf615ae4ff1 Mon Sep 17 00:00:00 2001 From: Julia Zolotarev Date: Wed, 23 Oct 2024 11:00:48 -0400 Subject: [PATCH 5/5] APP-15731 - Re-record cassettes with correct api key --- .../TestInlineRuleInstance_Basic.yaml | 417 +++++++++++++++++- .../TestInlineRuleInstance_BasicImport.yaml | 183 +++++++- .../TestReferencedQuestionRule_Basic.yaml | 104 ++--- 3 files changed, 634 insertions(+), 70 deletions(-) diff --git a/jupiterone/cassettes/TestInlineRuleInstance_Basic.yaml b/jupiterone/cassettes/TestInlineRuleInstance_Basic.yaml index 17666e73..37b042a8 100644 --- a/jupiterone/cassettes/TestInlineRuleInstance_Basic.yaml +++ b/jupiterone/cassettes/TestInlineRuleInstance_Basic.yaml @@ -9,7 +9,7 @@ interactions: content_length: 1329 transfer_encoding: [] trailer: {} - host: graphql.US.jupiterone.io + 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\tlabels {\n\t\t\tlabelName\n\t\t\tlabelValue\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":[{"when":{"condition":"{{queries.query0.total != 0}}","specVersion":1,"type":"FILTER"},"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY"},{"type":"CREATE_ALERT"}]}],"outputs":["queries.query0.total","alertLevel"],"pollingInterval":"ONE_WEEK","notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":true,"ignorePreviousResults":false,"remediationSteps":"","collectionId":"","labels":null,"j1Internal":false}},"operationName":"CreateInlineQuestionRuleInstance"}' @@ -19,7 +19,7 @@ interactions: - no-cache Content-Type: - application/json - url: https://graphql.US.jupiterone.io/ + url: https://graphql.us.jupiterone.io/ method: POST response: proto: HTTP/2.0 @@ -27,18 +27,409 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 12 + content_length: 635 uncompressed: false - body: Unauthorized + body: | + {"data":{"createQuestionRuleInstance":{"id":"d4ebcdb5-7bea-4e4e-9fd7-fd0b677ea2cc","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":[{"when":{"condition":"{{queries.query0.total != 0}}","specVersion":1,"type":"FILTER"},"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY","id":"c441b02c-32f3-4059-8786-2ab7de31924e"},{"type":"CREATE_ALERT","id":"468fa7af-c92f-47b5-a795-fe6d44af0d55"}]}],"labels":[]}}} headers: Access-Control-Allow-Credentials: - "true" Content-Length: - - "12" + - "635" 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: - - text/plain; charset=utf-8 + - application/json + Cross-Origin-Embedder-Policy: + - require-corp + Cross-Origin-Opener-Policy: + - same-origin + Cross-Origin-Resource-Policy: + - same-origin + Expect-Ct: + - max-age=0 + Origin-Agent-Cluster: + - ?1 + Ratelimit-Limit: + - "1000" + Ratelimit-Remaining: + - "999" + Ratelimit-Requested: + - "1" + Ratelimit-Reset: + - "1" + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + Vary: + - Origin + X-Content-Type-Options: + - nosniff + X-Dns-Prefetch-Control: + - "off" + X-Download-Options: + - noopen + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 1.028570958s + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + 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\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":"d4ebcdb5-7bea-4e4e-9fd7-fd0b677ea2cc"},"operationName":"GetQuestionRuleInstance"}' + form: {} + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json + url: https://graphql.us.jupiterone.io/ + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 953 + uncompressed: false + body: | + {"data":{"questionRuleInstance":{"id":"d4ebcdb5-7bea-4e4e-9fd7-fd0b677ea2cc","name":"tf-provider-test-rule","description":"Test","version":1,"specVersion":1,"latest":true,"pollingInterval":"ONE_WEEK","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":true,"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":[{"when":{"type":"FILTER","condition":"{{queries.query0.total != 0}}","specVersion":1},"actions":[{"targetValue":"HIGH","id":"c441b02c-32f3-4059-8786-2ab7de31924e","type":"SET_PROPERTY","targetProperty":"alertLevel"},{"type":"CREATE_ALERT","id":"468fa7af-c92f-47b5-a795-fe6d44af0d55"}]}],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}} + headers: + Access-Control-Allow-Credentials: + - "true" + Content-Length: + - "953" + 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: + - application/json + Cross-Origin-Embedder-Policy: + - require-corp + Cross-Origin-Opener-Policy: + - same-origin + Cross-Origin-Resource-Policy: + - same-origin + Expect-Ct: + - max-age=0 + Origin-Agent-Cluster: + - ?1 + Ratelimit-Limit: + - "1000" + Ratelimit-Remaining: + - "999" + Ratelimit-Requested: + - "1" + Ratelimit-Reset: + - "1" + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + Vary: + - Origin + X-Content-Type-Options: + - nosniff + X-Dns-Prefetch-Control: + - "off" + X-Download-Options: + - noopen + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 194.109083ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + 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\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":"d4ebcdb5-7bea-4e4e-9fd7-fd0b677ea2cc"},"operationName":"GetQuestionRuleInstance"}' + form: {} + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json + url: https://graphql.us.jupiterone.io/ + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 953 + uncompressed: false + body: | + {"data":{"questionRuleInstance":{"id":"d4ebcdb5-7bea-4e4e-9fd7-fd0b677ea2cc","name":"tf-provider-test-rule","description":"Test","version":1,"specVersion":1,"latest":true,"pollingInterval":"ONE_WEEK","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":true,"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":[{"when":{"type":"FILTER","condition":"{{queries.query0.total != 0}}","specVersion":1},"actions":[{"targetValue":"HIGH","id":"c441b02c-32f3-4059-8786-2ab7de31924e","type":"SET_PROPERTY","targetProperty":"alertLevel"},{"type":"CREATE_ALERT","id":"468fa7af-c92f-47b5-a795-fe6d44af0d55"}]}],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}} + headers: + Access-Control-Allow-Credentials: + - "true" + Content-Length: + - "953" + 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: + - application/json + Cross-Origin-Embedder-Policy: + - require-corp + Cross-Origin-Opener-Policy: + - same-origin + Cross-Origin-Resource-Policy: + - same-origin + Expect-Ct: + - max-age=0 + Origin-Agent-Cluster: + - ?1 + Ratelimit-Limit: + - "1000" + Ratelimit-Remaining: + - "999" + Ratelimit-Requested: + - "1" + Ratelimit-Reset: + - "1" + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + Vary: + - Origin + X-Content-Type-Options: + - nosniff + X-Dns-Prefetch-Control: + - "off" + X-Download-Options: + - noopen + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 187.93225ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 1073 + transfer_encoding: [] + trailer: {} + host: graphql.us.jupiterone.io + remote_addr: "" + request_uri: "" + body: '{"query":"\nmutation UpdateInlineQuestionRuleInstance ($instance: UpdateInlineQuestionRuleInstanceInput!) {\n\tupdateInlineQuestionRuleInstance(instance: $instance) {\n\t\tversion\n\t\tspecVersion\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}]},"id":"d4ebcdb5-7bea-4e4e-9fd7-fd0b677ea2cc","version":1,"state":{"actions":null},"templates":null,"tags":["tf_acc:1","tf_acc:2"],"name":"tf-provider-test-rule","description":"Test","specVersion":1,"operations":[{"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY"},{"type":"CREATE_ALERT"}]}],"outputs":["queries.query0.total","alertLevel"],"pollingInterval":"ONE_WEEK","notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":true,"ignorePreviousResults":false,"collectionId":"","labels":null}},"operationName":"UpdateInlineQuestionRuleInstance"}' + form: {} + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json + url: https://graphql.us.jupiterone.io/ + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 304 + uncompressed: false + body: | + {"data":{"updateInlineQuestionRuleInstance":{"version":2,"specVersion":1,"operations":[{"when":null,"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY","id":"595397fc-f7f5-4fbd-936b-1a7ad5ae88ae"},{"type":"CREATE_ALERT","id":"69e7809d-8003-44d8-9a9b-d277868e079a"}]}]}}} + headers: + Access-Control-Allow-Credentials: + - "true" + Content-Length: + - "304" + 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: + - application/json + Cross-Origin-Embedder-Policy: + - require-corp + Cross-Origin-Opener-Policy: + - same-origin + Cross-Origin-Resource-Policy: + - same-origin + Expect-Ct: + - max-age=0 + Origin-Agent-Cluster: + - ?1 + Ratelimit-Limit: + - "1000" + Ratelimit-Remaining: + - "999" + Ratelimit-Requested: + - "1" + Ratelimit-Reset: + - "1" + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + Vary: + - Origin + X-Content-Type-Options: + - nosniff + X-Dns-Prefetch-Control: + - "off" + X-Download-Options: + - noopen + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 629.056375ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + 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\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":"d4ebcdb5-7bea-4e4e-9fd7-fd0b677ea2cc"},"operationName":"GetQuestionRuleInstance"}' + form: {} + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json + url: https://graphql.us.jupiterone.io/ + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 880 + uncompressed: false + body: | + {"data":{"questionRuleInstance":{"id":"d4ebcdb5-7bea-4e4e-9fd7-fd0b677ea2cc","name":"tf-provider-test-rule","description":"Test","version":2,"specVersion":1,"latest":true,"pollingInterval":"ONE_WEEK","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":true,"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":[{"when":null,"actions":[{"targetValue":"HIGH","id":"595397fc-f7f5-4fbd-936b-1a7ad5ae88ae","type":"SET_PROPERTY","targetProperty":"alertLevel"},{"type":"CREATE_ALERT","id":"69e7809d-8003-44d8-9a9b-d277868e079a"}]}],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}} + headers: + Access-Control-Allow-Credentials: + - "true" + Content-Length: + - "880" + 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: + - application/json + Cross-Origin-Embedder-Policy: + - require-corp + Cross-Origin-Opener-Policy: + - same-origin + Cross-Origin-Resource-Policy: + - same-origin + Expect-Ct: + - max-age=0 + Origin-Agent-Cluster: + - ?1 + Ratelimit-Limit: + - "1000" + Ratelimit-Remaining: + - "999" + Ratelimit-Requested: + - "1" + Ratelimit-Reset: + - "1" + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + Vary: + - Origin + X-Content-Type-Options: + - nosniff + X-Dns-Prefetch-Control: + - "off" + X-Download-Options: + - noopen + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 201.418416ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 200 + transfer_encoding: [] + trailer: {} + 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":"d4ebcdb5-7bea-4e4e-9fd7-fd0b677ea2cc"},"operationName":"DeleteRuleInstance"}' + form: {} + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json + url: https://graphql.us.jupiterone.io/ + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 78 + uncompressed: false + body: | + {"data":{"deleteRuleInstance":{"id":"d4ebcdb5-7bea-4e4e-9fd7-fd0b677ea2cc"}}} + headers: + Access-Control-Allow-Credentials: + - "true" + Content-Length: + - "78" + 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: + - application/json Cross-Origin-Embedder-Policy: - require-corp Cross-Origin-Opener-Policy: @@ -49,6 +440,14 @@ interactions: - max-age=0 Origin-Agent-Cluster: - ?1 + Ratelimit-Limit: + - "1000" + Ratelimit-Remaining: + - "999" + Ratelimit-Requested: + - "1" + Ratelimit-Reset: + - "1" Referrer-Policy: - no-referrer Strict-Transport-Security: @@ -67,6 +466,6 @@ interactions: - none X-Xss-Protection: - "0" - status: 401 Unauthorized - code: 401 - duration: 214.218417ms + status: 200 OK + code: 200 + duration: 234.444ms diff --git a/jupiterone/cassettes/TestInlineRuleInstance_BasicImport.yaml b/jupiterone/cassettes/TestInlineRuleInstance_BasicImport.yaml index 0246746e..e4bbe97d 100644 --- a/jupiterone/cassettes/TestInlineRuleInstance_BasicImport.yaml +++ b/jupiterone/cassettes/TestInlineRuleInstance_BasicImport.yaml @@ -9,7 +9,7 @@ interactions: content_length: 1132 transfer_encoding: [] trailer: {} - host: graphql.US.jupiterone.io + 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\tlabels {\n\t\t\tlabelName\n\t\t\tlabelValue\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":"","collectionId":"","labels":null,"j1Internal":false}},"operationName":"CreateInlineQuestionRuleInstance"}' @@ -19,7 +19,7 @@ interactions: - no-cache Content-Type: - application/json - url: https://graphql.US.jupiterone.io/ + url: https://graphql.us.jupiterone.io/ method: POST response: proto: HTTP/2.0 @@ -27,18 +27,175 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 12 + content_length: 350 uncompressed: false - body: Unauthorized + body: | + {"data":{"createQuestionRuleInstance":{"id":"81a8c676-7155-4f4f-b755-9eab08be21ea","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":[],"labels":[]}}} headers: Access-Control-Allow-Credentials: - "true" Content-Length: - - "12" + - "350" 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: - - text/plain; charset=utf-8 + - application/json + Cross-Origin-Embedder-Policy: + - require-corp + Cross-Origin-Opener-Policy: + - same-origin + Cross-Origin-Resource-Policy: + - same-origin + Expect-Ct: + - max-age=0 + Origin-Agent-Cluster: + - ?1 + Ratelimit-Limit: + - "1000" + Ratelimit-Remaining: + - "999" + Ratelimit-Requested: + - "1" + Ratelimit-Reset: + - "1" + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + Vary: + - Origin + X-Content-Type-Options: + - nosniff + X-Dns-Prefetch-Control: + - "off" + X-Download-Options: + - noopen + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 609.287625ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + 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\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":"81a8c676-7155-4f4f-b755-9eab08be21ea"},"operationName":"GetQuestionRuleInstance"}' + form: {} + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json + url: https://graphql.us.jupiterone.io/ + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 668 + uncompressed: false + body: | + {"data":{"questionRuleInstance":{"id":"81a8c676-7155-4f4f-b755-9eab08be21ea","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: + - "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: + - application/json + Cross-Origin-Embedder-Policy: + - require-corp + Cross-Origin-Opener-Policy: + - same-origin + Cross-Origin-Resource-Policy: + - same-origin + Expect-Ct: + - max-age=0 + Origin-Agent-Cluster: + - ?1 + Ratelimit-Limit: + - "1000" + Ratelimit-Remaining: + - "999" + Ratelimit-Requested: + - "1" + Ratelimit-Reset: + - "1" + Referrer-Policy: + - no-referrer + Strict-Transport-Security: + - max-age=15552000; includeSubDomains + Vary: + - Origin + X-Content-Type-Options: + - nosniff + X-Dns-Prefetch-Control: + - "off" + X-Download-Options: + - noopen + X-Frame-Options: + - SAMEORIGIN + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - "0" + status: 200 OK + code: 200 + duration: 188.905125ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 200 + transfer_encoding: [] + trailer: {} + 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":"81a8c676-7155-4f4f-b755-9eab08be21ea"},"operationName":"DeleteRuleInstance"}' + form: {} + headers: + Cache-Control: + - no-cache + Content-Type: + - application/json + url: https://graphql.us.jupiterone.io/ + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [] + trailer: {} + content_length: 78 + uncompressed: false + body: | + {"data":{"deleteRuleInstance":{"id":"81a8c676-7155-4f4f-b755-9eab08be21ea"}}} + headers: + Access-Control-Allow-Credentials: + - "true" + Content-Length: + - "78" + 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: + - application/json Cross-Origin-Embedder-Policy: - require-corp Cross-Origin-Opener-Policy: @@ -49,6 +206,14 @@ interactions: - max-age=0 Origin-Agent-Cluster: - ?1 + Ratelimit-Limit: + - "1000" + Ratelimit-Remaining: + - "999" + Ratelimit-Requested: + - "1" + Ratelimit-Reset: + - "1" Referrer-Policy: - no-referrer Strict-Transport-Security: @@ -67,6 +232,6 @@ interactions: - none X-Xss-Protection: - "0" - status: 401 Unauthorized - code: 401 - duration: 175.596125ms + status: 200 OK + code: 200 + duration: 200.725ms diff --git a/jupiterone/cassettes/TestReferencedQuestionRule_Basic.yaml b/jupiterone/cassettes/TestReferencedQuestionRule_Basic.yaml index 7d017729..1f772abb 100644 --- a/jupiterone/cassettes/TestReferencedQuestionRule_Basic.yaml +++ b/jupiterone/cassettes/TestReferencedQuestionRule_Basic.yaml @@ -30,7 +30,7 @@ interactions: content_length: 74 uncompressed: false body: | - {"data":{"createQuestion":{"id":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9"}}} + {"data":{"createQuestion":{"id":"a4a81b66-72f6-4373-8999-9b26c5aa7d02"}}} headers: Access-Control-Allow-Credentials: - "true" @@ -78,19 +78,19 @@ interactions: - "0" status: 200 OK code: 200 - duration: 1.103059583s + duration: 722.541958ms - id: 1 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 934 + content_length: 996 transfer_encoding: [] trailer: {} host: graphql.us.jupiterone.io remote_addr: "" request_uri: "" - body: '{"query":"\nmutation CreateReferencedQuestionRuleInstance ($instance: CreateReferencedQuestionRuleInstanceInput!) {\n\tcreateQuestionRuleInstance: createReferencedQuestionRuleInstance(instance: $instance) {\n\t\tid\n\t\tversion\n\t\tspecVersion\n\t\toperations {\n\t\t\twhen\n\t\t\tactions\n\t\t}\n\t}\n}\n","variables":{"instance":{"questionId":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9","templates":null,"tags":["tf_acc:1","tf_acc:2"],"name":"tf-provider-test-rule","description":"Test","specVersion":1,"operations":[{"when":{"condition":"{{queries.query0.total != 0}}","specVersion":1,"type":"FILTER"},"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY"},{"type":"CREATE_ALERT"}]}],"outputs":["queries.query0.total","alertLevel"],"pollingInterval":"ONE_WEEK","notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"remediationSteps":""}},"operationName":"CreateReferencedQuestionRuleInstance"}' + body: '{"query":"\nmutation CreateReferencedQuestionRuleInstance ($instance: CreateReferencedQuestionRuleInstanceInput!) {\n\tcreateQuestionRuleInstance: createReferencedQuestionRuleInstance(instance: $instance) {\n\t\tid\n\t\tversion\n\t\tspecVersion\n\t\toperations {\n\t\t\twhen\n\t\t\tactions\n\t\t}\n\t}\n}\n","variables":{"instance":{"questionId":"a4a81b66-72f6-4373-8999-9b26c5aa7d02","templates":null,"tags":["tf_acc:1","tf_acc:2"],"name":"tf-provider-test-rule","description":"Test","specVersion":1,"operations":[{"when":{"condition":"{{queries.query0.total != 0}}","specVersion":1,"type":"FILTER"},"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY"},{"type":"CREATE_ALERT"}]}],"outputs":["queries.query0.total","alertLevel"],"pollingInterval":"ONE_WEEK","notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"ignorePreviousResults":false,"remediationSteps":"","collectionId":"","labels":null}},"operationName":"CreateReferencedQuestionRuleInstance"}' form: {} headers: Cache-Control: @@ -108,7 +108,7 @@ interactions: content_length: 415 uncompressed: false body: | - {"data":{"createQuestionRuleInstance":{"id":"1397b823-a6b0-487f-805e-bc2d20de9cf8","version":1,"specVersion":1,"operations":[{"when":{"condition":"{{queries.query0.total != 0}}","specVersion":1,"type":"FILTER"},"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY","id":"ac2334ac-eb35-4704-84b2-68ab535e1b01"},{"type":"CREATE_ALERT","id":"ff831c5b-601e-4266-b6d9-5cb4f9caa2bc"}]}]}}} + {"data":{"createQuestionRuleInstance":{"id":"5101a668-a7d9-463d-9d74-64c91b3f2d10","version":1,"specVersion":1,"operations":[{"when":{"condition":"{{queries.query0.total != 0}}","specVersion":1,"type":"FILTER"},"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY","id":"6de9cc35-e43d-45eb-899c-a53b134ec596"},{"type":"CREATE_ALERT","id":"1bc23598-5a44-4698-baf0-062d8b7779b5"}]}]}}} headers: Access-Control-Allow-Credentials: - "true" @@ -156,19 +156,19 @@ interactions: - "0" status: 200 OK code: 200 - duration: 1.398354959s + duration: 966.789792ms - id: 2 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 419 + content_length: 434 transfer_encoding: [] trailer: {} host: graphql.us.jupiterone.io remote_addr: "" request_uri: "" - body: '{"query":"\nquery GetQuestionById ($id: ID!) {\n\tquestion(id: $id) {\n\t\tid\n\t\ttitle\n\t\tdescription\n\t\tpollingInterval\n\t\tqueries {\n\t\t\tname\n\t\t\tquery\n\t\t\tversion\n\t\t\tincludeDeleted\n\t\t\tresultsAre\n\t\t}\n\t\ttags\n\t\tcompliance {\n\t\t\tstandard\n\t\t\trequirements\n\t\t\tcontrols\n\t\t}\n\t}\n}\n","variables":{"id":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9"},"operationName":"GetQuestionById"}' + body: '{"query":"\nquery GetQuestionById ($id: ID!) {\n\tquestion(id: $id) {\n\t\tid\n\t\ttitle\n\t\tdescription\n\t\tshowTrend\n\t\tpollingInterval\n\t\tqueries {\n\t\t\tname\n\t\t\tquery\n\t\t\tversion\n\t\t\tincludeDeleted\n\t\t\tresultsAre\n\t\t}\n\t\ttags\n\t\tcompliance {\n\t\t\tstandard\n\t\t\trequirements\n\t\t\tcontrols\n\t\t}\n\t}\n}\n","variables":{"id":"a4a81b66-72f6-4373-8999-9b26c5aa7d02"},"operationName":"GetQuestionById"}' form: {} headers: Cache-Control: @@ -183,15 +183,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 418 + content_length: 436 uncompressed: false body: | - {"data":{"question":{"id":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9","title":"tf-provider-test-rule","description":"Test","pollingInterval":"ONE_DAY","queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false,"resultsAre":"INFORMATIVE"}],"tags":["tf_acc:1","tf_acc:2"],"compliance":[]}}} + {"data":{"question":{"id":"a4a81b66-72f6-4373-8999-9b26c5aa7d02","title":"tf-provider-test-rule","description":"Test","showTrend":false,"pollingInterval":"ONE_DAY","queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false,"resultsAre":"INFORMATIVE"}],"tags":["tf_acc:1","tf_acc:2"],"compliance":[]}}} headers: Access-Control-Allow-Credentials: - "true" Content-Length: - - "418" + - "436" 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: @@ -234,19 +234,19 @@ interactions: - "0" status: 200 OK code: 200 - duration: 393.670209ms + duration: 248.231791ms - id: 3 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":"1397b823-a6b0-487f-805e-bc2d20de9cf8"},"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":"5101a668-a7d9-463d-9d74-64c91b3f2d10"},"operationName":"GetQuestionRuleInstance"}' form: {} headers: Cache-Control: @@ -261,15 +261,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 766 + content_length: 796 uncompressed: false body: | - {"data":{"questionRuleInstance":{"id":"1397b823-a6b0-487f-805e-bc2d20de9cf8","name":"tf-provider-test-rule","description":"Test","version":1,"specVersion":1,"latest":true,"pollingInterval":"ONE_WEEK","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"questionId":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9","question":null,"operations":[{"when":{"type":"FILTER","condition":"{{queries.query0.total != 0}}","specVersion":1},"actions":[{"targetValue":"HIGH","id":"ac2334ac-eb35-4704-84b2-68ab535e1b01","type":"SET_PROPERTY","targetProperty":"alertLevel"},{"type":"CREATE_ALERT","id":"ff831c5b-601e-4266-b6d9-5cb4f9caa2bc"}]}],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}} + {"data":{"questionRuleInstance":{"id":"5101a668-a7d9-463d-9d74-64c91b3f2d10","name":"tf-provider-test-rule","description":"Test","version":1,"specVersion":1,"latest":true,"pollingInterval":"ONE_WEEK","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"ignorePreviousResults":false,"questionId":"a4a81b66-72f6-4373-8999-9b26c5aa7d02","question":null,"operations":[{"when":{"type":"FILTER","condition":"{{queries.query0.total != 0}}","specVersion":1},"actions":[{"targetValue":"HIGH","id":"6de9cc35-e43d-45eb-899c-a53b134ec596","type":"SET_PROPERTY","targetProperty":"alertLevel"},{"type":"CREATE_ALERT","id":"1bc23598-5a44-4698-baf0-062d8b7779b5"}]}],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}} headers: Access-Control-Allow-Credentials: - "true" Content-Length: - - "766" + - "796" 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: @@ -312,19 +312,19 @@ interactions: - "0" status: 200 OK code: 200 - duration: 350.296375ms + duration: 185.999917ms - id: 4 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 419 + content_length: 434 transfer_encoding: [] trailer: {} host: graphql.us.jupiterone.io remote_addr: "" request_uri: "" - body: '{"query":"\nquery GetQuestionById ($id: ID!) {\n\tquestion(id: $id) {\n\t\tid\n\t\ttitle\n\t\tdescription\n\t\tpollingInterval\n\t\tqueries {\n\t\t\tname\n\t\t\tquery\n\t\t\tversion\n\t\t\tincludeDeleted\n\t\t\tresultsAre\n\t\t}\n\t\ttags\n\t\tcompliance {\n\t\t\tstandard\n\t\t\trequirements\n\t\t\tcontrols\n\t\t}\n\t}\n}\n","variables":{"id":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9"},"operationName":"GetQuestionById"}' + body: '{"query":"\nquery GetQuestionById ($id: ID!) {\n\tquestion(id: $id) {\n\t\tid\n\t\ttitle\n\t\tdescription\n\t\tshowTrend\n\t\tpollingInterval\n\t\tqueries {\n\t\t\tname\n\t\t\tquery\n\t\t\tversion\n\t\t\tincludeDeleted\n\t\t\tresultsAre\n\t\t}\n\t\ttags\n\t\tcompliance {\n\t\t\tstandard\n\t\t\trequirements\n\t\t\tcontrols\n\t\t}\n\t}\n}\n","variables":{"id":"a4a81b66-72f6-4373-8999-9b26c5aa7d02"},"operationName":"GetQuestionById"}' form: {} headers: Cache-Control: @@ -339,15 +339,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 418 + content_length: 436 uncompressed: false body: | - {"data":{"question":{"id":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9","title":"tf-provider-test-rule","description":"Test","pollingInterval":"ONE_DAY","queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false,"resultsAre":"INFORMATIVE"}],"tags":["tf_acc:1","tf_acc:2"],"compliance":[]}}} + {"data":{"question":{"id":"a4a81b66-72f6-4373-8999-9b26c5aa7d02","title":"tf-provider-test-rule","description":"Test","showTrend":false,"pollingInterval":"ONE_DAY","queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false,"resultsAre":"INFORMATIVE"}],"tags":["tf_acc:1","tf_acc:2"],"compliance":[]}}} headers: Access-Control-Allow-Credentials: - "true" Content-Length: - - "418" + - "436" 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: @@ -390,19 +390,19 @@ interactions: - "0" status: 200 OK code: 200 - duration: 444.921833ms + duration: 241.0375ms - id: 5 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":"1397b823-a6b0-487f-805e-bc2d20de9cf8"},"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":"5101a668-a7d9-463d-9d74-64c91b3f2d10"},"operationName":"GetQuestionRuleInstance"}' form: {} headers: Cache-Control: @@ -417,15 +417,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 766 + content_length: 796 uncompressed: false body: | - {"data":{"questionRuleInstance":{"id":"1397b823-a6b0-487f-805e-bc2d20de9cf8","name":"tf-provider-test-rule","description":"Test","version":1,"specVersion":1,"latest":true,"pollingInterval":"ONE_WEEK","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"questionId":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9","question":null,"operations":[{"when":{"type":"FILTER","condition":"{{queries.query0.total != 0}}","specVersion":1},"actions":[{"targetValue":"HIGH","id":"ac2334ac-eb35-4704-84b2-68ab535e1b01","type":"SET_PROPERTY","targetProperty":"alertLevel"},{"type":"CREATE_ALERT","id":"ff831c5b-601e-4266-b6d9-5cb4f9caa2bc"}]}],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}} + {"data":{"questionRuleInstance":{"id":"5101a668-a7d9-463d-9d74-64c91b3f2d10","name":"tf-provider-test-rule","description":"Test","version":1,"specVersion":1,"latest":true,"pollingInterval":"ONE_WEEK","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"ignorePreviousResults":false,"questionId":"a4a81b66-72f6-4373-8999-9b26c5aa7d02","question":null,"operations":[{"when":{"type":"FILTER","condition":"{{queries.query0.total != 0}}","specVersion":1},"actions":[{"targetValue":"HIGH","id":"6de9cc35-e43d-45eb-899c-a53b134ec596","type":"SET_PROPERTY","targetProperty":"alertLevel"},{"type":"CREATE_ALERT","id":"1bc23598-5a44-4698-baf0-062d8b7779b5"}]}],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}} headers: Access-Control-Allow-Credentials: - "true" Content-Length: - - "766" + - "796" 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: @@ -468,19 +468,19 @@ interactions: - "0" status: 200 OK code: 200 - duration: 337.51025ms + duration: 194.606708ms - id: 6 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 894 + content_length: 956 transfer_encoding: [] trailer: {} host: graphql.us.jupiterone.io remote_addr: "" request_uri: "" - body: '{"query":"\nmutation UpdateReferencedQuestionRuleInstance ($instance: UpdateReferencedQuestionRuleInstanceInput!) {\n\tupdateReferencedQuestionRuleInstance(instance: $instance) {\n\t\tversion\n\t\tspecVersion\n\t\toperations {\n\t\t\twhen\n\t\t\tactions\n\t\t}\n\t}\n}\n","variables":{"instance":{"questionId":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9","id":"1397b823-a6b0-487f-805e-bc2d20de9cf8","version":1,"state":{"actions":null},"templates":null,"tags":["tf_acc:1","tf_acc:2"],"name":"tf-provider-test-rule","description":"Test","specVersion":1,"operations":[{"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY"},{"type":"CREATE_ALERT"}]}],"outputs":["queries.query0.total","alertLevel"],"pollingInterval":"ONE_WEEK","notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"remediationSteps":""}},"operationName":"UpdateReferencedQuestionRuleInstance"}' + body: '{"query":"\nmutation UpdateReferencedQuestionRuleInstance ($instance: UpdateReferencedQuestionRuleInstanceInput!) {\n\tupdateReferencedQuestionRuleInstance(instance: $instance) {\n\t\tversion\n\t\tspecVersion\n\t\toperations {\n\t\t\twhen\n\t\t\tactions\n\t\t}\n\t}\n}\n","variables":{"instance":{"questionId":"a4a81b66-72f6-4373-8999-9b26c5aa7d02","id":"5101a668-a7d9-463d-9d74-64c91b3f2d10","version":1,"state":{"actions":null},"templates":null,"tags":["tf_acc:1","tf_acc:2"],"name":"tf-provider-test-rule","description":"Test","specVersion":1,"operations":[{"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY"},{"type":"CREATE_ALERT"}]}],"outputs":["queries.query0.total","alertLevel"],"pollingInterval":"ONE_WEEK","notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"ignorePreviousResults":false,"remediationSteps":"","collectionId":"","labels":null}},"operationName":"UpdateReferencedQuestionRuleInstance"}' form: {} headers: Cache-Control: @@ -498,7 +498,7 @@ interactions: content_length: 308 uncompressed: false body: | - {"data":{"updateReferencedQuestionRuleInstance":{"version":2,"specVersion":1,"operations":[{"when":null,"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY","id":"f99e6248-85e4-42ec-ba3e-42f331ca5481"},{"type":"CREATE_ALERT","id":"177ffb0b-ca57-408a-9b87-5f89dffcbff9"}]}]}}} + {"data":{"updateReferencedQuestionRuleInstance":{"version":2,"specVersion":1,"operations":[{"when":null,"actions":[{"targetProperty":"alertLevel","targetValue":"HIGH","type":"SET_PROPERTY","id":"641f86cf-93f1-498f-ae9c-0c7ed6dd6038"},{"type":"CREATE_ALERT","id":"22afacc5-f05e-4de2-98e7-ebf6c98f50e2"}]}]}}} headers: Access-Control-Allow-Credentials: - "true" @@ -546,19 +546,19 @@ interactions: - "0" status: 200 OK code: 200 - duration: 653.461958ms + duration: 702.913166ms - id: 7 request: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 419 + content_length: 434 transfer_encoding: [] trailer: {} host: graphql.us.jupiterone.io remote_addr: "" request_uri: "" - body: '{"query":"\nquery GetQuestionById ($id: ID!) {\n\tquestion(id: $id) {\n\t\tid\n\t\ttitle\n\t\tdescription\n\t\tpollingInterval\n\t\tqueries {\n\t\t\tname\n\t\t\tquery\n\t\t\tversion\n\t\t\tincludeDeleted\n\t\t\tresultsAre\n\t\t}\n\t\ttags\n\t\tcompliance {\n\t\t\tstandard\n\t\t\trequirements\n\t\t\tcontrols\n\t\t}\n\t}\n}\n","variables":{"id":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9"},"operationName":"GetQuestionById"}' + body: '{"query":"\nquery GetQuestionById ($id: ID!) {\n\tquestion(id: $id) {\n\t\tid\n\t\ttitle\n\t\tdescription\n\t\tshowTrend\n\t\tpollingInterval\n\t\tqueries {\n\t\t\tname\n\t\t\tquery\n\t\t\tversion\n\t\t\tincludeDeleted\n\t\t\tresultsAre\n\t\t}\n\t\ttags\n\t\tcompliance {\n\t\t\tstandard\n\t\t\trequirements\n\t\t\tcontrols\n\t\t}\n\t}\n}\n","variables":{"id":"a4a81b66-72f6-4373-8999-9b26c5aa7d02"},"operationName":"GetQuestionById"}' form: {} headers: Cache-Control: @@ -573,15 +573,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 418 + content_length: 436 uncompressed: false body: | - {"data":{"question":{"id":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9","title":"tf-provider-test-rule","description":"Test","pollingInterval":"ONE_DAY","queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false,"resultsAre":"INFORMATIVE"}],"tags":["tf_acc:1","tf_acc:2"],"compliance":[]}}} + {"data":{"question":{"id":"a4a81b66-72f6-4373-8999-9b26c5aa7d02","title":"tf-provider-test-rule","description":"Test","showTrend":false,"pollingInterval":"ONE_DAY","queries":[{"name":"query0","query":"Find DataStore with classification=('critical' or 'sensitive' or 'confidential' or 'restricted') and encrypted!=true","version":"v1","includeDeleted":false,"resultsAre":"INFORMATIVE"}],"tags":["tf_acc:1","tf_acc:2"],"compliance":[]}}} headers: Access-Control-Allow-Credentials: - "true" Content-Length: - - "418" + - "436" 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: @@ -624,19 +624,19 @@ interactions: - "0" status: 200 OK code: 200 - duration: 366.425292ms + duration: 263.366083ms - id: 8 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":"1397b823-a6b0-487f-805e-bc2d20de9cf8"},"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":"5101a668-a7d9-463d-9d74-64c91b3f2d10"},"operationName":"GetQuestionRuleInstance"}' form: {} headers: Cache-Control: @@ -651,15 +651,15 @@ interactions: proto_minor: 0 transfer_encoding: [] trailer: {} - content_length: 693 + content_length: 723 uncompressed: false body: | - {"data":{"questionRuleInstance":{"id":"1397b823-a6b0-487f-805e-bc2d20de9cf8","name":"tf-provider-test-rule","description":"Test","version":2,"specVersion":1,"latest":true,"pollingInterval":"ONE_WEEK","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"questionId":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9","question":null,"operations":[{"when":null,"actions":[{"targetValue":"HIGH","id":"f99e6248-85e4-42ec-ba3e-42f331ca5481","type":"SET_PROPERTY","targetProperty":"alertLevel"},{"type":"CREATE_ALERT","id":"177ffb0b-ca57-408a-9b87-5f89dffcbff9"}]}],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}} + {"data":{"questionRuleInstance":{"id":"5101a668-a7d9-463d-9d74-64c91b3f2d10","name":"tf-provider-test-rule","description":"Test","version":2,"specVersion":1,"latest":true,"pollingInterval":"ONE_WEEK","deleted":false,"type":"QUESTION","templates":null,"notifyOnFailure":false,"triggerActionsOnNewEntitiesOnly":false,"ignorePreviousResults":false,"questionId":"a4a81b66-72f6-4373-8999-9b26c5aa7d02","question":null,"operations":[{"when":null,"actions":[{"targetValue":"HIGH","id":"641f86cf-93f1-498f-ae9c-0c7ed6dd6038","type":"SET_PROPERTY","targetProperty":"alertLevel"},{"type":"CREATE_ALERT","id":"22afacc5-f05e-4de2-98e7-ebf6c98f50e2"}]}],"outputs":["queries.query0.total","alertLevel"],"tags":["tf_acc:1","tf_acc:2"]}}} headers: Access-Control-Allow-Credentials: - "true" Content-Length: - - "693" + - "723" 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: @@ -702,7 +702,7 @@ interactions: - "0" status: 200 OK code: 200 - duration: 364.13425ms + duration: 197.696ms - id: 9 request: proto: HTTP/1.1 @@ -714,7 +714,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":"1397b823-a6b0-487f-805e-bc2d20de9cf8"},"operationName":"DeleteRuleInstance"}' + body: '{"query":"\nmutation DeleteRuleInstance ($id: ID!) {\n\tdeleteRuleInstance(id: $id) {\n\t\tid\n\t}\n}\n","variables":{"id":"5101a668-a7d9-463d-9d74-64c91b3f2d10"},"operationName":"DeleteRuleInstance"}' form: {} headers: Cache-Control: @@ -732,7 +732,7 @@ interactions: content_length: 78 uncompressed: false body: | - {"data":{"deleteRuleInstance":{"id":"1397b823-a6b0-487f-805e-bc2d20de9cf8"}}} + {"data":{"deleteRuleInstance":{"id":"5101a668-a7d9-463d-9d74-64c91b3f2d10"}}} headers: Access-Control-Allow-Credentials: - "true" @@ -780,7 +780,7 @@ interactions: - "0" status: 200 OK code: 200 - duration: 353.208208ms + duration: 314.756333ms - id: 10 request: proto: HTTP/1.1 @@ -792,7 +792,7 @@ interactions: host: graphql.us.jupiterone.io remote_addr: "" request_uri: "" - body: '{"query":"\nmutation DeleteQuestion ($id: ID!) {\n\tdeleteQuestion(id: $id) {\n\t\tid\n\t}\n}\n","variables":{"id":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9"},"operationName":"DeleteQuestion"}' + body: '{"query":"\nmutation DeleteQuestion ($id: ID!) {\n\tdeleteQuestion(id: $id) {\n\t\tid\n\t}\n}\n","variables":{"id":"a4a81b66-72f6-4373-8999-9b26c5aa7d02"},"operationName":"DeleteQuestion"}' form: {} headers: Cache-Control: @@ -810,7 +810,7 @@ interactions: content_length: 74 uncompressed: false body: | - {"data":{"deleteQuestion":{"id":"8fbf10fd-5a37-4c29-b04d-5cea615a7fd9"}}} + {"data":{"deleteQuestion":{"id":"a4a81b66-72f6-4373-8999-9b26c5aa7d02"}}} headers: Access-Control-Allow-Credentials: - "true" @@ -858,4 +858,4 @@ interactions: - "0" status: 200 OK code: 200 - duration: 530.450708ms + duration: 507.340583ms