Skip to content

Commit 392711b

Browse files
authored
[SOAR-15852] WHOIS Version Bump (#2093)
* add empty init file and refresh and plugin.spec updates * unit tests * Domain action unit tests and Address unit tests started * Address action unit tests * Added custom version to requirements.txt * Changed name of unit test * ran black
1 parent 56bb7ed commit 392711b

30 files changed

+655
-236
lines changed

plugins/whois/.CHECKSUM

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"spec": "07e61afc61329eddafd572b937e10746",
3-
"manifest": "12b6a25b98a92d19ce77924eb5b02cde",
4-
"setup": "4889069ba412bd9db5897f177e616f22",
2+
"spec": "3a7d86e5fd81a2c2b509afb5082c0809",
3+
"manifest": "d017956e73aa52cebf36bb618a75ecb1",
4+
"setup": "c159bd33a00b0b2dcd34810018d83f9d",
55
"schemas": [
66
{
77
"identifier": "address/schema.py",
8-
"hash": "0cc9eeec848619d580985ff56b407ced"
8+
"hash": "3c518027a07a0388a03c5d0982dffda5"
99
},
1010
{
1111
"identifier": "domain/schema.py",
12-
"hash": "262807bfb2fb5735efc5e9ba0ea1fc97"
12+
"hash": "ed05313e454847638eeec6cbd38ddbc8"
1313
},
1414
{
1515
"identifier": "connection/schema.py",
16-
"hash": "da5382221ca2a33a2f854e17b068d502"
16+
"hash": "bd524b567f9638ba1c6f7e0c9e45ff2e"
1717
}
1818
]
1919
}

plugins/whois/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
FROM rapid7/insightconnect-python-3-38-plugin:4
2-
LABEL organization=komand
1+
FROM rapid7/insightconnect-python-3-38-plugin:5
2+
3+
LABEL organization=rapid7
34
LABEL sdk=python
45
LABEL type=plugin
56

plugins/whois/bin/komand_whois

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env python
2-
# GENERATED BY KOMAND SDK - DO NOT EDIT
2+
# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT
33
import os
44
import json
55
from sys import argv
66

77
Name = "WHOIS"
88
Vendor = "rapid7"
9-
Version = "3.1.0"
10-
Description = "The WHOIS plugin enables address and domain lookups in the WHOIS databases"
9+
Version = "3.1.1"
10+
Description = "WHOIS is a query and response protocol that is widely used for querying databases that store the registered users or assignee's of an Internet resource, such as a domain name, an IP address block, or an autonomous system"
1111

1212

1313
def main():
@@ -23,7 +23,7 @@ def main():
2323
monkey.patch_all()
2424

2525
import insightconnect_plugin_runtime
26-
from komand_whois import connection, actions, triggers
26+
from komand_whois import connection, actions, triggers, tasks
2727

2828
class ICONWhois(insightconnect_plugin_runtime.Plugin):
2929
def __init__(self):
@@ -34,10 +34,10 @@ def main():
3434
description=Description,
3535
connection=connection.Connection()
3636
)
37-
self.add_action(actions.Address())
38-
3937
self.add_action(actions.Domain())
40-
38+
39+
self.add_action(actions.Address())
40+
4141

4242
"""Run plugin"""
4343
cli = insightconnect_plugin_runtime.CLI(ICONWhois())

plugins/whois/help.md

Lines changed: 117 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -5,95 +5,39 @@ databases that store the registered users or assignee's of an Internet resource,
55
block, or an autonomous system.
66

77
# Key Features
8-
8+
99
* Perform a WHOIS lookup for a provided IP address or domain to gain information on who is responsible for a domain or IP
1010

1111
# Requirements
12+
13+
* This plugin does not contain any requirements
1214

13-
* _This plugin does not contain any requirements._
15+
# Supported Product Versions
16+
17+
* 2023-10-31
1418

1519
# Documentation
1620

1721
## Setup
18-
19-
_This plugin does not contain a connection._
22+
23+
*This plugin does not contain a connection.*
2024

