Skip to content
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

PAPP 33165: Add support for changing cn through a new action 'rename object' #15

Merged
merged 24 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.23
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', '^adldap.json$']
4 changes: 2 additions & 2 deletions 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 (c) 2021-2023 Splunk Inc.
Copyright (c) 2021-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 @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Splunk SOAR AD LDAP
Copyright (c) 2021-2023 Splunk Inc.
Copyright (c) 2021-2024 Splunk Inc.

Third-party Software Attributions:

Expand Down
35 changes: 32 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# AD LDAP

Publisher: Splunk
Connector Version: 2.2.1
Connector Version: 2.3.0
Product Vendor: Splunk
Product Name: Active Directory LDAP
Product Version Supported (regex): ".\*"
Minimum Product Version: 5.3.5
Minimum Product Version: 6.2.2

App specifically designed for interacting with Microsoft Active Directory's LDAP Implementation

[comment]: # " File: README.md"
[comment]: # " Copyright (c) 2021-2023 Splunk Inc."
[comment]: # " Copyright (c) 2021-2024 Splunk Inc."
[comment]: # " Licensed under the Apache License, Version 2.0 (the 'License');"
[comment]: # " you may not use this file except in compliance with the License."
[comment]: # " You may obtain a copy of the License at"
Expand Down Expand Up @@ -127,6 +127,7 @@ VARIABLE | REQUIRED | TYPE | DESCRIPTION
[run query](#action-run-query) - Query Active Directory LDAP
[get attributes](#action-get-attributes) - Get attributes of various principals
[set attribute](#action-set-attribute) - Add, delete, or replace an attribute of a user
[rename object](#action-rename-object) - Rename the object

## action: 'test connectivity'
Validate the asset configuration for connectivity using supplied configuration
Expand Down Expand Up @@ -446,4 +447,32 @@ action_result.data.\*.message | string | | Success
action_result.summary.summary | string | | Successfully Set Attributes
action_result.message | string | | Summary: Successfully Set Attributes
summary.total_objects | numeric | | 1
summary.total_objects_successful | numeric | | 1

## action: 'rename object'
Rename the object

Type: **generic**
Read only: **False**

When 'use_samaccountname' is false, the 'object' parameter should include the distinguishedName. Otherwise, use the sAMAccountName. For the 'new_name' parameter, append the new name to the attribute name. For example, to rename a user, use 'cn=New_user_name'; for an OU, use 'ou=New_OU_name'.

#### Action Parameters
PARAMETER | REQUIRED | DESCRIPTION | TYPE | CONTAINS
--------- | -------- | ----------- | ---- | --------
**object** | required | The object to be renamed | string | `user name`
**use_samaccountname** | optional | Use sAMAccountName instead of distinguishedName | boolean |
**new_name** | required | New name for the object | string | `user name`

#### Action Output
DATA PATH | TYPE | CONTAINS | EXAMPLE VALUES
--------- | ---- | -------- | --------------
action_result.parameter.object | string | `user name` | cn=test user,ou=test,dc=test,dc=test,dc=com
action_result.parameter.use_samaccountname | boolean | | True False
action_result.parameter.new_name | string | `user name` | cn=new name
action_result.status | string | | success failed
action_result.data.\*.message | string | | Success
action_result.summary.summary | string | | Successfully Renamed Object
action_result.message | string | | Summary: Successfully Renamed Object
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) 2021-2023 Splunk Inc.
# Copyright (c) 2021-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
146 changes: 125 additions & 21 deletions adldap.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
"product_name": "Active Directory LDAP",
"product_version_regex": ".*",
"publisher": "Splunk",
"license": "Copyright (c) 2021-2023 Splunk Inc.",
"app_version": "2.2.1",
"license": "Copyright (c) 2021-2024 Splunk Inc.",
"app_version": "2.3.0",
"utctime_updated": "2022-01-20T22:27:39.000000Z",
"package_name": "phantom_adldap",
"main_module": "adldap_connector.py",
"min_phantom_version": "5.3.5",
"min_phantom_version": "6.2.2",
"fips_compliant": true,
"app_wizard_version": "1.0.2",
"python_version": "3",
"latest_tested_versions": [
"ldap3 on 16/11/2022"
"ldap3 on 25/10/2024"
],
"pip_dependencies": {
"wheel": [
Expand Down Expand Up @@ -61,7 +61,6 @@
"validate_ssl_cert": {
"description": "Select if you want to validate the LDAP SSL certificate",
"data_type": "boolean",
"default": false,
"order": 4
},
"ssl_port": {
Expand Down Expand Up @@ -94,7 +93,6 @@
"use_samaccountname": {
"description": "Specify members AND groups as sAMAccountName(s) instead of distinguishedName(s) (note: member AND groups will use sAMAccountName if selected)",
"data_type": "boolean",
"default": false,
"order": 0
},
"members": {
Expand Down Expand Up @@ -223,7 +221,6 @@
"use_samaccountname": {
"description": "Specify members AND groups as sAMAccountName(s) instead of distinguishedName(s)",
"data_type": "boolean",
"default": false,
"order": 0
},
"members": {
Expand Down Expand Up @@ -352,7 +349,6 @@
"use_samaccountname": {
"description": "Use sAMAccountName for user instead of distinguishedName(s)",
"data_type": "boolean",
"default": false,
"order": 0
},
"user": {
Expand All @@ -363,7 +359,6 @@
"contains": [
"user name"
],
"default": false,
"order": 1
}
},
Expand Down Expand Up @@ -467,7 +462,6 @@
"use_samaccountname": {
"description": "Specify sAMAccountName instead of distinguishedName",
"data_type": "boolean",
"default": false,
"order": 0
},
"user": {
Expand All @@ -478,7 +472,6 @@
"contains": [
"user name"
],
"default": false,
"order": 1
}
},
Expand Down Expand Up @@ -574,7 +567,6 @@
"use_samaccountname": {
"description": "Specify sAMAccountName instead of distinguishedName",
"data_type": "boolean",
"default": false,
"order": 0
},
"user": {
Expand All @@ -585,7 +577,6 @@
"contains": [
"user name"
],
"default": false,
"order": 1
}
},
Expand Down Expand Up @@ -680,7 +671,6 @@
"use_samaccountname": {
"description": "Use sAMAccountName instead of distinguishedName",
"data_type": "boolean",
"default": false,
"order": 0
},
"user": {
Expand Down Expand Up @@ -790,7 +780,6 @@
"use_samaccountname": {
"description": "Specify sAMAccountName instead of distinguishedName",
"data_type": "boolean",
"default": false,
"order": 0
},
"user": {
Expand All @@ -801,21 +790,18 @@
"contains": [
"user name"
],
"default": false,
"order": 1
},
"password": {
"description": "New password",
"data_type": "string",
"required": true,
"default": false,
"order": 2
},
"confirm_password": {
"description": "Re-type the password",
"data_type": "string",
"required": true,
"default": false,
"order": 3
}
},
Expand Down Expand Up @@ -931,14 +917,12 @@
"description": "Specify the distinguishedName to move",
"data_type": "string",
"required": true,
"default": false,
"order": 0
},
"destination_ou": {
"description": "The distinguishedName of the OU the specified object will move to",
"data_type": "string",
"required": true,
"default": false,
"order": 1
}
},
Expand Down Expand Up @@ -1244,7 +1228,6 @@
"use_samaccountname": {
"description": "Use sAMAccountName instead of distinguishedName",
"data_type": "boolean",
"default": false,
"order": 0
},
"user": {
Expand Down Expand Up @@ -1383,6 +1366,127 @@
"title": "Set Attributes"
},
"versions": "EQ(*)"
},
{
"action": "rename object",
"identifier": "rename_object",
"description": "Rename the object",
"verbose": "When 'use_samaccountname' is false, the 'object' parameter should include the distinguishedName. Otherwise, use the sAMAccountName. For the 'new_name' parameter, append the new name to the attribute name. For example, to rename a user, use 'cn=New_user_name'; for an OU, use 'ou=New_OU_name'.",
"type": "generic",
"read_only": false,
"parameters": {
"object": {
"description": "The object to be renamed",
"data_type": "string",
"required": true,
"order": 0,
"contains": [
"user name"
],
"primary": true
},
"use_samaccountname": {
"description": "Use sAMAccountName instead of distinguishedName",
"data_type": "boolean",
"order": 1
},
"new_name": {
"description": "New name for the object",
"data_type": "string",
"required": true,
"contains": [
"user name"
],
"order": 2,
"primary": true
}
},
"output": [
{
"data_path": "action_result.parameter.object",
"data_type": "string",
"example_values": [
"cn=test user,ou=test,dc=test,dc=test,dc=com"
],
"contains": [
"user name"
],
"column_name": "Object",
"column_order": 0
},
{
"data_path": "action_result.parameter.use_samaccountname",
"data_type": "boolean",
"example_values": [
true,
false
]
},
{
"data_path": "action_result.parameter.new_name",
"data_type": "string",
"example_values": [
"cn=new name"
],
"contains": [
"user name"
],
"column_name": "New Name",
"column_order": 1
},
{
"data_path": "action_result.status",
"data_type": "string",
"example_values": [
"success",
"failed"
],
"column_name": "Status",
"column_order": 2
},
{
"data_path": "action_result.data.*.message",
"data_type": "string",
"example_values": [
"Success"
]
},
{
"data_path": "action_result.summary.summary",
"data_type": "string",
"example_values": [
"Successfully Renamed Object"
]
},
{
"data_path": "action_result.message",
"data_type": "string",
"example_values": [
"Summary: Successfully Renamed Object"
]
},
{
"data_path": "summary.total_objects",
"data_type": "numeric",
"example_values": [
1
]
},
{
"data_path": "summary.total_objects_successful",
"data_type": "numeric",
"example_values": [
1
]
}
],
"render": {
"type": "table",
"width": 10,
"height": 5,
"title": "Rename Object"
},
"versions": "EQ(*)"
}
]
}
Loading
Loading