From 55fd52ff50d7d32a7c6678235e99946fcfcbc964 Mon Sep 17 00:00:00 2001 From: maimorag Date: Sun, 25 Jun 2023 17:31:05 +0300 Subject: [PATCH 1/2] Google align credentials stores - part 25 --- Packs/GoogleCloudCompute/.pack-ignore | 3 --- .../GoogleCloudCompute/GoogleCloudCompute.py | 4 +++- .../GoogleCloudCompute/GoogleCloudCompute.yml | 10 ++++++++-- Packs/GoogleCloudCompute/ReleaseNotes/1_1_3.md | 6 ++++++ Packs/GoogleCloudCompute/pack_metadata.json | 2 +- Packs/GoogleCloudStorage/.pack-ignore | 3 --- .../GoogleCloudStorage/GoogleCloudStorage.py | 4 +++- .../GoogleCloudStorage/GoogleCloudStorage.yml | 10 ++++++++-- Packs/GoogleCloudStorage/ReleaseNotes/1_0_10.md | 6 ++++++ Packs/GoogleCloudStorage/pack_metadata.json | 2 +- 10 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 Packs/GoogleCloudCompute/ReleaseNotes/1_1_3.md create mode 100644 Packs/GoogleCloudStorage/ReleaseNotes/1_0_10.md diff --git a/Packs/GoogleCloudCompute/.pack-ignore b/Packs/GoogleCloudCompute/.pack-ignore index d5bdf9dd5c07..4da12283a16b 100644 --- a/Packs/GoogleCloudCompute/.pack-ignore +++ b/Packs/GoogleCloudCompute/.pack-ignore @@ -4,9 +4,6 @@ ignore=RM104 [file:playbook-IP_Whitelist_-_GCP_Firewall.yml] ignore=PB114,PB115 -[file:GoogleCloudCompute.yml] -ignore=IN145 - [file:GoogleCloudCompute_image.png] ignore=IM111 diff --git a/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.py b/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.py index 43f25bed304e..9a308ecfe6ef 100644 --- a/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.py +++ b/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.py @@ -16,7 +16,7 @@ """ GLOBALS/PARAMS """ # Params for assembling object of the Service Account Credentials File Contents -SERVICE_ACCOUNT_FILE = demisto.params().get('service') +SERVICE_ACCOUNT_FILE = demisto.params().get('credentials_service_account_json', {}).get('password') or demisto.params().get('service') SERVICE_ACT_PROJECT_ID = None # Params for constructing googleapiclient service object @@ -4516,6 +4516,8 @@ def add_networks_tag(args: Dict[str, Any]) -> CommandResults: def main(): + if not SERVICE_ACCOUNT_FILE: + raise DemistoException('Service Account Private Key file contents must be provided.') try: build_and_authenticate(GSERVICE) command = demisto.command() diff --git a/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.yml b/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.yml index b767e49725e2..7f019aca52c6 100644 --- a/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.yml +++ b/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.yml @@ -5,8 +5,14 @@ commonfields: configuration: - display: Service Account Private Key file contents (JSON) name: service - required: true + required: false type: 4 + hidden: true +- displaypassword: Service Account Private Key file contents (JSON) + name: credentials_service_account_json + required: false + hiddenusername: true + type: 9 - display: Use system proxy settings name: proxy required: false @@ -8412,7 +8418,7 @@ script: - contextPath: GoogleCloudCompute.Instances.kind description: '] Type of the resource. Always compute#instance for instances.' type: string - dockerimage: demisto/googleapi-python3:1.0.0.50652 + dockerimage: demisto/googleapi-python3:1.0.0.64077 runonce: false script: '' subtype: python3 diff --git a/Packs/GoogleCloudCompute/ReleaseNotes/1_1_3.md b/Packs/GoogleCloudCompute/ReleaseNotes/1_1_3.md new file mode 100644 index 000000000000..6895dca78e37 --- /dev/null +++ b/Packs/GoogleCloudCompute/ReleaseNotes/1_1_3.md @@ -0,0 +1,6 @@ + +#### Integrations + +##### Google Cloud Compute +- Added the *Service Account Private Key file contents* integration parameters to support credentials fetching object. +- Updated the Docker image to: *demisto/googleapi-python3:1.0.0.64077*. diff --git a/Packs/GoogleCloudCompute/pack_metadata.json b/Packs/GoogleCloudCompute/pack_metadata.json index 2cbfe448c449..eddcb55b7bef 100644 --- a/Packs/GoogleCloudCompute/pack_metadata.json +++ b/Packs/GoogleCloudCompute/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Google Cloud Compute", "description": "Google Compute Engine delivers virtual machines running in Google's innovative data centers and worldwide fiber network. Compute Engine's tooling and workflow support enable scaling from single instances to global, load-balanced cloud computing.", "support": "xsoar", - "currentVersion": "1.1.2", + "currentVersion": "1.1.3", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "", diff --git a/Packs/GoogleCloudStorage/.pack-ignore b/Packs/GoogleCloudStorage/.pack-ignore index 8fc693a46640..cde61c7630e5 100644 --- a/Packs/GoogleCloudStorage/.pack-ignore +++ b/Packs/GoogleCloudStorage/.pack-ignore @@ -10,8 +10,5 @@ ignore=auto-test [file:playbook-GCS_Object_Policy_(ACL)_Test.yml] ignore=auto-test -[file:GoogleCloudStorage.yml] -ignore=IN145 - [file:GoogleCloudStorage_image.png] ignore=IM111 \ No newline at end of file diff --git a/Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.py b/Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.py index dd1f711837b7..595cd81ab547 100644 --- a/Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.py +++ b/Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.py @@ -502,7 +502,9 @@ def main(): args = demisto.args() command = demisto.command() - service_account = params.get('service_account_json', '') + service_account = params.get('credentials_service_account_json', {}).get('password') or params.get('service_account_json', '') + if not service_account: + raise DemistoException('Service Account Private Key file contents must be provided.') default_bucket = params.get('default_bucket') insecure = params.get('insecure', False) diff --git a/Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.yml b/Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.yml index f4105f188c7c..96fa2106054f 100644 --- a/Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.yml +++ b/Packs/GoogleCloudStorage/Integrations/GoogleCloudStorage/GoogleCloudStorage.yml @@ -5,8 +5,14 @@ commonfields: configuration: - display: Service Account Private Key file contents (JSON) name: service_account_json - required: true + required: false type: 4 + hidden: true +- displaypassword: Service Account Private Key file contents (JSON) + name: credentials_service_account_json + required: false + hiddenusername: true + type: 9 - display: Default Bucket name: default_bucket required: false @@ -508,7 +514,7 @@ script: description: Removes an entity from an object's Access Control List. execution: false name: gcs-delete-bucket-object-policy - dockerimage: demisto/google-cloud-storage:1.0.0.42893 + dockerimage: demisto/google-cloud-storage:1.0.0.63865 isfetch: false longRunning: false longRunningPort: false diff --git a/Packs/GoogleCloudStorage/ReleaseNotes/1_0_10.md b/Packs/GoogleCloudStorage/ReleaseNotes/1_0_10.md new file mode 100644 index 000000000000..fdb88a3ea5e0 --- /dev/null +++ b/Packs/GoogleCloudStorage/ReleaseNotes/1_0_10.md @@ -0,0 +1,6 @@ + +#### Integrations + +##### Google Cloud Storage +- Added the *Service Account Private Key file contents* integration parameters to support credentials fetching object. +- Updated the Docker image to: *demisto/google-cloud-storage:1.0.0.63865*. diff --git a/Packs/GoogleCloudStorage/pack_metadata.json b/Packs/GoogleCloudStorage/pack_metadata.json index 2df229673e12..abc6f36f5300 100644 --- a/Packs/GoogleCloudStorage/pack_metadata.json +++ b/Packs/GoogleCloudStorage/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Google Cloud Storage", "description": "Google Cloud Storage is a RESTful online file storage web service for storing and accessing data on Google Cloud Platform infrastructure.", "support": "xsoar", - "currentVersion": "1.0.9", + "currentVersion": "1.0.10", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "", From 83514936636fcf038ee29e826ceb22ca5fad2b31 Mon Sep 17 00:00:00 2001 From: maimorag Date: Sun, 25 Jun 2023 18:32:16 +0300 Subject: [PATCH 2/2] fix --- .../Integrations/GoogleCloudCompute/GoogleCloudCompute.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.py b/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.py index 9a308ecfe6ef..95b286beb787 100644 --- a/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.py +++ b/Packs/GoogleCloudCompute/Integrations/GoogleCloudCompute/GoogleCloudCompute.py @@ -16,7 +16,8 @@ """ GLOBALS/PARAMS """ # Params for assembling object of the Service Account Credentials File Contents -SERVICE_ACCOUNT_FILE = demisto.params().get('credentials_service_account_json', {}).get('password') or demisto.params().get('service') +SERVICE_ACCOUNT_FILE = demisto.params().get('credentials_service_account_json', + {}).get('password') or demisto.params().get('service') SERVICE_ACT_PROJECT_ID = None # Params for constructing googleapiclient service object