authen module

Copyright 2023 Sophos Ltd. All rights reserved. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software 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.

class authen.AdminAuthen(api_client)[source]

Bases: object

Class for working with Admin Authentication Settings.

get()[source]

Get admin authentication settings

Returns:

XML response converted to Python dictionary

Return type:

dict

class authen.User(api_client)[source]

Bases: object

Class for working with User(s).

create(debug, **kwargs)[source]

Create a User

Parameters:

debug – (bool, optional): Enable debug mode. Defaults to False.

Keyword Arguments:
  • user (str) – Username

  • name (str) – User Display Name

  • description (str) – User description

  • user_password (str) – User password

  • user_type (str) – User Type (Administrator/User)

  • profile (str) – Profile name

  • group (str) – Group name

  • email (str) – User email address

  • access_time_policy (str, optional) – Access time policy

  • sslvpn_policy (str, optional) – SSL VPN policy

  • clientless_policy (str, optional) – Clientless policy

  • l2tp (str, optional) – L2TP Enable/Disable

  • pptp (str, optional) – PPTP Enable/Disable

  • cisco (str, optional) – CISCO Enable/Disable

  • quarantine_digest (str, optional) – Quarantine Digest Enable/Disable

  • mac_binding (str, optional) – MAC binding Enable/Disable

  • login_restriction (str, optional) – Login restriction. Default = UserGroupNode.

  • isencryptcert (str, optional) – Enable/Disable. Default = Disable.

  • simultaneous_logins (str, optional) – Enable/Disable simultaneous login.

  • surfingquota_policy (str, optional) – Surfing quota policy. Default = Unlimited.

  • applianceaccess_schedule (str, optional) – Schedule for appliance access. Default = All The Time.

  • login_restriction – Login restriction for appliance. Default = AnyNode.

Returns:

XML response converted to Python dictionary

Return type:

dict

get(name=None, username=None, operator='=')[source]

Get local users

Parameters:
  • name (str, optional) – User display name. Retrieves all users if not specified.

  • username (str, optional) – Username. Retrieves all users if not specified.

  • operator (str, optional) – Operator for search. Default is “=”. Valid operators: =, !=, like.

Returns:

XML response converted to Python dictionary

Return type:

dict

update_admin_password(current_password, new_password, debug)[source]

Update the admin password.

Parameters:
  • current_password (str) – Current admin password.

  • new_password (str) – New admin password. Must meet complexity requirements.

  • debug (bool, optional) – Enable debug mode. Defaults to False.

Returns:

XML response converted to Python dictionary

Return type:

dict

update_user_password(username, new_password, debug)[source]

Update user password.

Parameters:
  • username (str) – Username

  • new_password (str) – New password. Must meet complexity requirements.

  • debug (bool, optional) – Enable debug mode. Defaults to False.

Returns:

XML response converted to Python dictionary

Return type:

dict