-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data Enrichment and Threat Intelligence
and Authentication
templates
#4462
Conversation
@kirbles19 need to review .yml files and python files. |
return_error(err_msg, error=e) | ||
|
||
|
||
if __name__ == '__builtin__': # pragma: no cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the pragma comment here for ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for coverage that I run on the files.
I'm trying to add it to the circle also.
|
||
def main(): # pragma: no cover | ||
params = demisto.params() | ||
base_url = params.get('url', '').rstrip('/') + '/api/v1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use f-strings here
return { | ||
'user': credentials.get('username'), | ||
'name': credentials.get('name'), | ||
'password': credentials.get('password'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove trailing comma
return { | ||
'Username': credentials.get('username'), | ||
'Name': credentials.get('name'), | ||
'IsLocked': credentials.get('isLocked'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove trailing comma
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return_error(err_msg, error=e) | ||
|
||
|
||
if __name__ == '__builtin__': # pragma: no cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if __name__ == '__builtin__': # pragma: no cover | |
if __name__ == 'builtins': # pragma: no cover |
name: url | ||
required: true | ||
type: 0 | ||
- defaultvalue: 'true' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove default value
Templates/Integrations/DataEnrichmentThreatIntelligence/DataEnrichmentThreatIntelligence.yml
Show resolved
Hide resolved
name: insecure | ||
required: false | ||
type: 8 | ||
- display: Use system proxy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- display: Use system proxy | |
- display: Use system proxy settings |
required: true | ||
type: 0 | ||
- defaultvalue: 'true' | ||
display: Trust any certificate (insecure) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
display: Trust any certificate (insecure) | |
display: Trust any certificate (not secure) |
# Conflicts: # Tests/secrets_white_list.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, see my comments
from typing import Dict, Tuple, Optional, List, Union | ||
import urllib3 | ||
|
||
# Disable insecure warnings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be in CommonServerPython (next to the requests import.
|
||
|
||
class Client(BaseClient): | ||
def __init__(self, base_url, threshold: int = 70, *args, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def __init__(self, base_url, threshold: int = 70, *args, **kwargs): | |
def __init__(self, base_url, threshold: int = DEFAULT_THRESHOLD, *args, **kwargs): |
""" | ||
if isinstance(results, list): | ||
return [build_entry_context(entry, indicator_type) for entry in results] # pragma: no cover | ||
return { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add blank line after condition block
raw_response = client.get_domain(url) | ||
results = raw_response.get('result') | ||
if results: | ||
result = results[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why only the first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because the api will return one result per call with 1 domain.
and added argument descriptions to two arguments.
@jochman Done reviewing both YMLs. |
Status
Ready
Description
New
Data Enrichment and Threat Intelligence
andAuthentication
templates.Does it break backward compatibility?
Must have
Technical writer review
Mention and link to the files that require a technical writer review.
Authentication
DETI