2125
## Technical Details
2226

2327
### Actions
2428

25-
#### Domain Lookup
26-
27-
This action is used to retrieve data about a domain name.
28-
29-
##### Input
30-
31-
|Name|Type|Default|Required|Description|Enum|Example|
32-
|----|----|-------|--------|-----------|----|-------|
33-
|domain|string|None|True|Domain name to lookup|None|rapid7.com|
34-
35-
Example input:
36-
37-
```
38-
{
39-
"domain": "rapid7.com"
40-
}
41-
```
42-
43-
##### Output
44-
45-
|Name|Type|Required|Description|
46-
|----|----|--------|-----------|
47-
|creation_date|date|False|Creation date|
48-
|dnssec|string|False|DNSSEC|
49-
|domain_status|[]string|False|Domain status|
50-
|expiration_date|date|False|Expiration date|
51-
|last_updated|date|False|Last updated date|
52-
|name|string|False|Domain name|
53-
|name_servers|[]string|False|Nameservers|
54-
|registrant_cc|string|False|Registrant country|
55-
|registrant_name|string|False|Registrant name|
56-
|registrar|string|False|Domain registrar|
57-
|registrar_abuse_contact_email|string|False|Registrar abuse contact email|
58-
|registrar_abuse_contact_phone|string|False|Registrar abuse Contact phone|
59-
|registrar_iana_id|string|False|Registrar IANA ID|
60-
|registrar_url|string|False|Registrar URL|
61-
|registrar_whois_server|string|False|Registrar WHOIS server|
62-
|registry_domain_id|string|False|Registry domain ID|
63-
64-
Example output:
65-
66-
```
67-
68-
{
69-
"registrar_whois_server": "whois.markmonitor.com",
70-
"registry_domain_id": "2138514_domain_com-vrsn",
71-
"last_updated": "2011-07-20T16:55:31",
72-
"registrar_iana_id": "292",
73-
"registrar": "MarkMonitor Inc.",
74-
"dnssec": "unsigned",
75-
"domain_status": ["clientdeleteprohibited https://icann.org/epp#clientdeleteprohibited", "clienttransferprohibited https://icann.org/epp#clienttransferprohibited", "clientupdateprohibited https://icann.org/epp#clientupdateprohibited", "serverdeleteprohibited https://icann.org/epp#serverdeleteprohibited", "servertransferprohibited https://icann.org/epp#servertransferprohibited", "serverupdateprohibited https://icann.org/epp#serverupdateprohibited"],
76-
"registrar_url": "http://www.markmonitor.com",
77-
"creation_date": "1997-09-15T04:00:00",
78-
"name_servers": ["ns2.google.com", "ns3.google.com", "ns1.google.com", "ns4.google.com"],
79-
"registrar_abuse_contact_email": "[email protected]",
80-
"registrar_abuse_contact_phone": "+1.2083895740",
81-
"name": "google.com"
82-
}
83-
84-
```
8529

8630
#### Address Lookup
87-
88-
This action is used to retrieve data about an IP address.
31+
32+
This action is used to retrieve data about an IP address
8933

9034
##### Input
9135

9236
|Name|Type|Default|Required|Description|Enum|Example|
93-
|----|----|-------|--------|-----------|----|-------|
37+
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
9438
|address|string|None|True|IP to Lookup|None|198.51.100.100|
9539
|registrar|string|Autodetect|False|Domain Registrar|['Autodetect', 'RIPE', 'ARIN', 'LACNIC', 'APNIC']|Autodetect|
96-
40+
9741
Example input:
9842

