Skip to content

Commit

Permalink
Fix Pylint errors in G + H packs (#38058)
Browse files Browse the repository at this point in the history
* g + h

* fixed pylint

* docker image

* pylint error

* Revert "pylint error"

This reverts commit 04ab687.
  • Loading branch information
RotemAmit authored Jan 9, 2025
1 parent 8f6d806 commit 5ee1e8d
Show file tree
Hide file tree
Showing 24 changed files with 309 additions and 257 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def fetch_indicators(client: Client, url: str, limit: int = None, params: dict =
if params:
feed_tags = argToList(params.get('feedTags', []))
tlp_color = params.get('tlp_color')
else:
feed_tags = None
tlp_color = None
response = client.http_request(url)
indicators_list = []
demisto.debug('Fetch of indicators started ###')
Expand All @@ -84,9 +87,8 @@ def fetch_indicators(client: Client, url: str, limit: int = None, params: dict =
else:
line = line.split(':')[0]
type_ = "IP"
elif type_ == "URL":
if not line.startswith('http://') and not line.startswith('https://'):
line = 'http://' + line
elif type_ == "URL" and not line.startswith('http://') and not line.startswith('https://'):
line = 'http://' + line
raw_data = {
'value': line,
'type': type_,
Expand All @@ -104,9 +106,8 @@ def fetch_indicators(client: Client, url: str, limit: int = None, params: dict =
indicator_obj['fields']['trafficlightprotocol'] = tlp_color
indicators_list.append(indicator_obj)
# If limit is reached, break loop
if limit and isinstance(limit, int):
if len(indicators_list) >= limit:
break
if limit and isinstance(limit, int) and len(indicators_list) >= limit:
break
else:
demisto.error(f"Error: {response.status_code} - {response.json()['message']}")
return indicators_list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ script:
defaultValue: "50"
name: gh-maltrail-get-indicators
description: Get indicators from the feed.
dockerimage: demisto/python3:3.11.10.116439
dockerimage: demisto/python3:3.11.10.116949
feed: true
runonce: false
script: ''
Expand Down
5 changes: 5 additions & 0 deletions Packs/GithubMaltrailFeed/ReleaseNotes/1_0_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#### Integrations

##### Github Maltrail Feed
- Code functionality improvements.
- Updated the Docker image to: *demisto/python3:3.11.10.116949*.
2 changes: 1 addition & 1 deletion Packs/GithubMaltrailFeed/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Github Maltrail Feed",
"description": "Maltrail is a malicious traffic detection system, utilizing publicly available (black)lists containing malicious and/or generally suspicious trails, along with static trails compiled from various AV reports and custom user defined lists, where trail can be anything from domain name (e.g. zvpprsensinaix.com for Banjori malware), URL (e.g. hXXp://109.162.38.120/harsh02.exe for known malicious executable), IP address (e.g. 185.130.5.231 for known attacker) or HTTP User-Agent header value (e.g. sqlmap for automatic SQL injection and database takeover tool). Also, it uses (optional) advanced heuristic mechanisms that can help in discovery of unknown threats (e.g. new malware).\n\nhttps://github.com/stamparm/maltrail",
"support": "community",
"currentVersion": "1.0.1",
"currentVersion": "1.0.2",
"author": "Abel S. Santamarina",
"url": "",
"email": "",
Expand Down
Loading

0 comments on commit 5ee1e8d

Please sign in to comment.