Skip to content

Commit

Permalink
PAPP-31096, PAPP-30822: Updated requests, certifi, requests, urllib3 …
Browse files Browse the repository at this point in the history
…dependencies (#7)

* PAPP-30822: Updated requests dependencies

* Update README.md

* Done pre-commit changes

---------

Co-authored-by: splunk-soar-connectors-admin <admin@splunksoar>
Co-authored-by: Ishan Shah <[email protected]>
  • Loading branch information
3 people authored Sep 9, 2024
1 parent cafa1d4 commit 25a68d3
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Linting
on: [push, pull_request]
jobs:
lint:
lint:
# Run per push for internal contributers. This isn't possible for forked pull requests,
# so we'll need to run on PR events for external contributers.
# String comparison below is case insensitive.
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/phantomcyber/dev-cicd-tools
rev: v1.16
rev: v1.18
hooks:
- id: org-hook
- id: package-app-dependencies
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--no-verify', '--exclude-files', '^dns.json$']
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2016-2022 Splunk Inc.
Copyright 2016-2024 Splunk Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
14 changes: 1 addition & 13 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
Splunk SOAR DNS
Copyright (c) 2016-2022 Splunk Inc.
Copyright (c) 2016-2024 Splunk Inc.

Third-party Software Attributions:

Library: beautifulsoup4
Version: 4.9.1
License: MIT
Copyright 2004-2017 Leonard Richardson
Copyright 2004-2019 Leonard Richardson
Copyright 2018 Isaac Muse

Library: dnspython
Version: 1.16.0
License: ISC
Copyright 2001-2017 Nominum, Inc
Copyright Dnspython Contributors

Library: requests
Version: 2.25.0
License: Apache 2.0
Kenneth Reitz
74 changes: 38 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# DNS

Publisher: Splunk
Connector Version: 2\.0\.23
Connector Version: 2.0.25
Product Vendor: Generic
Product Name: DNS
Product Version Supported (regex): "\.\*"
Minimum Product Version: 5\.0\.0
Product Version Supported (regex): ".\*"
Minimum Product Version: 5.1.0

This app implements investigative actions that return DNS Records for the object queried

[comment]: # " File: readme.md"
[comment]: # " Copyright (c) 2016-2022 Splunk Inc."
[comment]: # " File: README.md"
[comment]: # " Copyright (c) 2016-2024 Splunk Inc."
[comment]: # ""
[comment]: # "Licensed under the Apache License, Version 2.0 (the 'License');"
[comment]: # "you may not use this file except in compliance with the License."
Expand All @@ -34,8 +34,8 @@ The below configuration variables are required for this Connector to operate. T

VARIABLE | REQUIRED | TYPE | DESCRIPTION
-------- | -------- | ---- | -----------
**dns\_server** | optional | string | IP of the DNS server for lookups
**host\_name** | optional | string | Hostname to be used in test connectivity
**dns_server** | optional | string | IP of the DNS server for lookups
**host_name** | optional | string | Hostname to be used in test connectivity

### Supported Actions
[test connectivity](#action-test-connectivity) - Validate the asset configuration for connectivity
Expand All @@ -60,7 +60,7 @@ Query DNS records for a Domain or Host Name
Type: **investigate**
Read only: **True**

A list of record <b>types</b> to be resolved is supplied, one of which the user may choose as the value for the <b>type</b> parameter, these are\:<br><ul><li>A</li><li>AAAA</li><li>CNAME</li><li>HINFO</li><li>ISDN</li><li>MX</li><li>NS</li><li>SOA</li><li>TXT</li></ul>When taking a lookup domain action from a Playbook, the author can look up arbitrary DNS record types by supplying the desired record type as a string for the <b>type</b> parameter\.
A list of record <b>types</b> to be resolved is supplied, one of which the user may choose as the value for the <b>type</b> parameter, these are:<br><ul><li>A</li><li>AAAA</li><li>CNAME</li><li>HINFO</li><li>ISDN</li><li>MX</li><li>NS</li><li>SOA</li><li>TXT</li></ul>When taking a lookup domain action from a Playbook, the author can look up arbitrary DNS record types by supplying the desired record type as a string for the <b>type</b> parameter.

#### Action Parameters
PARAMETER | REQUIRED | DESCRIPTION | TYPE | CONTAINS
Expand All @@ -69,45 +69,47 @@ PARAMETER | REQUIRED | DESCRIPTION | TYPE | CONTAINS
**type** | optional | DNS Record Type | string |

#### Action Output
DATA PATH | TYPE | CONTAINS
--------- | ---- | --------
action\_result\.status | string |
action\_result\.parameter\.domain | string | `host name` `domain`
action\_result\.parameter\.type | string |
action\_result\.data\.\*\.record\_info\_objects\.\*\.record\_info | string | `ip`
action\_result\.data\.\*\.record\_infos | string | `ip`
action\_result\.summary\.cannonical\_name | string |
action\_result\.summary\.canonical\_name | string |
action\_result\.summary\.hostname | string | `host name` `domain`
action\_result\.summary\.record\_info | string | `ip`
action\_result\.summary\.total\_record\_infos | numeric |
action\_result\.message | string |
summary\.total\_objects | numeric |
summary\.total\_objects\_successful | numeric |
DATA PATH | TYPE | CONTAINS | EXAMPLE VALUES
--------- | ---- | -------- | --------------
action_result.status | string | | success failed
action_result.parameter.domain | string | `host name` `domain` | test.com
action_result.parameter.type | string | |
action_result.data.\*.record_info_objects.\*.record_info | string | `ip` | 122.122.122.122
action_result.data.\*.record_infos | string | `ip` | 122.122.122.122
action_result.summary.cannonical_name | string | | phantomtest.com. test.com.
action_result.summary.canonical_name | string | |
action_result.summary.hostname | string | `host name` `domain` | ffobaaar.com
action_result.summary.record_info | string | `ip` | 122.122.122.122
action_result.summary.total_record_infos | numeric | | 1 6
action_result.message | string | | None of DNS query names exist: ['ffobaaar.com.', 'ffobaaar.com.localdomain.'] Record info: 54.239.25.192, Total record infos: 6, Cannonical name: amazon.com.
summary.total_objects | numeric | | 1
summary.total_objects_successful | numeric | | 1

## action: 'lookup ip'
Query Reverse DNS records for an IP

Type: **investigate**
Read only: **True**

The <b>lookup ip</b> action takes an IP address parameter\. The IP address \(IPv4 or IPv6\) will be looked up against the appropriate reverse lookup DNS records, and any associate hostname\(s\) will be returned\. Only <b>PTR</b> type lookups are returned\.
The <b>lookup ip</b> action takes an IP address parameter. The IP address (IPv4 or IPv6) will be looked up against the appropriate reverse lookup DNS records, and any associate hostname(s) will be returned. Only <b>PTR</b> type lookups are returned.

#### Action Parameters
PARAMETER | REQUIRED | DESCRIPTION | TYPE | CONTAINS
--------- | -------- | ----------- | ---- | --------
**ip** | required | IP to resolve | string | `ip`

#### Action Output
DATA PATH | TYPE | CONTAINS
--------- | ---- | --------
action\_result\.status | string |
action\_result\.parameter\.ip | string | `ip`
action\_result\.data | string |
action\_result\.summary\.cannonical\_name | string |
action\_result\.summary\.canonical\_name | string |
action\_result\.summary\.hostname | string | `host name` `domain`
action\_result\.summary\.ip | string | `ip`
action\_result\.message | string |
summary\.total\_objects | numeric |
summary\.total\_objects\_successful | numeric |
DATA PATH | TYPE | CONTAINS | EXAMPLE VALUES
--------- | ---- | -------- | --------------
action_result.status | string | | success failed
action_result.parameter.ip | string | `ip` | 122.122.122.122 123.123.123.123
action_result.data | string | |
action_result.summary.cannonical_name | string | | 122.122.122.122.in-addr.arpa.
action_result.summary.canonical_name | string | |
action_result.summary.hostname | string | `host name` `domain` | ec2-52-91-186-198.compute-1.test.com.
action_result.summary.ip | string | `ip` | 122.122.122.122
action_result.message | string | | Ip: 122.122.122.122
Hostname: ec2-52-91-186-198.compute-1.test.com.
Cannonical name: 122.122.122.122.in-addr.arpa. The DNS query name does not exist: 123.123.123.123.in-addr.arpa.
summary.total_objects | numeric | | 1
summary.total_objects_successful | numeric | | 1
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File: __init__.py
#
# Copyright (c) 2016-2022 Splunk Inc.
# Copyright (c) 2016-2024 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
5 changes: 2 additions & 3 deletions display_ip.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% block widget_content %} <!-- Main Start Block -->

<!-- File: display_ip.html
Copyright (c) 2016-2022 Splunk Inc.
Copyright (c) 2016-2024 Splunk Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -111,7 +111,7 @@ <h3 class="wf-h3-style">Info</h3>
{% if result.data.record_infos %}
<table class="wf-table-horizontal">
{% if result.param.type == 'A' or result.param.type == 'AAAA' %}
<tr><th>IP</th></tr>
<tr><th>IP</th></tr>
{% else %}
<tr><th>Record Info</th></tr>
{% endif %}
Expand Down Expand Up @@ -145,4 +145,3 @@ <h3 class="wf-h3-style">Info</h3>
</div> <!-- Main Div -->

{% endblock %} <!-- Main Start Block -->

10 changes: 5 additions & 5 deletions dns.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"publisher": "Splunk",
"package_name": "phantom_dns",
"type": "information",
"license": "Copyright (c) 2016-2022 Splunk Inc.",
"license": "Copyright (c) 2016-2024 Splunk Inc.",
"main_module": "dns_connector.py",
"app_version": "2.0.24",
"app_version": "2.0.25",
"utctime_updated": "2022-01-31T19:38:57.000000Z",
"product_vendor": "Generic",
"product_name": "DNS",
Expand All @@ -28,8 +28,8 @@
"pip_dependencies": {
"wheel": [
{
"module": "dns",
"input_file": "dnspython/dnspython-1.16.0-py2.py3-none-any.whl"
"module": "dnspython",
"input_file": "wheels/shared/dnspython-1.16.0-py2.py3-none-any.whl"
}
]
},
Expand Down Expand Up @@ -328,4 +328,4 @@
"versions": "EQ(*)"
}
]
}
}
6 changes: 5 additions & 1 deletion dns_connector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File: dns_connector.py
#
# Copyright (c) 2016-2022 Splunk Inc.
# Copyright (c) 2016-2024 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -156,6 +156,8 @@ def _handle_forward_lookup(self, param):
action_result = ActionResult(dict(param))
self.add_action_result(action_result)

