Skip to content

Commit

Permalink
Merge pull request #8 from cs-sameer-pathan/develop
Browse files Browse the repository at this point in the history
Updated playbook and copyright
  • Loading branch information
cs-prerna-joshi authored Mar 28, 2023
2 parents 113673e + 879874e commit 52e6305
Show file tree
Hide file tree
Showing 6 changed files with 2,665 additions and 985 deletions.
2 changes: 1 addition & 1 deletion activedirectory/connector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
""" Copyright start
Copyright (C) 2008 - 2022 Fortinet Inc.
Copyright (C) 2008 - 2023 Fortinet Inc.
All rights reserved.
FORTINET CONFIDENTIAL & FORTINET PROPRIETARY SOURCE CODE
Copyright end """
Expand Down
2 changes: 1 addition & 1 deletion activedirectory/constant.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
""" Copyright start
Copyright (C) 2008 - 2022 Fortinet Inc.
Copyright (C) 2008 - 2023 Fortinet Inc.
All rights reserved.
FORTINET CONFIDENTIAL & FORTINET PROPRIETARY SOURCE CODE
Copyright end """
Expand Down
86 changes: 43 additions & 43 deletions activedirectory/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"Enrichment",
"User_Enrichment"
],
"help_online": "https://docs.fortinet.com/document/fortisoar/2.2.1/active-directory/383/active-directory-v2-2-1",
"help_online": "",
"configuration": {
"fields": [
{
Expand Down Expand Up @@ -1559,49 +1559,49 @@
],
"enabled": true
},
{
"title": "Force password reset on next logon",
"operation": "force_password_reset_next_logon",
"description": "Force password reset on next logon for a specific AD user based on the SamAccount Name or the Email, or the Distinguished Name (DN) of the user.",
"category": "containment",
"annotation": "force_password_reset_next_logon",
"output_schema": {
"message": "",
"description": "",
"result": "",
"referrals": "",
"type": "",
"dn": ""
},
"parameters": [
{
"title": "Force password reset on next logon",
"operation": "force_password_reset_next_logon",
"description": "Force password reset on next logon for a specific AD user based on the SamAccount Name or the Email, or the Distinguished Name (DN) of the user.",
"category": "containment",
"annotation": "force_password_reset_next_logon",
"output_schema": {
"message": "",
"description": "",
"result": "",
"referrals": "",
"type": "",
"dn": ""
},
"parameters": [
{
"name": "search_attr_name",
"title": "Attributes Type",
"type": "select",
"tooltip": "The attribute, either the SamAccount Name, Distinguished Name, or the Email of the user, whose password you want to reset in AD.",
"description": "The attribute, either the SamAccount Name, Distinguished Name, or the Email of the user, whose password you want to reset in AD.",
"visible": true,
"required": true,
"editable": true,
"options": [
"SamAccount Name",
"Email",
"Distinguished Name"
],
"value": "SamAccount Name"
},
{
"title": "Attributes Value",
"name": "search_attr_value",
"type": "text",
"description": "The value of the SamAccount Name, the Distinguished Name, or the Email of the user, whose password you want to reset in AD.",
"visible": true,
"required": true,
"editable": true,
"value": ""
}
],
"enabled": true
"name": "search_attr_name",
"title": "Attributes Type",
"type": "select",
"tooltip": "The attribute, either the SamAccount Name, Distinguished Name, or the Email of the user, whose password you want to reset in AD.",
"description": "The attribute, either the SamAccount Name, Distinguished Name, or the Email of the user, whose password you want to reset in AD.",
"visible": true,
"required": true,
"editable": true,
"options": [
"SamAccount Name",
"Email",
"Distinguished Name"
],
"value": "SamAccount Name"
},
{
"title": "Attributes Value",
"name": "search_attr_value",
"type": "text",
"description": "The value of the SamAccount Name, the Distinguished Name, or the Email of the user, whose password you want to reset in AD.",
"visible": true,
"required": true,
"editable": true,
"value": ""
}
],
"enabled": true
}
]
}
11 changes: 8 additions & 3 deletions activedirectory/operations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
""" Copyright start
Copyright (C) 2008 - 2022 Fortinet Inc.
Copyright (C) 2008 - 2023 Fortinet Inc.
All rights reserved.
FORTINET CONFIDENTIAL & FORTINET PROPRIETARY SOURCE CODE
Copyright end """
Expand Down Expand Up @@ -184,18 +184,22 @@ def enable_user_account(config, params):
result = perform_action(config, params, 'enable')
return check_response(result)


def disable_user_account(config, params):
result = perform_action(config, params, 'disable')
return check_response(result)


def enable_computer(config, params):
result = perform_action(config, params, 'enable', object_type='computer')
return check_response(result)


def disable_computer(config, params):
result = perform_action(config, params, 'disable', object_type='computer')
return check_response(result)


def perform_action(config, params, action, object_type=None):
try:
baseDN = config.get('baseDN')
Expand Down Expand Up @@ -232,6 +236,7 @@ def modify(conn, dn, mod_dict):
except Exception as err:
raise ConnectorError('{0}'.format(str(err)))


def decimal_to_ip_address(decimal_val):
if decimal_val <= 0:
decimal_val = limit + decimal_val
Expand Down Expand Up @@ -303,6 +308,7 @@ def check_escape(search_attr_name, raw_string):
else:
return raw_string


def global_search(config, params):
try:
baseDN = config.get('baseDN')
Expand Down Expand Up @@ -671,7 +677,7 @@ def force_password_reset_next_logon(config, params):
except Exception as err:
logger.exception('Failure: {0}'.format(str(err)))
raise ConnectorError('{0}'.format(str(err)))


def _check_health(config):
try:
Expand Down Expand Up @@ -707,4 +713,3 @@ def _check_health(config):
'force_password_reset_next_logon': force_password_reset_next_logon

}

Loading

0 comments on commit 52e6305

Please sign in to comment.