Skip to content

Commit a709af3

Browse files
authored
Duo Auth - 18610 - Updated dependencies and SDK to the latest version (#3055)
1 parent aa6103b commit a709af3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+432
-5284
lines changed

plugins/duo_auth/.CHECKSUM

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"spec": "9a9da19b82f3ad4f23ab7a0725695422",
3-
"manifest": "48735bedd2e407af0784bdd90e706896",
4-
"setup": "d0fc4557b513a4944506a2e885cd0a32",
2+
"spec": "ff85d692a483975710c09a54310d6e74",
3+
"manifest": "c0f72d9ea137585ca83d612bfd3c23bb",
4+
"setup": "426658221d9fe1e3eca5dca34163072a",
55
"schemas": [
66
{
77
"identifier": "auth/schema.py",
8-
"hash": "fbc5545cf3c14ba63cabf57255f3273d"
8+
"hash": "3730109fc4e5ae4a226cec9d4caaed6c"
99
},
1010
{
1111
"identifier": "connection/schema.py",
12-
"hash": "b4dd28f9a040343bb03350fc8a29d096"
12+
"hash": "3507436916c3cb62d4113a3d5092ac33"
1313
}
1414
]
1515
}

plugins/duo_auth/Dockerfile

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
FROM komand/python-3-37-slim-plugin:3
1+
FROM --platform=linux/amd64 rapid7/insightconnect-python-3-slim-plugin:6.2.3
22

3-
# Add any custom package dependencies here
4-
# NOTE: Add pip packages to requirements.txt
3+
LABEL organization=rapid7
4+
LABEL sdk=python
55

6-
# End package dependencies
7-
8-
# Add source code
96
WORKDIR /python/src
7+
108
ADD ./plugin.spec.yaml /plugin.spec.yaml
11-
ADD . /python/src
9+
ADD ./requirements.txt /python/src/requirements.txt
1210

13-
# Install pip dependencies
1411
RUN if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
1512

16-
# Install plugin
13+
ADD . /python/src
14+
1715
RUN python setup.py build && python setup.py install
1816

19-
ENTRYPOINT ["/usr/local/bin/komand_duo_auth"]
17+
# User to run plugin code. The two supported users are: root, nobody
18+
USER nobody
19+
20+
ENTRYPOINT ["/usr/local/bin/komand_duo_auth"]

plugins/duo_auth/bin/komand_duo_auth

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,44 @@
11
#!/usr/bin/env python
2-
# GENERATED BY KOMAND SDK - DO NOT EDIT
3-
import komand
4-
from komand_duo_auth import connection, actions, triggers
5-
2+
# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT
3+
import os
4+
import json
5+
from sys import argv
66

77
Name = "Duo Auth API"
88
Vendor = "rapid7"
9-
Version = "1.0.3"
10-
Description = "Duo's Trusted Access platform verifies the identity of your users with two-factor authentication and security health of their devices before they connect to the apps they use. The Duo Auth plugin for Rapid7 InsightConnect enables users to create and send two-factor authentication push notifications"
9+
Version = "1.0.4"
10+
Description = "[Duo](https://duo.com/)'s Trusted Access platform verifies the identity of your users with two-factor authentication and security health of their devices before they connect to the apps they use. The Duo Auth InsightConnect plugin enables users to create and send push notifications from within automation workflows"
1111

1212