self.save_progress(EXECUTION_START_MESSAGE.format(self.ACTION_ID_FORWARD_LOOKUP))

# get the server
server = self._server
host = param.get('domain')
Expand Down Expand Up @@ -205,6 +207,8 @@ def _handle_reverse_lookup(self, param):
action_result = ActionResult(dict(param))
self.add_action_result(action_result)

self.save_progress(EXECUTION_START_MESSAGE.format(self.ACTION_ID_REVERSE_LOOKUP))

# get the server
server = self._server
host = param.get('ip')
Expand Down
4 changes: 3 additions & 1 deletion dns_consts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File: dns_consts.py
#
# Copyright (c) 2016-2022 Splunk Inc.
# Copyright (c) 2016-2024 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,4 +16,6 @@
SAMPLEDNS_SUCC_QUERY = "Host lookup successful"
SAMPLEDNS_ERR_QUERY_RETURNED_NO_DATA = "Lookup did not return any information"

EXECUTION_START_MESSAGE = "Executing {0} action"

SAMPLEDNS_DEFAULT_REQUEST_TIMEOUT = 30 # in seconds
2 changes: 1 addition & 1 deletion dns_view.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File: dns_view.py
#
# Copyright (c) 2016-2022 Splunk Inc.
# Copyright (c) 2016-2024 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
5 changes: 0 additions & 5 deletions exclude_files.txt

This file was deleted.

2 changes: 1 addition & 1 deletion logo_splunk.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion logo_splunk_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion manual_readme_content.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[comment]: # " File: README.md"
[comment]: # " Copyright (c) 2016-2022 Splunk Inc."
[comment]: # " Copyright (c) 2016-2024 Splunk Inc."
[comment]: # ""
[comment]: # "Licensed under the Apache License, Version 2.0 (the 'License');"
[comment]: # "you may not use this file except in compliance with the License."
Expand Down
1 change: 1 addition & 0 deletions release_notes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**Unreleased**
* Removed certifi, requests and urllib dependencies in order to use platform packages [PAPP-31096, PAPP-30822, PAPP-33451]
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
beautifulsoup4==4.9.1
dnspython==1.16.0
requests==2.25.0
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
max-line-length = 145
max-complexity = 28
extend-ignore = F403,E128,E126,E111,E121,E127,E731,E201,E202,F405,E722,D,W292

[isort]
line_length = 145

0 comments on commit 25a68d3

Please sign in to comment.