Skip to content

Commit

Permalink
fix validation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yaakovpraisler committed Feb 16, 2023
1 parent 5f8b1ca commit 6508c35
Show file tree
Hide file tree
Showing 66 changed files with 60 additions and 195 deletions.
5 changes: 0 additions & 5 deletions Packs/AWS-GuardDuty/ReleaseNotes/1_3_12.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/AWS-GuardDuty/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "AWS - GuardDuty",
"description": "Amazon Web Services Guard Duty Service (gd)",
"support": "xsoar",
"currentVersion": "1.3.12",
"currentVersion": "1.3.13",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
3 changes: 0 additions & 3 deletions Packs/AgariPhishingDefense/ReleaseNotes/1_1_6.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/AgariPhishingDefense/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "Agari Phishing Defense",
"description": "Use the Agari Phishing Defense integration to retrieve Policy Events as Incidents, retrieve messages and remediate suspected messages.",
"support": "partner",
"currentVersion": "1.1.6",
"currentVersion": "1.1.7",
"author": "Agari",
"url": "https://www.agari.com/support/",
"email": "support@agari.com",
Expand Down
3 changes: 0 additions & 3 deletions Packs/BitSight/ReleaseNotes/1_1_6.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/BitSight/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "BitSight",
"description": "Bitsight Integration will allow you visibility into BitSight findings for remediation in your security program.",
"support": "partner",
"currentVersion": "1.1.6",
"currentVersion": "1.1.7",
"author": "BitSight",
"url": "https://service.bitsighttech.com/",
"email": "support@bitsight.com",
Expand Down
3 changes: 0 additions & 3 deletions Packs/BmcHelixRemedyForce/ReleaseNotes/1_0_21.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/BmcHelixRemedyForce/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "Bmc Helix Remedyforce",
"description": "Integration of BMC Helix Remedyforce with Cortex XSOAR. BMC Helix Remedyforce integration allows customers to create/update service requests and incidents. It also allows to update status, resolve service requests and incidents with customer notes. This integration exposes standard ticketing capabilities that can be utilized as part of automation & orchestration.",
"support": "xsoar",
"currentVersion": "1.0.21",
"currentVersion": "1.0.22",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
3 changes: 0 additions & 3 deletions Packs/BmcITSM/ReleaseNotes/1_0_3.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/BmcITSM/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "BMC Helix ITSM",
"description": "BMC Helix ITSM allows customers to manage service request, incident, change request, task, problem investigation and known error tickets.",
"support": "xsoar",
"currentVersion": "1.0.3",
"currentVersion": "1.0.4",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
3 changes: 0 additions & 3 deletions Packs/Box/ReleaseNotes/3_1_15.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/Box/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "Box",
"description": "Manage Box users",
"support": "xsoar",
"currentVersion": "3.1.15",
"currentVersion": "3.1.16",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
3 changes: 0 additions & 3 deletions Packs/CarbonBlackDefense/ReleaseNotes/3_0_18.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/CarbonBlackDefense/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "Carbon Black Endpoint Standard",
"description": "Next-generation antivirus + EDR in one cloud-delivered platform that stops commodity malware, advanced malware, non-malware attacks and ransomware.",
"support": "xsoar",
"currentVersion": "3.0.18",
"currentVersion": "3.0.19",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
3 changes: 0 additions & 3 deletions Packs/CiscoSMA/ReleaseNotes/1_1_5.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/CiscoSMA/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "CiscoSMA",
"description": "The Security Management Appliance (SMA) is used to centralize services from Email Security Appliances (ESAs) and Web Security Appliances (WSAs).",
"support": "xsoar",
"currentVersion": "1.1.5",
"currentVersion": "1.1.6",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
3 changes: 0 additions & 3 deletions Packs/Code42/ReleaseNotes/3_0_4.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/Code42/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "Code42",
"description": "The Code42 INCYDR integration accelerates insider threat incident response and remediation procedures for potential data exfiltration across computers, email, cloud and SaaS apps.",
"support": "partner",
"currentVersion": "3.0.4",
"currentVersion": "3.0.5",
"author": "Code42",
"url": "https://support.code42.com/Administrator/Cloud/Monitoring_and_managing/Install_and_manage_the_Code42_app_for_Cortex_XSOAR",
"email": "gethelp@code42.com",
Expand Down
4 changes: 0 additions & 4 deletions Packs/CommonScripts/ReleaseNotes/1_11_25.md

