Skip to content

Commit 7fa925e

Browse files
feat(audit_trail): add support for filtering with principal-id and source-ip (#4994)
Co-authored-by: Rémy Léone <[email protected]>
1 parent a6ff1c7 commit 7fa925e

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

cmd/scw/testdata/test-all-usage-audit-trail-event-list-usage.golden

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ ARGS:
1818
[product-name] (Optional) Name of the Scaleway product in a hyphenated format
1919
[service-name] (Optional) Name of the service of the API call performed
2020
[resource-id] (Optional) ID of the Scaleway resource
21+
[principal-id] (Optional) ID of the User or IAM application at the origin of the event
22+
[source-ip] (Optional) IP address at the origin of the event
2123
[organization-id] Organization ID to use. If none is passed the default organization ID will be used
2224
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams)
2325

docs/commands/audit-trail.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ scw audit-trail event list [arg=value ...]
4040
| product-name | | (Optional) Name of the Scaleway product in a hyphenated format |
4141
| service-name | | (Optional) Name of the service of the API call performed |
4242
| resource-id | | (Optional) ID of the Scaleway resource |
43+
| principal-id | | (Optional) ID of the User or IAM application at the origin of the event |
44+
| source-ip | | (Optional) IP address at the origin of the event |
4345
| organization-id | | Organization ID to use. If none is passed the default organization ID will be used |
4446
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams` | Region to target. If none is passed will use default region from the config |
4547

internal/namespaces/audit_trail/v1alpha1/audit_trail_cli.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,20 @@ func auditTrailEventList() *core.Command {
192192
Deprecated: false,
193193
Positional: false,
194194
},
195+
{
196+
Name: "principal-id",
197+
Short: `(Optional) ID of the User or IAM application at the origin of the event`,
198+
Required: false,
199+
Deprecated: false,
200+
Positional: false,
201+
},
202+
{
203+
Name: "source-ip",
204+
Short: `(Optional) IP address at the origin of the event`,
205+
Required: false,
206+
Deprecated: false,
207+
Positional: false,
208+
},
195209
core.OrganizationIDArgSpec(),
196210
core.RegionArgSpec(
197211
scw.RegionFrPar,

0 commit comments

Comments
 (0)