13-
class ICONDuoAuth(komand.Plugin):
14-
def __init__(self):
15-
super(self.__class__, self).__init__(
13+
def main():
14+
if 'http' in argv:
15+
if os.environ.get("GUNICORN_CONFIG_FILE"):
16+
with open(os.environ.get("GUNICORN_CONFIG_FILE")) as gf:
17+
gunicorn_cfg = json.load(gf)
18+
if gunicorn_cfg.get("worker_class", "sync") == "gevent":
19+
from gevent import monkey
20+
monkey.patch_all()
21+
elif 'gevent' in argv:
22+
from gevent import monkey
23+
monkey.patch_all()
24+
25+
import insightconnect_plugin_runtime
26+
from komand_duo_auth import connection, actions, triggers, tasks
27+
28+
class ICONDuoAuth(insightconnect_plugin_runtime.Plugin):
29+
def __init__(self):
30+
super(self.__class__, self).__init__(
1631
name=Name,
1732
vendor=Vendor,
1833
version=Version,
1934
description=Description,
2035
connection=connection.Connection()
21-
)
22-
self.add_action(actions.Auth())
36+
)
37+
self.add_action(actions.Auth())
38+
2339

24-
25-
def main():
2640
"""Run plugin"""
27-
cli = komand.CLI(ICONDuoAuth())
41+
cli = insightconnect_plugin_runtime.CLI(ICONDuoAuth())
2842
cli.run()
2943

3044

plugins/duo_auth/help.md

Lines changed: 79 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Description
22

