From 19aa82f7c1e8de356e29a1de1f613a01e75e8c29 Mon Sep 17 00:00:00 2001 From: SeaBlooms Date: Mon, 16 Dec 2024 14:12:18 -0700 Subject: [PATCH 1/5] 1.3.0 release --- README.md | 204 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- setup.py | 2 +- 2 files changed, 201 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 63a7ad0..9ecd5d1 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ j1 = JupiterOneClient( url='https://graphql.us.jupiterone.io', sync_url='https://api.us.jupiterone.io' ) + ``` ## Regional or Custom Tenant Support @@ -58,6 +59,7 @@ query_result = j1.query_v1(QUERY) # Using cursor graphQL variable to return full set of paginated results QUERY = "FIND (Device | Person)" cursor_query_r = j1._cursor_query(QUERY) + ``` ##### Create an entity: @@ -78,6 +80,7 @@ entity = j1.create_entity( timestamp=int(time.time()) * 1000 # Optional, defaults to current datetime ) print(entity['entity']) + ``` @@ -93,6 +96,7 @@ j1.update_entity( entity_id='', properties=properties ) + ``` @@ -112,30 +116,35 @@ j1.create_relationship( from_entity_id='', to_entity_id='' ) + ``` ##### Delete a relationship ```python j1.delete_relationship(relationship_id='') + ``` ##### Fetch Graph Entity Properties ```python j1.fetch_all_entity_properties() + ``` ##### Fetch Graph Entity Tags ```python j1.fetch_all_entity_tags() + ``` ##### Fetch Entity Raw Data ```python j1.fetch_entity_raw_data(entity_id='') + ``` ##### Create Integration Instance @@ -144,12 +153,14 @@ j1.fetch_entity_raw_data(entity_id='') j1.create_integration_instance( instance_name="Integration Name", instance_description="Description Text") + ``` ##### Start Synchronization Job ```python j1.start_sync_job(instance_id='') + ``` ##### Upload Batch of Entities @@ -181,6 +192,7 @@ entities_payload = [ j1.upload_entities_batch_json(instance_job_id='', entities_list=entities_payload) + ``` ##### Upload Batch of Relationships @@ -207,6 +219,7 @@ relationships_payload = [ j1.upload_relationships_batch_json(instance_job_id='', relationships_list=relationships_payload) + ``` ##### Upload Batch of Entities and Relationships @@ -258,17 +271,20 @@ combined_payload = { j1.upload_combined_batch_json(instance_job_id='', combined_payload=combined_payload) + ``` ##### Finalize Synchronization Job ```python j1.finalize_sync_job(instance_job_id='') + ``` ##### Fetch Integration Instance Jobs ```python + j1.fetch_integration_jobs(instance_id='') ``` @@ -277,6 +293,7 @@ j1.fetch_integration_jobs(instance_id='') ```python j1.fetch_integration_job_events(instance_id='', instance_job_id='') + ``` ##### Create SmartClass @@ -284,6 +301,7 @@ j1.fetch_integration_job_events(instance_id='', ```python j1.create_smartclass(smartclass_name='SmartClassName', smartclass_description='SmartClass Description Text') + ``` ##### Create SmartClass Query @@ -292,36 +310,42 @@ j1.create_smartclass(smartclass_name='SmartClassName', j1.create_smartclass_query(smartclass_id='', query='', query_description='Query Description Text') + ``` ##### Run SmartClass Evaluation ```python j1.evaluate_smartclass(smartclass_id='') + ``` ##### Get SmartClass Details ```python j1.get_smartclass_details(smartclass_id='') + ``` ##### Generate J1QL from Natural Language Prompt ```python j1.generate_j1ql(natural_language_prompt='') + ``` ##### List Alert Rules ```python j1.list_alert_rules() + ``` ##### Get Alert Rule Details ```python j1.get_alert_rule_details(rule_id='') + ``` ##### Create Alert Rule @@ -336,6 +360,7 @@ j1.create_alert_rule(name="create_alert_rule-name", polling_interval="DISABLED", severity="INFO", j1ql="find jupiterone_user") + ``` ##### Create Alert Rule with Action Config @@ -354,6 +379,17 @@ webhook_action_config = { } } +tag_entities_action_config = { + "type": "TAG_ENTITIES", + "entities": "{{queries.query0.data}}", + "tags": [ + { + "name": "tagKey", + "value": "tagValue" + } + ] +} + j1.create_alert_rule(name="create_alert_rule-name", description="create_alert_rule-description", tags=['tag1', 'tag2'], @@ -369,19 +405,85 @@ j1.create_alert_rule(name="create_alert_rule-name", ```python j1.delete_alert_rule(rule_id='" + }, + "method": "POST", + "body": { + "queryData": "{{queries.query0.data}}" + } + } +] + +alert_rule_config_multiple = [ + { + "type": "WEBHOOK", + "endpoint": "https://webhook.example", + "headers": { + "Authorization": "Bearer " + }, + "method": "POST", + "body": { + "queryData": "{{queries.query0.data}}" + } + }, + { + "type": "TAG_ENTITIES", + "entities": "{{queries.query0.data}}", + "tags": [ + { + "name": "tagName", + "value": "tagValue" + } + ] + } +] + +j1.update_alert_rule(rule_id=" Date: Mon, 16 Dec 2024 14:28:26 -0700 Subject: [PATCH 2/5] Update README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9ecd5d1..f94de1a 100644 --- a/README.md +++ b/README.md @@ -474,7 +474,7 @@ alert_rule_config_multiple = [ } ] -j1.update_alert_rule(rule_id="%2FRULE_EVALUATION%2F%2F%2Fquery0.json?token=&Expires=") +j1.fetch_downloaded_evaluation_results(download_url="https://download.us.jupiterone.io//RULE_EVALUATION///query0.json?token=&Expires=") ``` @@ -547,7 +547,9 @@ j1.fetch_downloaded_evaluation_results(download_url="https://download.us.jupiter ```python -j1.get_integration_definition_details(integration_type="aws") +# examples: 'aws', 'azure', 'google_cloud' + +j1.get_integration_definition_details(integration_type="") ``` From 3b659c038cfc41a8614f4996e91957c6a3f6abf6 Mon Sep 17 00:00:00 2001 From: SeaBlooms Date: Mon, 16 Dec 2024 14:30:01 -0700 Subject: [PATCH 3/5] typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f94de1a..f3e25ad 100644 --- a/README.md +++ b/README.md @@ -535,7 +535,7 @@ j1.fetch_evaluation_result_download_url(raw_data_key="RULE_EVALUATION/", action_configs=alert_rule_config_tag, action_configs_op="OVERWRITE") -j1.update_alert_rule(rule_id=' Date: Mon, 16 Dec 2024 14:32:50 -0700 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bf9be7b..bff8ebe 100644 --- a/README.md +++ b/README.md @@ -499,7 +499,7 @@ j1.update_alert_rule(rule_id='', ```python -j1.evaluate_alert_rule(rule_id='