Skip to content

Commit

Permalink
Align Credentials Part 3 (demisto#27371)
Browse files Browse the repository at this point in the history
* IvantiHeat complete

* release notes

* Rundeck complete

* SymantecBlueCoatMalwareAnalysis complete

* GoogleCalendar complete

* closed brackets

* Update .pack-ignore

* update docker

* fixed import bug

* updated know words

* updated release notes

* removed IN140 from .pack-ignore

* solved RN conflicts

* update docker

* aligned docker
  • Loading branch information
jlevypaloalto authored and xsoar-bot committed Jul 26, 2023
1 parent 80d1eef commit 58a76ab
Show file tree
Hide file tree
Showing 20 changed files with 95 additions and 48 deletions.
3 changes: 0 additions & 3 deletions Packs/GoogleCalendar/.pack-ignore
@@ -1,5 +1,2 @@
[file:GoogleCalendar.yml]
ignore=IN145

[file:GoogleCalendar_image.png]
ignore=IM111
Expand Up @@ -257,7 +257,8 @@ def main() -> None:

try:
params = demisto.params()
service_account_dict = GSuiteClient.safe_load_non_strict_json(params.get('user_service_account_json'))
service_account_dict = GSuiteClient.safe_load_non_strict_json(params.get(
'user_service_account_json_creds', {}).get('password') or params.get('user_service_account_json'))
verify_certificate = not params.get('insecure', False)
proxy = params.get('proxy', False)

Expand Down Expand Up @@ -287,7 +288,7 @@ def main() -> None:
return_error(f'Error: {str(e)}')


from GSuiteApiModule import * # noqa: E402
from GSuiteApiModule import * # noqa: E402

if __name__ in ('__main__', '__builtin__', 'builtins'):
main()
33 changes: 16 additions & 17 deletions Packs/GoogleCalendar/Integrations/GoogleCalendar/GoogleCalendar.yml
Expand Up @@ -5,8 +5,14 @@ commonfields:
configuration:
- display: User's Service Account JSON
name: user_service_account_json
required: true
required: false
type: 4
hidden: true
- name: user_service_account_json_creds
required: false
type: 9
displaypassword: User's Service Account JSON
hiddenusername: true
- display: Trust any certificate (not secure)
name: insecure
required: false
Expand All @@ -15,15 +21,15 @@ configuration:
name: proxy
required: false
type: 8

description: Google Calendar is a time-management and scheduling calendar service developed by Google. This integration helps you to perform various tasks on the access control list (ACL).
display: Google Calendar
name: GoogleCalendar
script:
commands:
- arguments:
- default: false
description: Identifier of the calendar. To access the primary calendar
of the currently logged in user, use the "primary" keyword.
description: Identifier of the calendar. To access the primary calendar of the currently logged in user, use the "primary" keyword.
isArray: false
name: calendar_id
required: true
Expand Down Expand Up @@ -84,8 +90,7 @@ script:
required: true
secret: false
- default: false
description: The email address of a user or group, or the name of a domain,
depending on the scope type. Omitted for type "default".
description: The email address of a user or group, or the name of a domain, depending on the scope type. Omitted for type "default".
isArray: false
name: scope_value
required: false
Expand Down Expand Up @@ -125,16 +130,14 @@ script:
description: The type of the scope.
type: String
- contextPath: GoogleCalendar.Acl.scopeValue
description: The email address of a user or group, or the name of a domain,
depending on the scope type.
description: The email address of a user or group, or the name of a domain, depending on the scope type.
type: String
- contextPath: GoogleCalendar.Acl.role
description: The role assigned to the scope.
type: String
- arguments:
- default: false
description: Calendar identifier. If you want to access the primary calendar
of the currently logged in user, use the "primary" keyword.
description: Calendar identifier. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword.
isArray: false
name: calendar_id
required: true
Expand All @@ -161,9 +164,7 @@ script:
- auto: PREDEFINED
default: false
defaultValue: 'false'
description: Whether to include deleted ACLs in the result. Deleted ACLs are
represented by the role "none". Deleted ACLs will always be included
if syncToken is provided. Default is "false".
description: Whether to include deleted ACLs in the result. Deleted ACLs are represented by the role "none". Deleted ACLs will always be included if syncToken is provided. Default is "false".
isArray: false
name: show_deleted
predefined:
Expand Down Expand Up @@ -203,8 +204,7 @@ script:
description: The type of the scope.
type: String
- contextPath: GoogleCalendar.Acl.scopeValue
description: The email address of a user or group, or the name of a domain,
depending on the scope type.
description: The email address of a user or group, or the name of a domain, depending on the scope type.
type: String
- contextPath: GoogleCalendar.Acl.role
description: The role assigned to the scope.
Expand All @@ -219,10 +219,9 @@ script:
description: Token used to access the next page of this result.
type: String
- contextPath: GoogleCalendar.PageToken.Acl.nextSyncToken
description: Token used at a later point in time to retrieve only the entries
that have changed since this result was returned.
description: Token used at a later point in time to retrieve only the entries that have changed since this result was returned.
type: String
dockerimage: demisto/googleapi-python3:1.0.0.63394
dockerimage: demisto/googleapi-python3:1.0.0.63869
feed: false
isfetch: false
longRunning: false
Expand Down
7 changes: 7 additions & 0 deletions Packs/GoogleCalendar/ReleaseNotes/1_1_30.md
@@ -0,0 +1,7 @@

#### Integrations

##### Google Calendar

- You can now use credentials when configuring the *User's Service Account JSON* field.
- Updated the Docker image to demisto/googleapi-python3:1.0.0.63869.
2 changes: 1 addition & 1 deletion Packs/GoogleCalendar/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "Google Calendar",
"description": "Google Calendar integration with Cortex XSOAR.",
"support": "xsoar",
"currentVersion": "1.1.29",
"currentVersion": "1.1.30",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
4 changes: 3 additions & 1 deletion Packs/IvantiHeat/.pack-ignore
@@ -1,5 +1,5 @@
[file:IvantiHeat.yml]
ignore=IN126,IN145,BA124,IN140
ignore=IN126,BA124

[file:IvantiHeatCreateIncidentExample.yml]
ignore=BA124
Expand All @@ -10,3 +10,5 @@ ignore=BA124
[file:IvantiHeatCreateProblemExample.yml]
ignore=BA124

[known_words]
Ivanti
10 changes: 5 additions & 5 deletions Packs/IvantiHeat/Integrations/IvantiHeat/IvantiHeat.py
Expand Up @@ -4,11 +4,10 @@
''' IMPORTS '''

import json
import requests
import dateparser
import urllib3

# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
urllib3.disable_warnings()

''' CONSTANTS '''
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
Expand All @@ -22,12 +21,13 @@ class Client(BaseClient):
Client will implement the service API, and should not contain any Demisto logic.
Should only do requests and return data.
"""

def do_request(self, method, url_suffix, params=None, data=None, json_data=None, resp_type='json', files=None):

res = self._http_request(method, url_suffix, params=params, data=data, json_data=json_data, files=files,
resp_type=resp_type, ok_codes=(200, 201, 204), return_empty_response=True)

if resp_type == 'other' or isinstance(res, dict) or isinstance(res, list):
if isinstance(res, (dict, list)) or resp_type == 'other':
return res
return {}

Expand Down Expand Up @@ -237,7 +237,7 @@ def main():

# get the service API url
base_url = urljoin(demisto.params()['url'], '/api')
token = demisto.params().get('token')
token = demisto.params().get('token_creds', {}).get('password') or demisto.params().get('token')
verify_certificate = not demisto.params().get('insecure', False)

# How much time before the first fetch to retrieve incidents
Expand Down
15 changes: 11 additions & 4 deletions Packs/IvantiHeat/Integrations/IvantiHeat/IvantiHeat.yml
Expand Up @@ -9,8 +9,14 @@ configuration:
type: 0
- display: API Token
name: token
required: true
required: false
type: 4
hidden: true
- name: token_creds
required: false
type: 9
displaypassword: API Token
hiddenusername: true
- display: Fetch incidents
name: isFetch
required: false
Expand All @@ -24,11 +30,11 @@ configuration:
name: fetch_time
required: false
type: 0
- defaultvalue: subject
display: The object field to use for incident name
- display: The object field to use for incident name
name: incident_name_field
required: true
type: 0
defaultvalue: subject
- display: Trust any certificate (not secure)
name: insecure
required: false
Expand All @@ -37,6 +43,7 @@ configuration:
name: proxy
required: false
type: 8

description: Use the Ivanti Heat integration to manage issues and create Cortex XSOAR incidents from Ivanti Heat.
display: Ivanti Heat
name: Ivanti Heat
Expand Down Expand Up @@ -359,7 +366,7 @@ script:
- contextPath: IvantiHeat.incidents.Email
description: Incident owner email address.
type: String
dockerimage: demisto/python3:3.10.4.29342
dockerimage: demisto/python3:3.10.12.63474
feed: false
isfetch: true
longRunning: false
Expand Down
7 changes: 7 additions & 0 deletions Packs/IvantiHeat/ReleaseNotes/1_0_8.md
@@ -0,0 +1,7 @@

#### Integrations

##### Ivanti Heat

- You can now use credentials when configuring the *API Token* field.
- Updated the Docker image to demisto/python3:3.10.12.63474.
4 changes: 2 additions & 2 deletions Packs/IvantiHeat/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "Ivanti Heat",
"description": "Use Ivanti Heat integration to manage issues and create Demisto incidents from ivanti.",
"support": "xsoar",
"currentVersion": "1.0.7",
"currentVersion": "1.0.8",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand All @@ -17,4 +17,4 @@
"xsoar",
"marketplacev2"
]
}
}
5 changes: 1 addition & 4 deletions Packs/Rundeck/.pack-ignore
@@ -1,5 +1,2 @@
[file:README.md]
ignore=RM104,RM106

[file:Rundeck.yml]
ignore=IN145
ignore=RM104,RM106
2 changes: 1 addition & 1 deletion Packs/Rundeck/Integrations/Rundeck/Rundeck.py
Expand Up @@ -1260,7 +1260,7 @@ def main() -> None:
:rtype:
"""
params: dict = demisto.params()
token: str = params.get("token", "")
token: str = params.get('token_creds', {}).get('password') or params.get("token", "")
project_name: str = params.get("project_name", "")

# get the service API url
Expand Down
11 changes: 9 additions & 2 deletions Packs/Rundeck/Integrations/Rundeck/Rundeck.yml
Expand Up @@ -9,8 +9,14 @@ configuration:
type: 0
- display: API Key
name: token
required: true
required: false
type: 4
hidden: true
- name: token_creds
required: false
type: 9
displaypassword: API Key
hiddenusername: true
- display: Trust any certificate (not secure)
name: insecure
required: false
Expand All @@ -23,6 +29,7 @@ configuration:
name: project_name
required: false
type: 0

description: Rundeck is a runbook automation for incident management, business continuity, and self-service operations. |- The integration enables you to install software on a list of machines or perform a task periodically. Can be used when there is a new attack and you want to perform an update of the software to block the attack.
display: Rundeck
name: Rundeck
Expand Down Expand Up @@ -1092,7 +1099,7 @@ script:
- contextPath: Rundeck.WebhookEvent.executionId
description: The ID of the execution.
type: String
dockerimage: demisto/python3:3.10.5.31928
dockerimage: demisto/python3:3.10.12.63474
feed: false
isfetch: false
longRunning: false
Expand Down
7 changes: 7 additions & 0 deletions Packs/Rundeck/ReleaseNotes/1_0_16.md
@@ -0,0 +1,7 @@

#### Integrations

##### Rundeck

- You can now use credentials when configuring the *API Key* field.
- Updated the Docker image to demisto/python3:3.10.12.63474.
2 changes: 1 addition & 1 deletion Packs/Rundeck/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "Rundeck",
"description": "Rundeck is runbook automation for incident management, business continuity, and self-service operations",
"support": "xsoar",
"currentVersion": "1.0.15",
"currentVersion": "1.0.16",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
4 changes: 3 additions & 1 deletion Packs/SymantecBlueCoatMalwareAnalysis/.pack-ignore
Expand Up @@ -2,5 +2,7 @@
ignore=RM104

[file:SymantecBlueCoatMalwareAnalysis.yml]
ignore=IN145,BA124
ignore=BA124

[known_words]
Symantec
Expand Up @@ -15,7 +15,7 @@ def http_request(url_suffix, data=None, files=None, parse_json=True):
data = {} if data is None else data
url_params = {} # type:dict
full_url = BASE_URL + url_suffix
api_key = demisto.params().get('api_key', False)
api_key = demisto.params().get('api_key_creds', {}).get('password') or demisto.params().get('api_key', False)
headers = {'X-API-TOKEN': api_key}

try:
Expand Down
Expand Up @@ -9,8 +9,14 @@ configuration:
type: 0
- display: API Key
name: api_key
required: true
required: false
type: 4
hidden: true
- name: api_key_creds
required: false
type: 9
displaypassword: API Key
hiddenusername: true
- display: Use system proxy settings
name: proxy
required: false
Expand All @@ -23,6 +29,7 @@ configuration:
name: environment
required: false
type: 0

description: Symantec Blue Coat Content and Malware Analysis integration.
display: Symantec Blue Coat Content and Malware Analysis (Beta)
name: Symantec Blue Coat Content and Malware Analysis
Expand Down Expand Up @@ -62,7 +69,7 @@ script:
description: Retrieves an analysis report.
execution: false
name: symantec-cma-get-report
dockerimage: demisto/python3:3.10.11.61265
dockerimage: demisto/python3:3.10.12.63474
isfetch: false
longRunning: false
longRunningPort: false
Expand Down
7 changes: 7 additions & 0 deletions Packs/SymantecBlueCoatMalwareAnalysis/ReleaseNotes/1_0_7.md
@@ -0,0 +1,7 @@

#### Integrations

##### Symantec Blue Coat Content and Malware Analysis (Beta)

- You can now use credentials when configuring the *API Key* field.
- Updated the Docker image to demisto/python3:3.10.12.63474.

0 comments on commit 58a76ab

Please sign in to comment.