Skip to content

Commit 1f4eb6f

Browse files
content-botfigarridoostolero
authored
Fix proxy usage (#85) (demisto#29630)
* Fix proxy usage (#85) (demisto#29181) * Fix proxy usage (#85) * Fix proxy usage in ZF client * Fix variable USE_SSL to verify requests * Remove proxy object from client Given that the proxy works by default with env vars, the proxy object is not necessary * Update version and add release notes * Fix call to modified alerts (#86) * Fix call to modified alerts * Update docker image * Fix tests associated with get modified data * change rn * fix validation --------- Co-authored-by: Felipe Garrido <[email protected]> Co-authored-by: ostolero <[email protected]> Co-authored-by: ostolero <[email protected]>
1 parent 991fbfa commit 1f4eb6f

File tree

5 files changed

+52
-48
lines changed

5 files changed

+52
-48
lines changed

Packs/ZeroFox/Integrations/ZeroFox/ZeroFox.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,10 +1100,9 @@ def get_modified_remote_data_command(
11001100
args = GetModifiedRemoteDataArgs(args)
11011101
last_update = args.last_update
11021102

1103-
# Get alerts created before `last_update` and modified after `last_update`
1103+
# Get alerts modified after `last_update`
11041104
list_alert_params = {
11051105
"last_modified_min_date": str(last_update),
1106-
"max_timestamp": str(last_update),
11071106
}
11081107

11091108
try:
@@ -1674,7 +1673,9 @@ def main():
16741673
FETCH_TIME: str = params.get(
16751674
"fetch_time", FETCH_TIME_DEFAULT,
16761675
).strip()
1677-
FETCH_LIMIT: int = int(demisto.params().get("fetch_limit", "100"))
1676+
FETCH_LIMIT: int = int(params.get("fetch_limit", "100"))
1677+
USE_SSL: bool = not params.get("insecure", False)
1678+
PROXY: bool = params.get('proxy', False)
16781679

16791680
commands: dict[str, Callable[[ZFClient, dict[str, Any]], Any]] = {
16801681
"get-modified-remote-data": get_modified_remote_data_command,
@@ -1700,15 +1701,17 @@ def main():
17001701
"zerofox-search-exploits": search_exploits_command,
17011702
}
17021703
try:
1704+
handle_proxy()
17031705
client = ZFClient(
17041706
base_url=BASE_URL,
17051707
ok_codes={200, 201},
17061708
username=USERNAME,
17071709
password=PASSWORD,
17081710
fetch_limit=FETCH_LIMIT,
1711+
verify=USE_SSL,
1712+
proxy=PROXY,
17091713
)
17101714

1711-
handle_proxy()
17121715
command = demisto.command()
17131716

17141717
if command == 'test-module':

Packs/ZeroFox/Integrations/ZeroFox/ZeroFox.yml

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -522,13 +522,13 @@ script:
522522
- default: false
523523
description: |-
524524
Indicates the type of string matching used for comparing entity names
525-
to impersonator names. It must be `true` or `false`
525+
to impersonator names. It must be `true` or `false`.
526526
isArray: false
527527
name: strict_name_matching
528528
- description: |-
529529
Comma-separated list of string tags for tagging the entity.
530530
For example:
531-
label1,label2,label3
531+
label1,label2,label3.
532532
isArray: true
533533
name: tags
534534
- description: The ID of the policy to assign to the new entity. Can be retrieved running the zerofox-get-policy-types command.
@@ -617,7 +617,7 @@ script:
617617
description: The organization associated with the entity.
618618
type: String
619619
- contextPath: ZeroFox.Entity.Tags
620-
description: A list of tags of the entity
620+
description: A list of tags of the entity.
621621
type: String
622622
- contextPath: ZeroFox.Entity.StrictNameMatching
623623
description: Indicates the type of string matching used for comparing entity names to impersonator names.
@@ -638,7 +638,7 @@ script:
638638
description: The ID of the type of entity.
639639
type: Number
640640
- contextPath: ZeroFox.Entity.TypeName
641-
description: The name of the type of entity
641+
description: The name of the type of entity.
642642
type: String
643643
- description: Shows a table of all entity type names and IDs in the War Room.
644644
name: zerofox-get-entity-types
@@ -648,25 +648,25 @@ script:
648648
- name: source
649649
required: true
650650
auto: PREDEFINED
651-
description: Content to be considered a threat
651+
description: Content to be considered a threat.
652652
type: keyValue
653653
- name: alert_type
654654
required: true
655655
auto: PREDEFINED
656-
description: Type of content acting as a threat, could be one of email, ip, domain, url, phone, mail_exchange, page_content or account
656+
description: Type of content acting as a threat, could be one of email, ip, domain, url, phone, mail_exchange, page_content or account.
657657
type: keyValue
658658
- name: violation
659659
required: true
660660
auto: PREDEFINED
661-
description: Type of infringement the submitted threat represents, could be one of phishing, malware, rogue_app, impersonation, trademark, copyright, private_data, fraud or other
661+
description: Type of infringement the submitted threat represents, could be one of phishing, malware, rogue_app, impersonation, trademark, copyright, private_data, fraud or other.
662662
type: keyValue
663663
- name: entity_id
664664
required: true
665665
auto: PREDEFINED
666-
description: Identifier of the entity being threatened by submitted content
666+
description: Identifier of the entity being threatened by submitted content.
667667
type: keyValue
668668
- name: notes
669-
description: Additional notes to include in submission
669+
description: Additional notes to include in submission.
670670
type: textArea
671671
deprecated: false
672672
description: Submits potential threats into the ZF alert registry for disruption.
@@ -680,104 +680,104 @@ script:
680680
arguments:
681681
- name: domain
682682
required: true
683-
description: Domain to search
683+
description: Domain to search.
684684
type: keyValue
685-
description: Looks for a given domain in Zerofox's CTI feeds
685+
description: Looks for a given domain in Zerofox's CTI feeds.
686686
outputs:
687687
- contextPath: ZeroFox.CompromisedDomains.Domain
688688
type: string
689-
description: Domain in which the search domain was found
689+
description: Domain in which the search domain was found.
690690
- contextPath: ZeroFox.CompromisedDomains.LastModified
691691
type: string
692-
description: Last time that the threat was found
692+
description: Last time that the threat was found.
693693
- contextPath: ZeroFox.CompromisedDomains.IPs
694694
type: string
695-
description: Related domains to the threat separated by commas
695+
description: Related domains to the threat separated by commas.
696696
- name: zerofox-search-compromised-email
697697
arguments:
698698
- name: email
699699
required: true
700700
auto: PREDEFINED
701-
description: email to search
701+
description: email to search.
702702
type: keyValue
703703
outputs:
704704
- contextPath: ZeroFox.CompromisedEmails.Domain
705705
type: string
706-
description: Domain in which the search domain was found
706+
description: Domain in which the search domain was found.
707707
- contextPath: ZeroFox.CompromisedEmails.Email
708708
type: string
709-
description: Email involved in the threat
709+
description: Email involved in the threat.
710710
- contextPath: ZeroFox.CompromisedEmails.CreatedAt
711711
type: string
712-
description: Date in which the email was found related to a threat
713-
description: Looks for a given email in ZeroFox's CTI feeds
712+
description: Date in which the email was found related to a threat.
713+
description: Looks for a given email in ZeroFox's CTI feeds.
714714
- name: zerofox-search-malicious-ip
715715
arguments:
716716
- name: ip
717717
required: true
718718
auto: PREDEFINED
719-
description: ip to search
719+
description: ip to search.
720720
type: keyValue
721721
outputs:
722722
- contextPath: ZeroFox.MaliciousIPs.Domain
723723
type: string
724-
description: Domain in which the search domain was found
724+
description: Domain in which the search domain was found.
725725
- contextPath: ZeroFox.MaliciousIPs.IPAddress
726726
type: string
727-
description: IP in which the search domain was found
727+
description: IP in which the search domain was found.
728728
- contextPath: ZeroFox.MaliciousIPs.CreatedAt
729729
type: string
730-
description: Date in which the ip was found related to a threat
731-
description: Looks for malicious ips in ZeroFox's CTI feeds
730+
description: Date in which the ip was found related to a threat.
731+
description: Looks for malicious ips in ZeroFox's CTI feeds.
732732
- name: zerofox-search-malicious-hash
733733
arguments:
734734
- name: hash
735735
required: true
736736
auto: PREDEFINED
737-
description: hash to search
737+
description: hash to search.
738738
type: keyValue
739739
outputs:
740740
- contextPath: ZeroFox.MaliciousHashes.CreatedAt
741-
description: Date in which the ip was found related to a threat
741+
description: Date in which the ip was found related to a threat.
742742
type: string
743743
- contextPath: ZeroFox.MaliciousHashes.Family
744-
description: Family related threat
744+
description: Family related threat.
745745
type: string
746746
- contextPath: ZeroFox.MaliciousHashes.MD5
747-
description: Hash in MD5 format
747+
description: Hash in MD5 format.
748748
type: string
749749
- contextPath: ZeroFox.MaliciousHashes.SHA1
750-
description: Hash in SHA1 format
750+
description: Hash in SHA1 format.
751751
type: string
752752
- contextPath: ZeroFox.MaliciousHashes.SHA256
753-
description: Hash in SHA256 format
753+
description: Hash in SHA256 format.
754754
type: string
755755
- contextPath: ZeroFox.MaliciousHashes.SHA512
756-
description: Hash in SHA512 format
756+
description: Hash in SHA512 format.
757757
type: string
758758
- contextPath: ZeroFox.MaliciousHashes.FoundHash
759-
description: Indicates in which hash format was found the search
759+
description: Indicates in which hash format was found the search.
760760
type: string
761-
description: Looks for registered hashes in ZeroFox's CTI feeds
761+
description: Looks for registered hashes in ZeroFox's CTI feeds.
762762
- name: zerofox-search-exploits
763763
arguments:
764764
- name: since
765765
required: true
766766
auto: PREDEFINED
767-
description: Staring date for exploit search
767+
description: Staring date for exploit search.
768768
type: keyValue
769769
outputs:
770770
- contextPath: ZeroFox.Exploits.CreatedAt
771-
description: Date in which the ip was found related to a threat
771+
description: Date in which the ip was found related to a threat.
772772
type: string
773773
- contextPath: ZeroFox.Exploits.CVECode
774-
description: CVE Code to identify the exploit
774+
description: CVE Code to identify the exploit.
775775
type: string
776776
- contextPath: ZeroFox.Exploits.URLs
777-
description: URLs associated to the threat separated by commas
777+
description: URLs associated to the threat separated by commas.
778778
type: string
779-
description: Looks for registered exploits in ZeroFox's CTI feeds
780-
dockerimage: demisto/python3:3.10.13.72123
779+
description: Looks for registered exploits in ZeroFox's CTI feeds.
780+
dockerimage: demisto/python3:3.10.13.73190
781781
isfetch: true
782782
longRunning: false
783783
longRunningPort: false

Packs/ZeroFox/Integrations/ZeroFox/ZeroFox_test.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ def test_get_modified_remote_data_command_with_no_data(requests_mock, mocker):
223223
spy.assert_called_once()
224224
list_alerts_call_args = spy.call_args[0][0]
225225
assert list_alerts_call_args["last_modified_min_date"] == args["lastUpdate"]
226-
assert list_alerts_call_args["max_timestamp"] == args["lastUpdate"]
227226
assert len(results.modified_incident_ids) == 0
228227

229228

@@ -249,7 +248,6 @@ def test_get_modified_remote_data_command(requests_mock, mocker):
249248
spy.assert_called_once()
250249
list_alerts_call_args = spy.call_args[0][0]
251250
assert list_alerts_call_args["last_modified_min_date"] == args["lastUpdate"]
252-
assert list_alerts_call_args["max_timestamp"] == args["lastUpdate"]
253251
assert len(results.modified_incident_ids) == 10
254252
for modified_incident_id in results.modified_incident_ids:
255253
assert isinstance(modified_incident_id, str)

Packs/ZeroFox/ReleaseNotes/1_1_2.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#### Integrations
2+
##### ZeroFox
3+
- Fixed an issue related to the usage of a proxy.
4+
- Updated the Docker image to: *demisto/python3:3.10.13.73190*.

Packs/ZeroFox/pack_metadata.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
"name": "ZeroFox",
33
"description": "Cloud-based SaaS to detect risks found on social media and digital channels.",
44
"support": "partner",
5-
"currentVersion": "1.1.1",
5+
"currentVersion": "1.1.2",
66
"author": "ZeroFox",
77
"url": "https://www.zerofox.com/contact-us/",
88
"email": "[email protected]",
9-
109
"created": "2020-04-14T00:00:00Z",
1110
"categories": [
1211
"Data Enrichment & Threat Intelligence"
@@ -20,4 +19,4 @@
2019
],
2120
"dependencies": {},
2221
"displayedImages": []
23-
}
22+
}

0 commit comments

Comments
 (0)