This file was deleted.

2 changes: 1 addition & 1 deletion Packs/CommonScripts/pack_metadata.json
Expand Up @@ -2,7 +2,7 @@
"name": "Common Scripts",
"description": "Frequently used scripts pack.",
"support": "xsoar",
"currentVersion": "1.11.25",
"currentVersion": "1.11.26",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
16 changes: 7 additions & 9 deletions Packs/ContentTesting/ReleaseNotes/1_1_0.md
Expand Up @@ -20,30 +20,28 @@
#### Scripts
##### ChangeHistory
- Updated the timeout to 600 seconds
- Updated the Docker image to: *demisto/python3:3.10.10.47713*.
- Updated the Docker image to: *demisto/python3:3.10.10.48392*.
##### New: UnitTestPBAStats
- Added support for playbook analysis statistics
##### ListPlaybookAutomationsCommands
- Fixed an issue for playbooks referencing missing automations
- Updated the timeout to 600 seconds
- Updated the Docker image to: *demisto/python3:3.10.10.47713*.
- Updated the Docker image to: *demisto/python3:3.10.10.48392*.
##### UnitTest
- Fixed an issue so playbooks with spaces in name do not require quotes in Ad Hoc Test button
- Fixed an issue in RunUTResults() to get arguments first in the event getting the automation ID throws an exception; uninitialized variable in the exception handler throws another exception, masking the original exception
- Updated the Docker image to: *demisto/python3:3.10.10.47713*.
- Updated the Docker image to: *demisto/python3:3.10.10.48392*.
##### New: UnitTestCoverage
- Added support for test coverage
(Available from Cortex XSOAR 6.5.0).
- Added support for test coverage (Available from Cortex XSOAR 6.5.0).
##### UnitTestLoadFields
- Fixed an issue to not overwrite incident type
- Updated the Docker image to: *demisto/python3:3.10.10.47713*.
- Updated the Docker image to: *demisto/python3:3.10.10.48392*.
##### UpgradeCheck
- Updated the timeout to 1200 seconds
- Updated the Docker image to: *demisto/python3:3.10.10.47713*.
- Updated the Docker image to: *demisto/python3:3.10.10.48392*.
##### New: UnitTestPBATaskMax
- Added support for playbook task maximum
##### New: UnitTestPlaybookAnalyzer
- Added support for playbook analysis
(Available from Cortex XSOAR 6.5.0).
- Added support for playbook analysis (Available from Cortex XSOAR 6.5.0).
##### New: UnitTestPBATaskAvg
- Added support for playbook task averages
Expand Up @@ -4,7 +4,7 @@ commonfields:
contentitemexportablefields:
contentitemfields:
fromServerVersion: ""
dockerimage: demisto/python3:3.10.10.47713
dockerimage: demisto/python3:3.10.10.48392
enabled: true
name: ChangeHistory
comment: ""
Expand Down
Expand Up @@ -6,7 +6,7 @@ commonfields:
contentitemexportablefields:
contentitemfields:
fromServerVersion: ""
dockerimage: demisto/python3:3.10.10.47713
dockerimage: demisto/python3:3.10.10.48392
enabled: true
name: ListPlaybookAutomationsCommands
runas: DBotWeakRole
Expand Down
2 changes: 1 addition & 1 deletion Packs/ContentTesting/Scripts/UnitTest/UnitTest.yml
Expand Up @@ -19,7 +19,7 @@ commonfields:
contentitemexportablefields:
contentitemfields:
fromServerVersion: ""
dockerimage: demisto/python3:3.10.10.47713
dockerimage: demisto/python3:3.10.10.48392
enabled: true
name: UnitTest
comment: ""
Expand Down
Expand Up @@ -9,7 +9,7 @@ commonfields:
contentitemexportablefields:
contentitemfields:
fromServerVersion: ""
dockerimage: demisto/python3:3.10.10.47713
dockerimage: demisto/python3:3.10.10.48392
enabled: true
name: UnitTestCoverage
runas: DBotWeakRole
Expand Down
Expand Up @@ -11,6 +11,7 @@ contentitemexportablefields:
dockerimage: demisto/python3:3.10.10.47713
enabled: true
name: UnitTestLoadFields
comment: ''
runas: DBotWeakRole
runonce: false
script: ''
Expand Down
Expand Up @@ -4,7 +4,7 @@ commonfields:
contentitemexportablefields:
contentitemfields:
fromServerVersion: ""
dockerimage: demisto/python3:3.10.10.47713
dockerimage: demisto/python3:3.10.10.48392
enabled: true
name: UnitTestPBAStats
comment: ""
Expand Down
Expand Up @@ -14,7 +14,6 @@
COLORS = [BLUE1, BLUE2, BLUE3, BLUE4, BLUE5, BLUE6]

