Skip to content

Commit f877eec

Browse files
authored
Merge pull request #3340 from aleksandrychev/ENT-10841
ENT-10841: Updated Settings and Users APIs documentations
2 parents d2526ae + 7e31bd7 commit f877eec

File tree

2 files changed

+57
-18
lines changed

2 files changed

+57
-18
lines changed

api/enterprise-api-ref/status-settings.markdown

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,29 +88,23 @@ API call allowed only for administrator.
8888
},
8989
"data": [
9090
{
91-
"hostIdentifier": "default.sys.fqhost",
92-
"rbacEnabled": true,
93-
"logLevel": "error",
94-
"ldapEnabled": true,
95-
"blueHostHorizon": 900,
96-
"sameHostsNumberOfRuns": 3
91+
"blueHostHorizon": 2400,
92+
"enforce2FA": false,
93+
"hostIdentifier": "default.sys.fqhost",
94+
"hostsCollisionsThreshold": 3,
95+
"logLevel": "error",
96+
"minPasswordLength": 8,
97+
"passwordComplexity": 3,
98+
"passwordExpirationAfterResetHours": 48,
99+
"rbacEnabled": true
97100
}
98101
]
99102
}
100103
```
101104

102105
**Output**:
103106

104-
* **rbacEnabled** *(boolean)*
105-
Whether RBAC is applied to requests.
106-
* **hostIdentifier** *(string)*
107-
The identfying string for hosts, such as name or IP.
108-
* **ldapEnabled** *(boolean)*
109-
Whether external authentication is activated.
110-
* **logLevel** *("emergency", "alert", "critical", "error", "warning", "notice", "info", "debug")*
111-
Syslog filter specifying the severity level at which messages produced by the API should be emitted to syslog and apache.log. (default: error).
112-
* **sameHostsNumberOfRuns** *(integer)*
113-
Number of samples used to identify a duplicate identity. Default value is 3.
107+
See [Update settings][Status and settings REST API#Update settings] field section for output descriptions
114108

115109

116110
**Example usage:** `Example: Viewing settings`
@@ -138,7 +132,21 @@ administrator.
138132
Threshold in minutes that hosts are unreachable before they are considered a health issue.
139133
* **sameHostsNumberOfRuns** *(integer)*
140134
Number of samples used to identify a duplicate identity. Default value is 3.
141-
135+
* **enforce2FA** *(boolean)*
136+
Determines if two-factor authentication (2FA) is mandatory for all users.
137+
If set to `true`, users must enable 2FA; otherwise, they will be locked out within 48 hours after the first login.
138+
Default value: `false`
139+
* **minPasswordLength** *(integer)*
140+
Sets the minimum required length for user passwords.
141+
The value represents the number of characters.
142+
Default value: `8`
143+
* **passwordComplexity** *(integer)*
144+
Defines the level of password complexity required.
145+
The range is from 0 to 4, where zero turns of the password complexity check and four turns on the maximum level.
146+
Default value: `3`
147+
* **passwordExpirationAfterResetHours** *(integer)*
148+
Specifies the number of hours after which a password must expire following a reset.
149+
Default value: `48`
142150

143151
**Example Request Body:**
144152

@@ -149,7 +157,11 @@ administrator.
149157
"logLevel": "error",
150158
"ldapEnabled": true,
151159
"blueHostHorizon": 900,
152-
"sameHostsNumberOfRuns": 5
160+
"sameHostsNumberOfRuns": 5,
161+
"minPasswordLength": 12,
162+
"passwordComplexity": 4,
163+
"passwordExpirationAfterResetHours": 24,
164+
"enforce2FA": true
153165
}
154166
```
155167

api/enterprise-api-ref/users-rbac.markdown

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,3 +367,30 @@ API call allowed only for administrator.
367367

368368
Remove role definition.
369369
API call allowed only for administrator.
370+
371+
## Unlock user
372+
373+
If a system enforces using two-factor authentication (2FA),
374+
users must configure it after their first login within 48 hours.
375+
This endpoint unlocks users who have been locked out due to this reason
376+
and grants an additional 48 hours to complete the 2FA setup.
377+
378+
Note: to be able to perform this action related RBAC rule (alias `user.unlock`) should be enabled.
379+
380+
**URI:** https://hub.cfengine.com/api/user/:username/unlock
381+
382+
**Method:** POST
383+
384+
**Example request (curl):**
385+
386+
```console
387+
curl --user <username>:<password> \
388+
-X POST \
389+
https://hub.cfengine.com/api/user/tom/unlock
390+
```
391+
392+
**Example response:**
393+
394+
```
395+
HTTP 202 ACCEPTED
396+
```

0 commit comments

Comments
 (0)