1
1
---
2
2
layout : default
3
- title : Audit logs API
3
+ title : Audit log API
4
4
published : true
5
5
---
6
6
7
- Audit logs API provides access to system audit logs that track user actions across the platform made to critical parts
7
+ Audit log API provides access to system audit logs that track user actions across the platform made to critical parts
8
8
such as settings, host data, users, roles, Build projects, etc.
9
9
10
10
## Get audit logs
11
11
12
- ** URI:** https://hub.cfengine.com/api/audit-logs
12
+ ** URI:** https://hub.cfengine.com/api/audit-log
13
13
14
14
** Method:** GET
15
15
@@ -18,9 +18,11 @@ such as settings, host data, users, roles, Build projects, etc.
18
18
* ** actor** * (string)*
19
19
Filter by user who performed the action.
20
20
* ** object_type** * (string)*
21
- Filter by object type (see [ Allowed object types] [ Audit logs API#Allowed object types ] ).
21
+ Filter by object type (see [ Allowed object types] [ Audit log API#Allowed object types ] ).
22
22
* ** action** * (string)*
23
- Filter by action type (see [ Allowed actions] [ Audit logs API#Allowed actions ] ).
23
+ Filter by action type (see [ Allowed actions] [ Audit log API#Allowed actions ] ).
24
+ * ** object_name** * (integer)*
25
+ Filter by object name.
24
26
* ** created_after** * (integer)*
25
27
Unix timestamp to filter logs after this time.
26
28
* ** created_before** * (integer)*
@@ -35,6 +37,7 @@ such as settings, host data, users, roles, Build projects, etc.
35
37
* actor
36
38
* action
37
39
* object_id
40
+ * object_name
38
41
* object_type
39
42
* ** sort_direction** * (string, default: "DESC")*
40
43
Sort direction. Allowed values:
@@ -44,7 +47,7 @@ such as settings, host data, users, roles, Build projects, etc.
44
47
** Example request (curl):**
45
48
46
49
``` console
47
- curl --user <username>:<password> -X GET https://hub.cfengine.com/api/audit-logs
50
+ curl --user <username>:<password> -X GET https://hub.cfengine.com/api/audit-log
48
51
```
49
52
50
53
** Successful response example:**
@@ -59,6 +62,7 @@ HTTP 200 OK
59
62
"actor": "admin",
60
63
"action": "created",
61
64
"object_type": "user",
65
+ "object_name": "test",
62
66
"object_id": "test",
63
67
"details": [
64
68
"Created user `test`."
@@ -69,6 +73,7 @@ HTTP 200 OK
69
73
"time": "2024-10-24 09:46:56.204391",
70
74
"actor": "admin",
71
75
"action": "created",
76
+ "object_name": "test",
72
77
"object_type": "role",
73
78
"object_id": "test",
74
79
"details": [
@@ -86,6 +91,7 @@ HTTP 200 OK
86
91
"actor": "admin",
87
92
"action": "updated",
88
93
"object_type": "settings",
94
+ "object_name": "Preferences",
89
95
"object_id": null,
90
96
"details": [
91
97
"Settings updated.",
@@ -121,15 +127,15 @@ HTTP 200 OK
121
127
122
128
| Action | Description |
123
129
| ----------------------| ---------------------------|
124
- | created | Resource creation |
125
- | updated | Resource update |
126
- | deleted | Resource deletion |
127
- | deployed | Deployment action |
128
- | pushed | Push action |
129
- | module added | Module addition |
130
- | module deleted | Module removal |
131
- | module updated | Module modification |
132
- | module input updated | Module input modification |
130
+ | Created | Resource creation |
131
+ | Updated | Resource update |
132
+ | Deleted | Resource deletion |
133
+ | Deployed | Deployment action |
134
+ | Pushed | Push action |
135
+ | Module added | Module addition |
136
+ | Module deleted | Module removal |
137
+ | Module updated | Module modification |
138
+ | Module input updated | Module input modification |
133
139
| CMDB updated | CMDB update |
134
140
| CMDB deleted | CMDB deletion |
135
141
| CMDB created | CMDB creation |
@@ -139,10 +145,66 @@ HTTP 200 OK
139
145
140
146
| Object Type | Description |
141
147
| ---------------------| ----------------------------------------------|
142
- | user | User account |
143
- | role | Role definition |
144
- | settings | System, Mail, VCS or Authentication settings |
145
- | federated reporting | Federated reporting configuration |
146
- | group | Host groups |
147
- | host | Host configuration |
148
+ | User | User account |
149
+ | Role | Role definition |
150
+ | Settings | System, Mail, VCS or Authentication settings |
151
+ | Federated reporting | Federated reporting configuration |
152
+ | Group | Host groups |
153
+ | Host | Host configuration |
148
154
| Build project | Build project configuration |
155
+
156
+
157
+ ## Get audit logs actors
158
+
159
+ Returns list of users who performed actions.
160
+
161
+ ** URI:** https://hub.cfengine.com/api/audit-log/actors
162
+
163
+ ** Method:** GET
164
+
165
+ ** Example request (curl):**
166
+
167
+ ``` console
168
+ curl --user <username>:<password> -X GET https://hub.cfengine.com/api/audit-log/actors
169
+ ```
170
+
171
+ ** Successful response example:**
172
+
173
+ ```
174
+ HTTP 200 OK
175
+ [
176
+ "admin",
177
+ "test"
178
+ ]
179
+ ```
180
+
181
+ ## Get audit logs object name by type
182
+
183
+ Returns list of object names filtered by type.
184
+
185
+ ** URI:** https://hub.cfengine.com/api/audit-log/:type/names
186
+
187
+ ** Method:** GET
188
+
189
+ ** Parameters:**
190
+
191
+ * ** object_type** * (string)*
192
+ Filter by object type (see [ Allowed object types] [ Audit log API#Allowed object types ] ).
193
+
194
+ ** Example request (curl):**
195
+
196
+ ``` console
197
+ curl --user <username>:<password> -X GET https://hub.cfengine.com/api/audit-log/Settings/names
198
+ ```
199
+
200
+ ** Successful response example:**
201
+
202
+ ```
203
+ HTTP 200 OK
204
+ [
205
+ "Preferences",
206
+ "Mail",
207
+ "VCS",
208
+ "Authentication",
209
+ ]
210
+ ```
0 commit comments