9943
```
@@ -105,30 +49,29 @@ Example input:
10549

10650
##### Output
10751

108-
|Name|Type|Required|Description|
109-
|----|----|--------|-----------|
110-
|address|string|False|Address|
111-
|cidr|string|False|CIDR|
112-
|city|string|False|City|
113-
|country|string|False|Country|
114-
|netname|string|False|Network name|
115-
|netrange|string|False|Network Range|
116-
|nettype|string|False|Network type|
117-
|org_abuse_email|string|False|Organization abuse e-mail|
118-
|org_abuse_phone|string|False|Organization abuse phone|
119-
|org_tech_email|string|False|Organization tech e-mail|
120-
|org_tech_phone|string|False|Organization tech phone|
121-
|organization|string|False|Organization|
122-
|orgname|string|False|Organization name|
123-
|postal|string|False|Postal|
124-
|regdate|string|False|Registration date|
125-
|state|string|False|State|
126-
|update|string|False|WHOIS updated date|
127-
52+
|Name|Type|Required|Description|Example|
53+
| :--- | :--- | :--- | :--- | :--- |
54+
|address|string|False|Address|1025 Eldorado Blvd.|
55+
|cidr|string|False|CIDR|8.0.0.0/8|
56+
|city|string|False|City|Broomfield|
57+
|country|string|False|Country|US|
58+
|netname|string|False|Network name|LVLT-ORG-8-8|
59+
|netrange|string|False|Network Range|8.0.0.0 - 8.255.255.255|
60+
|nettype|string|False|Network type|Direct Allocation|
61+
|org_abuse_email|string|False|Organization abuse e-mail|[email protected]|
62+
|org_abuse_phone|string|False|Organization abuse phone|+1-877-453-8353 |
63+
|org_tech_email|string|False|Organization tech e-mail|[email protected]|
64+
|org_tech_phone|string|False|Organization tech phone|+1-877-453-8353 |
65+
|organization|string|False|Organization|Level 3 Communications, Inc. (LVLT)|
66+
|orgname|string|False|Organization name|Level 3 Communications, Inc.|
67+
|postal|string|False|Postal|80021|
68+
|regdate|string|False|Registration date|1992-12-01|
69+
|state|string|False|State|CO|
70+
|update|string|False|WHOIS updated date|2012-02-24|
71+
12872
Example output:
12973

13074
```
131-
13275
{
13376
"address": "1025 Eldorado Blvd.",
13477
"cidr": "8.0.0.0/8",
@@ -143,28 +86,105 @@ Example output:
14386
"org_tech_phone": "+1-877-453-8353 ",
14487
"organization": "Level 3 Communications, Inc. (LVLT)",
14588
"orgname": "Level 3 Communications, Inc.",
146-
"postal": "80021",
89+
"postal": 80021,
14790
"regdate": "1992-12-01",
14891
"state": "CO",
14992
"update": "2012-02-24"
15093
}
94+
```
95+
96+
#### Domain Lookup
97+
98+
This action is used to retrieve data about a domain name
99+
100+
##### Input
101+
102+
|Name|Type|Default|Required|Description|Enum|Example|
103+
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
104+
|domain|string|None|True|Domain name to lookup|None|rapid7.com|
105+
106+
Example input:
151107

108+
```
109+
{
110+
"domain": "rapid7.com"
111+
}
152112
```
153113

154-
### Triggers
114+
##### Output
115+
116+
|Name|Type|Required|Description|Example|
117+
| :--- | :--- | :--- | :--- | :--- |
118+
|creation_date|date|False|Creation date|1997-09-15T04:00:00|
119+
|dnssec|string|False|DNSSEC|unsigned|
120+
|domain_status|[]string|False|Domain status|["clientdeleteprohibited https://icann.org/epp#clientdeleteprohibited", "clienttransferprohibited https://icann.org/epp#clienttransferprohibited", "clientupdateprohibited https://icann.org/epp#clientupdateprohibited", "serverdeleteprohibited https://icann.org/epp#serverdeleteprohibited", "servertransferprohibited https://icann.org/epp#servertransferprohibited", "serverupdateprohibited https://icann.org/epp#serverupdateprohibited"]|
121+
|expiration_date|date|False|Expiration date||
122+
|last_updated|date|False|Last updated date||
123+
|name|string|False|Domain name|google.com|
124+
|name_servers|[]string|False|Nameservers|["ns2.google.com", "ns3.google.com", "ns1.google.com", "ns4.google.com"]|
125+
|registrant_cc|string|False|Registrant country|US|
126+
|registrant_name|string|False|Registrant name||
127+
|registrar|string|False|Domain registrar|MarkMonitor Inc.|
128+
|registrar_abuse_contact_email|string|False|Registrar abuse contact email|[email protected]|
129+
|registrar_abuse_contact_phone|string|False|Registrar abuse Contact phone|+1.2083895740|
130+
|registrar_iana_id|string|False|Registrar IANA ID|292|
131+
|registrar_url|string|False|Registrar URL|http://www.markmonitor.com|
132+
|registrar_whois_server|string|False|Registrar WHOIS server|whois.markmonitor.com|
133+
|registry_domain_id|string|False|Registry domain ID|2138514_domain_com-vrsn|
134+
135+
Example output:
155136

156-
_This plugin does not contain any triggers._
137+
```
138+
{
139+
"creation_date": "1997-09-15T04:00:00",
140+
"dnssec": "unsigned",
141+
"domain_status": [
142+
"clientdeleteprohibited https://icann.org/epp#clientdeleteprohibited",
143+
"clienttransferprohibited https://icann.org/epp#clienttransferprohibited",
144+
"clientupdateprohibited https://icann.org/epp#clientupdateprohibited",
145+
"serverdeleteprohibited https://icann.org/epp#serverdeleteprohibited",
146+
"servertransferprohibited https://icann.org/epp#servertransferprohibited",
147+
"serverupdateprohibited https://icann.org/epp#serverupdateprohibited"
148+
],
149+
"expiration_date": "",
150+
"last_updated": "",
151+
"name": "google.com",
152+
"name_servers": [
153+
"ns2.google.com",
154+
"ns3.google.com",
155+
"ns1.google.com",
156+
"ns4.google.com"
157+
],
158+
"registrant_cc": "US",
159+
"registrant_name": "",
160+
"registrar": "MarkMonitor Inc.",
161+
"registrar_abuse_contact_email": "[email protected]",
162+
"registrar_abuse_contact_phone": "+1.2083895740",
163+
"registrar_iana_id": 292,
164+
"registrar_url": "http://www.markmonitor.com",
165+
"registrar_whois_server": "whois.markmonitor.com",
166+
"registry_domain_id": "2138514_domain_com-vrsn"
167+
}
168+
```
169+
### Triggers
170+
171+
*This plugin does not contain any triggers.*
157172

158-
### Custom Output Types
173+
### Tasks
174+
175+
*This plugin does not contain any tasks.*
159176

160-
_This plugin does not contain any custom output types._
177+
### Custom Types
178+
179+
*This plugin does not contain any custom output types.*
161180

162181
## Troubleshooting
163182

164183
Multiple records can be returned by the server, this plugin currently only returns the first unique records found.
165184

166185
# Version History
167186

187+
* 3.1.1 - Add empty `__init__.py` file to `unit_test` folder | Refresh with new tooling
168188
* 3.1.0 - Add support for `.monster` and `.nl` domains
169189
* 3.0.3 - Add PluginException in Domain and Address action when response is empty
170190
* 3.0.2 - Support non-UTF-8 responses in the Address action
@@ -193,6 +213,8 @@ Multiple records can be returned by the server, this plugin currently only retur
193213

194214
# Links
195215

196-
## References
216+
* [WHOIS](https://en.wikipedia.org/wiki/WHOIS)
197217

218+
## References
219+
198220
* [WHOIS](https://en.wikipedia.org/wiki/WHOIS)
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
# GENERATED BY KOMAND SDK - DO NOT EDIT
2-
from .address.action import Address
1+
# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT
2+
33
from .domain.action import Domain
4+
5+
from .address.action import Address
6+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# GENERATED BY KOMAND SDK - DO NOT EDIT
1+
# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT
22
from .action import Address

0 commit comments

Comments
 (0)