FORMATS = ["bar", "pie"]
#FORMATS = ["bar", "pie", "line", "duration", "number"]
LAYOUTS = ["horizontal", "vertical"]

STATFIELD = 'avgdur'
Expand All @@ -29,7 +28,7 @@ class WidgetStat(TypedDict):


def NewWidgetStat(name: str, color: str, label: str, data: list) -> WidgetStat:
wstat: WidgetStat = {'name': name, 'color': color, 'data': [data], 'label': label, 'groups': None}
wstat: WidgetStat = {'name': name, 'color': color, 'data': [data], 'label': label, 'groups': []}
return wstat


Expand All @@ -48,12 +47,12 @@ def main():
if len(stats) == 0:
return
wstats: list[WidgetStat] = []
l = len(COLORS)
i = l
length = len(COLORS)
i = length
for key, val in stats.items():
if val[STATFIELD] == 0:
continue
newstat = NewWidgetStat("", COLORS[i % l], val['name'], val[STATFIELD])
newstat = NewWidgetStat("", COLORS[i % length], val['name'], val[STATFIELD])
wstats.append(newstat)
i += 1

Expand Down
Expand Up @@ -4,7 +4,7 @@ commonfields:
contentitemexportablefields:
contentitemfields:
fromServerVersion: ""
dockerimage: demisto/python3:3.10.10.47713
dockerimage: demisto/python3:3.10.10.48392
enabled: true
name: UnitTestPBATaskAvg
comment: ""
Expand Down
Expand Up @@ -14,7 +14,6 @@
COLORS = [BLUE1, BLUE2, BLUE3, BLUE4, BLUE5, BLUE6]

FORMATS = ["bar", "pie"]
#FORMATS = ["bar", "pie", "line", "duration", "number"]
LAYOUTS = ["horizontal", "vertical"]

STATFIELD = 'maxdur'
Expand All @@ -29,7 +28,7 @@ class WidgetStat(TypedDict):


def NewWidgetStat(name: str, color: str, label: str, data: list) -> WidgetStat:
wstat: WidgetStat = {'name': name, 'color': color, 'data': [data], 'label': label, 'groups': None}
wstat: WidgetStat = {'name': name, 'color': color, 'data': [data], 'label': label, 'groups': []}
return wstat


Expand All @@ -48,12 +47,12 @@ def main():
if len(stats) == 0:
return
wstats: list[WidgetStat] = []
l = len(COLORS)
i = l
length = len(COLORS)
i = length
for key, val in stats.items():
if val[STATFIELD] == 0:
continue
newstat = NewWidgetStat("", COLORS[i % l], val['name'], val[STATFIELD])
newstat = NewWidgetStat("", COLORS[i % length], val['name'], val[STATFIELD])
wstats.append(newstat)
i += 1

