Debian Codegraph @

ansible_collections/cisco/meraki/plugins/modules/organizations_login_security.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Copyright (c) 2021, Cisco Systems
5 # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 DOCUMENTATION = r"""
8 module: organizations_login_security
9 short_description: Resource module for organizations _loginsecurity
10 description:
11 - Manage operation update of the resource organizations _loginsecurity.
12 - Update the login security settings for an organization.
13 version_added: '1.0.0'
14 extends_documentation_fragment:
15 - cisco.meraki.module
16 author: Francisco Munoz (@fmunoz)
17 options:
18 accountLockoutAttempts:
19 description: Number of consecutive failed login attempts after which users' accounts
20 will be locked.
21 type: int
22 apiAuthentication:
23 description: Details for indicating whether organization will restrict access
24 to API (but not Dashboard) to certain IP addresses.
25 suboptions:
26 ipRestrictionsForKeys:
27 description: Details for API-only IP restrictions.
28 suboptions:
29 enabled:
30 description: Boolean indicating whether the organization will restrict
31 API key (not Dashboard GUI) usage to a specific list of IP addresses
32 or CIDR ranges.
33 type: bool
34 ranges:
35 description: List of acceptable IP ranges. Entries can be single IP addresses,
36 IP address ranges, and CIDR subnets.
37 elements: str
38 type: list
39 type: dict
40 type: dict
41 enforceAccountLockout:
42 description: Boolean indicating whether users' Dashboard accounts will be locked
43 out after a specified number of consecutive failed login attempts.
44 type: bool
45 enforceDifferentPasswords:
46 description: Boolean indicating whether users, when setting a new password, are
47 forced to choose a new password that is different from any past passwords.
48 type: bool
49 enforceIdleTimeout:
50 description: Boolean indicating whether users will be logged out after being idle
51 for the specified number of minutes.
52 type: bool
53 enforceLoginIpRanges:
54 description: Boolean indicating whether organization will restrict access to Dashboard
55 (including the API) from certain IP addresses.
56 type: bool
57 enforcePasswordExpiration:
58 description: Boolean indicating whether users are forced to change their password
59 every X number of days.
60 type: bool
61 enforceStrongPasswords:
62 description: Deprecated. Values of 'false' are always ignored.
63 type: bool
64 enforceTwoFactorAuth:
65 description: Boolean indicating whether users in this organization will be required
66 to use an extra verification code when logging in to Dashboard. This code will
67 be sent to their mobile phone via SMS, or can be generated by the authenticator
68 application.
69 type: bool
70 idleTimeoutMinutes:
71 description: Number of minutes users can remain idle before being logged out of
72 their accounts.
73 type: int
74 loginIpRanges:
75 description: List of acceptable IP ranges. Entries can be single IP addresses,
76 IP address ranges, and CIDR subnets.
77 elements: str
78 type: list
79 minimumPasswordLength:
80 description: Minimum number of characters required in admins' passwords.
81 type: int
82 numDifferentPasswords:
83 description: Number of recent passwords that new password must be distinct from.
84 type: int
85 organizationId:
86 description: OrganizationId path parameter. Organization ID.
87 type: str
88 passwordExpirationDays:
89 description: Number of days after which users will be forced to change their password.
90 type: int
91 requirements:
92 - meraki >= 2.4.9
93 - python >= 3.5
94 seealso:
95 - name: Cisco Meraki documentation for organizations updateOrganizationLoginSecurity
96 description: Complete reference of the updateOrganizationLoginSecurity API.
97 link: https://developer.cisco.com/meraki/api-v1/#!update-organization-login-security
98 notes:
99 - SDK Method used are
100 organizations.Organizations.update_organization_login_security,
101 - Paths used are
102 put /organizations/{organizationId}/loginSecurity,
103 """
104
105 EXAMPLES = r"""
106 - name: Update all
107 cisco.meraki.organizations_login_security:
108 meraki_api_key: "{{ meraki_api_key }}"
109 meraki_base_url: "{{ meraki_base_url }}"
110 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
111 meraki_certificate_path: "{{ meraki_certificate_path }}"
112 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
113 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
114 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
115 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
116 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
117 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
118 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
119 meraki_output_log: "{{ meraki_output_log }}"
120 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
121 meraki_log_path: "{{ meraki_log_path }}"
122 meraki_print_console: "{{ meraki_print_console }}"
123 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
124 meraki_simulate: "{{ meraki_simulate }}"
125 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
126 meraki_caller: "{{ meraki_caller }}"
127 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
128 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
129 state: present
130 accountLockoutAttempts: 3
131 apiAuthentication:
132 ipRestrictionsForKeys:
133 enabled: true
134 ranges:
135 - 192.195.83.1
136 - 192.168.33.33
137 enforceAccountLockout: true
138 enforceDifferentPasswords: true
139 enforceIdleTimeout: true
140 enforceLoginIpRanges: true
141 enforcePasswordExpiration: true
142 enforceStrongPasswords: true
143 enforceTwoFactorAuth: true
144 idleTimeoutMinutes: 30
145 loginIpRanges:
146 - 192.195.83.1
147 - 192.195.83.255
148 minimumPasswordLength: 12
149 numDifferentPasswords: 3
150 organizationId: string
151 passwordExpirationDays: 90
152 """
153 RETURN = r"""
154 meraki_response:
155 description: A dictionary or list with the response returned by the Cisco Meraki Python SDK
156 returned: always
157 type: dict
158 sample: >
159 {
160 "enforcePasswordExpiration": true,
161 "passwordExpirationDays": 0,
162 "enforceDifferentPasswords": true,
163 "numDifferentPasswords": 0,
164 "enforceStrongPasswords": true,
165 "minimumPasswordLength": 0,
166 "enforceAccountLockout": true,
167 "accountLockoutAttempts": 0,
168 "enforceIdleTimeout": true,
169 "idleTimeoutMinutes": 0,
170 "enforceTwoFactorAuth": true,
171 "enforceLoginIpRanges": true,
172 "loginIpRanges": [
173 "string"
174 ],
175 "apiAuthentication": {
176 "ipRestrictionsForKeys": {
177 "enabled": true,
178 "ranges": [
179 "string"
180 ]
181 }
182 }
183 }
184 """