3-
[Duo](https://duo.com/)'s Trusted Access platform verifies the identity of your users with two-factor authentication and
4-
security health of their devices before they connect to the apps they use. The Duo Auth InsightConnect plugin enables users to create and send push notifications from within automation workflows.
3+
[Duo](https://duo.com/)'s Trusted Access platform verifies the identity of your users with two-factor authentication and security health of their devices before they connect to the apps they use. The Duo Auth InsightConnect plugin enables users to create and send push notifications from within automation workflows
54

65
# Key Features
76

@@ -13,119 +12,116 @@ security health of their devices before they connect to the apps they use. The D
1312
* Requires a Duo secret key
1413
* Requires a Duo hostname
1514

16-
# Documentation
17-
18-
## Setup
15+
# Supported Product Versions
1916

20-
|Name|Type|Default|Required|Description|Enum|
21-
|----|----|-------|--------|-----------|----|
22-
|hostname|string|None|True|Enter the Duo API hostname and secret key|None|
23-
|integration_key|credential_secret_key|None|True|API integration key|None|
24-
|secret_key|credential_secret_key|None|True|API secret key|None|
25-
26-
## Technical Details
17+
* Duo Client 5.3.0
2718

28-
### Actions
29-
30-
#### Auth
19+
# Documentation
3120

32-
This action is used to perform second-factor authentication.
21+
## Setup
3322

34-
##### Options
23+
The connection configuration accepts the following parameters:
3524

36-
The "Options" field is used to specify additional parameters that may be necessary depending on the authentication factor selected. "Options" accepts the following parameters in JSON format `username`, `passcode`, `pushinfo`, `type`.
25+
|Name|Type|Default|Required|Description|Enum|Example|Placeholder|Tooltip|
26+
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
27+
|hostname|string|None|True|Enter the Duo API hostname and secret key|None|ExampleHostname|None|None|
28+
|integration_key|credential_secret_key|None|True|API integration key|None|{"secretKey": "9de5069c5afe602b2ea0a04b66beb2c0"}|None|None|
29+
|secret_key|credential_secret_key|None|True|API secret key|None|{"secretKey": "9de5069c5afe602b2ea0a04b66beb2c0"}|None|None|
3730

3831
Example input:
3932

4033
```
4134
{
42-
"type": "Transfer",
43-
"pushinfo": {
44-
"hello": "world",
45-
"host": "suspicious-host"
46-
}
35+
"hostname": "ExampleHostname",
36+
"integration_key": {
37+
"secretKey": "9de5069c5afe602b2ea0a04b66beb2c0"
38+
},
39+
"secret_key": {
40+
"secretKey": "9de5069c5afe602b2ea0a04b66beb2c0"
41+
}
4742
}
4843
```
4944

50-
###### Push
51-
52-
|Parameter|Required?|Description|
53-
|---------|---------|-----------|
54-
|device|Required|ID of the device. This device must have the "push" capability. You may also specify "auto" to use the first of the user's devices with the "push" capability.|
55-
|type|Optional|This string is displayed in the Duo Mobile app before the word "request". The default is "Login", so the phrase "Login request" appears in the push notification text and on the request details screen. You may want to specify "Transaction", "Transfer", etc.|
56-
|display_username|Optional|String to display in Duo Mobile in place of the user's Duo username.|
57-
|pushinfo|Optional|A set of URL-encoded key/value pairs with additional contextual information associated with this authentication attempt. The Duo Mobile app will display this information to the user. For example: from=login%20portal&domain=example.com. The URL-encoded string's total length must be less than 20,000 bytes.|
58-
59-
###### Passcode
60-
61-
|Parameter|Required?|Description|
62-
|---------|---------|-----------|
63-
|passcode|true|Passcode entered by the user.|
45+
## Technical Details
6446

65-
###### Phone
47+
### Actions
6648

67-
|Parameter|Required?|Description|
68-
|---------|---------|-----------|
69-
|device|true|ID of the device to call. This device must have the "phone" capability. You may also specify "auto" to use the first of the user's devices with the "phone" capability.|
7049

71-
###### SMS
50+
#### Auth
7251

73-
|Parameter|Required?|Description|
74-
|---------|---------|-----------|
75-
|device|true|ID of the device to send passcodes to. This device must have the "sms" capability. You may also specify "auto" to use the first of the user's devices with the "sms" capability.|
52+
This action is used to perform second-factor authentication
7653

7754
##### Input
7855

79-
|Name|Type|Default|Required|Description|Enum|
80-
|----|----|-------|--------|-----------|----|
81-
|username|string|None|False|Username is required if user_id is not provided|None|
82-
|user_id|string|None|False|User ID|None|
83-
|factor|string|auto|False|Factor to use for authentication|['auto', 'push', 'passcode', 'sms', 'phone']|
84-
|device|string|auto|False|Device ID to use for auth|None|
85-
|async|bool|None|False|Set to true for an async response|None|
86-
|ipaddr|string|None|False|The IP address of the user to be authenticated, in dotted quad format. This will cause an 'allow' response to be sent if appropriate for requests from a trusted network|None|
87-
|options|object|None|False|Additional options required by the API|None|
56+
|Name|Type|Default|Required|Description|Enum|Example|Placeholder|Tooltip|
57+
| :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
58+
|async|bool|None|False|Set to true for an async response|None|False|None|None|
59+
|device|string|auto|False|Device ID to use for auth|None|auto|None|None|
60+
|factor|string|auto|False|Factor to use for authentication|["auto", "push", "passcode", "sms", "phone"]|auto|None|None|
61+
|ipaddr|string|None|False|The IP address of the user to be authenticated, in dotted quad format. This will cause an 'allow' response to be sent if appropriate for requests from a trusted network|None|192.168.0.1|None|None|
62+
|options|object|None|False|Additional options required by the API. This field is used to specify additional parameters that may be necessary depending on the authentication factor selected. Accepts the following parameters in JSON format `username`, `passcode`, `pushinfo`, `type`|None|{"type":"Transfer","pushinfo":{"hello":"world","host":"suspicious-host"}}|None|None|
63+
|user_id|string|None|False|Permanent, unique identifier for the user as generated by Duo upon user creation. Exactly one of user_id or username must be specified|None|DUYHV6TJBC3O4RITS1WC|None|None|
64+
|username|string|None|False|Unique identifier for the user that is commonly specified by your application during user creation. This value may also represent a username alias assigned to a user. Exactly one of user_id or username must be specified|None|[email protected]|None|None|
65+
66+
Example input:
8867

89-
##### Output
68+
```
69+
{
70+
"async": false,
71+
"device": "auto",
72+
"factor": "auto",
73+
"ipaddr": "192.168.0.1",
74+
"options": {
75+
"pushinfo": {
76+
"hello": "world",
77+
"host": "suspicious-host"
78+
},
79+
"type": "Transfer"
80+
},
81+
"user_id": "DUYHV6TJBC3O4RITS1WC",
82+
"username": "[email protected]"
83+
}
84+
```
9085

91-
|Name|Type|Required|Description|
92-
|----|----|--------|-----------|
93-
|status|string|False|Status|
94-
|status_msg|string|False|Status message|
95-
|trusted_device_token|string|False|Trusted device token|
96-
|result|string|False|Either allow or deny|
97-
|txid|string|False|TX ID|
86+
##### Output
9887

88+
|Name|Type|Required|Description|Example|
89+
| :--- | :--- | :--- | :--- | :--- |
90+
|result|string|False|Either "allow" or "deny". If "allow" was returned, your application should grant access to the user. If "deny", it should not|allow|
91+
|status|string|False|String detailing the progress or outcome of the authentication attempt|allow|
92+
|status_msg|string|False|The message describing the status of the authentication attempt. If the authentication attempt was denied, it may identify a reason|Success. Logging you in...|
93+
|trusted_device_token|string|False|A string containing a token for that trusted device|REkxS00Ld4ddEVTRZOUlYMEldJ05HwUldRRThJR1VTNE0=|35|835c28ca9b042e05e|
94+
|txid|string|False|A transaction ID|45f7c92b-f45f-4862-8545-e0f58e78075a|
95+
9996
Example output:
10097

10198
```
102-
10399
{
104-
"log": "Connect: Connecting..\n",
105-
"status": "ok",
106-
"meta": {},
107-
"output": {
108-
"result": "allow",
109-
"status": "allow",
110-
"status_msg": "Success. Logging you in..."
111-
}
112-
100+
"result": "allow",
101+
"status": "allow",
102+
"status_msg": "Success. Logging you in...",
103+
"trusted_device_token": "REkxS00Ld4ddEVTRZOUlYMEldJ05HwUldRRThJR1VTNE0=|35|835c28ca9b042e05e",
104+
"txid": "45f7c92b-f45f-4862-8545-e0f58e78075a"
105+
}
113106
```
114-
115107
### Triggers
108+
109+
*This plugin does not contain any triggers.*
110+
### Tasks
111+
112+
*This plugin does not contain any tasks.*
116113

117-
This plugin does not contain any triggers.
118-
119-
### Custom Output Types
120-
121-
_This plugin does not contain any custom output types._
114+
### Custom Types
115+
116+
*This plugin does not contain any custom output types.*
122117

123118
## Troubleshooting
124-
125-
This plugin does not contain any troubleshooting information.
119+
120+
*This plugin does not contain a troubleshooting.*
126121

127122
# Version History
128123

124+
* 1.0.4 - Updated dependencies and SDK to the latest version
129125
* 1.0.3 - Upgraded `duo_client` in requirements.txt to version `4.0.0` | Upgraded `duo_client` in vendor folder to version `4.0.0` | Use input and output constants | Change docker image from `komand/python-3-plugin:2` to `komand/python-3-37-slim-plugin:3` to reduce plugin image size
130126
* 1.0.2 - New spec and help.md format for the Extension Library
131127
* 1.0.1 - Support `type` parameter as `push_type` in the `options` input of the Auth action
@@ -135,7 +131,9 @@ This plugin does not contain any troubleshooting information.
135131

136132
# Links
137133

134+
* [Duo](https://duo.com/)
135+
138136
## References
139137

140138
* [Duo](https://duo.com/)
141-
* [Duo Auth API V2](https://duo.com/docs/authapi)
139+
* [Duo Auth API V2](https://duo.com/docs/authapi)
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
# GENERATED BY KOMAND SDK - DO NOT EDIT
1+
# GENERATED BY INSIGHT-PLUGIN - DO NOT EDIT
2+
23
from .auth.action import Auth
4+
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 Auth

0 commit comments

Comments
 (0)