Expand Down
Expand Up @@ -4,7 +4,7 @@ commonfields:
contentitemexportablefields:
contentitemfields:
fromServerVersion: ""
dockerimage: demisto/python3:3.10.10.47713
dockerimage: demisto/python3:3.10.10.48392
enabled: true
name: UnitTestPBATaskMax
comment: ""
Expand Down
Expand Up @@ -47,25 +47,19 @@ def GetTasks(incid: str) -> list[Task]:
duration = -1.0
state = "Unknown"
started = 0
error = 0
waiting = 0
notexecuted = 0

if 'state' in t:
state = t['state']
if state == "Completed":
l = len(t['startDate']) - 9
start = date_to_timestamp(t['startDate'][:l], date_format='%Y-%m-%dT%H:%M:%S.%f')
end = date_to_timestamp(t['completedDate'][:l], date_format='%Y-%m-%dT%H:%M:%S.%f')
length = len(t['startDate']) - 9
start = date_to_timestamp(t['startDate'][:length], date_format='%Y-%m-%dT%H:%M:%S.%f')
end = date_to_timestamp(t['completedDate'][:length], date_format='%Y-%m-%dT%H:%M:%S.%f')
duration = end - start
elif state == "inprogress":
started = 1
elif state == "WillNotBeExecuted":
notexecuted = 1
elif state == "Error":
error = 1
elif state == "Waiting":
waiting = 1

newtask: Task = {'name': t['task']['name'], 'duration': duration, 'state': state,
'tid': t['id'], 'started': started, 'notexecuted': notexecuted}
Expand All @@ -84,7 +78,7 @@ def TaskStats(task: list[Task], taskstat: TaskStat) -> TaskStat:
if t['state'] == "Completed":
if dur > taskstat[tid]['maxdur']:
taskstat[tid]['maxdur'] = dur
if taskstat[tid]['mindur'] != None:
if taskstat[tid]['mindur'] is not None:
if dur < taskstat[tid]['mindur']:
taskstat[tid]['mindur'] = dur
else:
Expand All @@ -107,14 +101,12 @@ def TaskStats(task: list[Task], taskstat: TaskStat) -> TaskStat:


def GetTaskStats(playbookname: str, occurred: str) -> TaskStat:
#argument['fromdate'] = min_date.isoformat()
#argument['todate'] = max_date.isoformat()
argument = {'query': f'playbook:"{playbookname}" occurred:>="{occurred}"', 'size': 1000} # , 'sort': '%s.desc' % time_field}
response = execute_command("getIncidents", argument)
taskstat: TaskStat = {}
taskstats: TaskStat = {}
count = 0
if response['data'] != None:
if response['data'] is not None:
for inc in response['data']:
tasks = GetTasks(inc['id'])
taskstats = TaskStats(tasks, taskstat)
Expand Down Expand Up @@ -188,8 +180,8 @@ def EntityMarkdown(ent: Entity, count: int) -> str:
output = f"### Playbook: {ent['name']}\n"
output += f"#### Analysis Date: {datetime_to_string(datetime.now())}\n"
output += f"#### Incidents Analyzed: {count}\n"
pboutput = f"#### Sub-playbooks Called\n"
cmdoutput = f"#### Automations Called\n"
pboutput = "#### Sub-playbooks Called\n"
cmdoutput = "#### Automations Called\n"
for val in ent['calls']:
if val[:2] == "p.":
pboutput += f"- {val[2:]}\n"
Expand All @@ -198,7 +190,7 @@ def EntityMarkdown(ent: Entity, count: int) -> str:

output += pboutput
output += cmdoutput
output += f"\n#### Called by Parent Playbooks\n"
output += "\n#### Called by Parent Playbooks\n"
for val in ent['called']:
output += f"- {val[2:]}\n"

Expand All @@ -211,7 +203,7 @@ def StatsInfoMarkdown(stats: TaskStat) -> str:
markdown += "|---|:---:|:---:|:---:|\n"

for key, val in stats.items():
if val['mindur'] == None:
if val['mindur'] is None:
val['mindur'] = 0
markdown += f"|{val['name']}|{val['mindur']}|{val['avgdur']}|{val['maxdur']}|\n"

Expand Down

0 comments on commit 6508c35

Please sign in to comment.