-
Notifications
You must be signed in to change notification settings - Fork 526
[axonius][user] Add Axonius User datastream #16142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kcreddy
merged 6 commits into
elastic:feature/axonius-0.1.0
from
muskan-agarwal26:datastream-user
Jan 6, 2026
+1,759
−21
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dfe2d6b
Initial release of User data-stream in axonius
muskan-crest 3a3a586
Update changelog entry
muskan-crest a38f348
Added transform pipeline and ilm policy
muskan-crest 737c3a3
Added role permission note in readme
muskan-crest 9a88f83
Updated manifest versions as ILM Policy rely with these versions.
muskan-crest 08390ac
Resolved comments provided by @kcreddy
muskan-crest File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,3 +97,61 @@ rules: | |
| ] | ||
| } | ||
| `}} | ||
| - path: /api/v2/users | ||
| methods: ['GET'] | ||
| request_headers: | ||
| Accept: application/json | ||
| api-key: xxxx | ||
| api-secret: xxxx | ||
| responses: | ||
| - status_code: 200 | ||
| headers: | ||
| Content-Type: | ||
| - 'application/json' | ||
| body: |- | ||
| {{ minify_json ` | ||
| { | ||
| "users": [ | ||
| { | ||
| "role_id": "63622vfed93d274d9489dbbgresdcv6a1cf", | ||
| "data_scope_id": "fgreg63622d93d274d9489db6a1cf", | ||
| "allowed_scopes_impersonation": [ | ||
| "63622d93d27cvdsfa4d9489db6a1cf", | ||
| "63622d93d2dvfwe74d9489db6a1cc" | ||
| ], | ||
| "first_name": "alias", | ||
| "last_name": "doe", | ||
| "email": "[email protected]", | ||
| "title": "Security Analyst", | ||
| "department": "test", | ||
| "user_name": "alias.doe", | ||
| "last_updated": "Sun, 11 Mar 2025 18:53:09 GMT", | ||
| "source": "test source", | ||
| "uuid": "63622d93d274ihvbngvbhd9489db6a1cf", | ||
| "role_name": "test role", | ||
| "data_scope_name": "test data scope", | ||
| "last_login": "Sun, 09 Mar 2025 18:53:09 GMT" | ||
| }, | ||
| { | ||
| "role_id": "63622d93d27xcvdgre4d9489dbbgresdcv6a1cf", | ||
| "data_scope_id": "fgreghtgrtefdgrt63622d93d274d9489db6a1cf", | ||
| "allowed_scopes_impersonation": [ | ||
| "63622d93d27vdfrew4d9489db6a1cf", | ||
| "63622d93d27fvdwe4d9489db6a1cc" | ||
| ], | ||
| "first_name": "bob", | ||
| "last_name": "doe", | ||
| "email": "[email protected]", | ||
| "title": "Cloud Operations Engineer", | ||
| "department": "sample", | ||
| "user_name": "bob.doe", | ||
| "last_updated": "Mon, 12 Mar 2025 18:53:09 GMT", | ||
| "source": "sample source", | ||
| "uuid": "78ij63622d93d274d9489db6a1cf", | ||
| "role_name": " role", | ||
| "data_scope_name": "sample data scope", | ||
| "last_login": "Mon, 08 Mar 2025 18:53:09 GMT" | ||
| } | ||
| ] | ||
| } | ||
| `}} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/axonius/data_stream/user/_dev/test/pipeline/test-common-config.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| fields: | ||
| tags: | ||
| - preserve_duplicate_custom_fields |
3 changes: 3 additions & 0 deletions
3
packages/axonius/data_stream/user/_dev/test/pipeline/test-user.log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| {"role_id":"63622d93d274d9489dbbgresdcv6a1cf","data_scope_id":"fgreg63622d93d274d9489db6a1cf","allowed_scopes_impersonation":["63622d93d274d9489db6a1cf","63622d93d274d9489db6a1cc"],"first_name":"john","last_name":"doe","email":"[email protected]","title":"Software Engineer","department":"example","user_name":"john.doe","last_updated":"Sat, 10 Mar 2025 18:53:09 GMT","source":"example source","uuid":"63622d93d274d9489db6a1cf","role_name":"example role","data_scope_name":"example data scope","last_login":"Sat, 08 Mar 2025 18:53:09 GMT"} | ||
| {"role_id":"63622vfed93d274d9489dbbgresdcv6a1cf","data_scope_id":"fgreg63622d93d274d9489db6a1cf","allowed_scopes_impersonation":["63622d93d27cvdsfa4d9489db6a1cf","63622d93d2dvfwe74d9489db6a1cc"],"first_name":"alias","last_name":"doe","email":"[email protected]","title":"Security Analyst","department":"test","user_name":"alias.doe","last_updated":"Sun, 11 Mar 2025 18:53:09 GMT","source":"test source","uuid":"63622d93d274ihvbngvbhd9489db6a1cf","role_name":"test role","data_scope_name":"test data scope","last_login":"Sun, 09 Mar 2025 18:53:09 GMT"} | ||
| {"role_id":"63622d93d27xcvdgre4d9489dbbgresdcv6a1cf","data_scope_id":"fgreghtgrtefdgrt63622d93d274d9489db6a1cf","allowed_scopes_impersonation":["63622d93d27vdfrew4d9489db6a1cf","63622d93d27fvdwe4d9489db6a1cc"],"first_name":"bob","last_name":"doe","email":"[email protected]","title":"Cloud Operations Engineer","department":"sample","user_name":"bob.doe","last_updated":"Mon, 12 Mar 2025 18:53:09 GMT","source":"sample source","uuid":"78ij63622d93d274d9489db6a1cf","role_name":" role","data_scope_name":"sample data scope","last_login":"Mon, 08 Mar 2025 18:53:09 GMT"} |
163 changes: 163 additions & 0 deletions
163
packages/axonius/data_stream/user/_dev/test/pipeline/test-user.log-expected.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,163 @@ | ||
| { | ||
| "expected": [ | ||
| { | ||
| "axonius": { | ||
| "user": { | ||
| "allowed_scopes_impersonation": [ | ||
| "63622d93d274d9489db6a1cf", | ||
| "63622d93d274d9489db6a1cc" | ||
| ], | ||
| "data_scope_id": "fgreg63622d93d274d9489db6a1cf", | ||
| "data_scope_name": "example data scope", | ||
| "department": "example", | ||
| "email": "[email protected]", | ||
| "first_name": "john", | ||
| "last_login": "2025-03-08T18:53:09.000Z", | ||
| "last_name": "doe", | ||
| "last_updated": "2025-03-10T18:53:09.000Z", | ||
| "role_id": "63622d93d274d9489dbbgresdcv6a1cf", | ||
| "role_name": "example role", | ||
| "source": "example source", | ||
| "title": "Software Engineer", | ||
| "user_name": "john.doe", | ||
| "uuid": "63622d93d274d9489db6a1cf" | ||
| } | ||
| }, | ||
| "ecs": { | ||
| "version": "9.2.0" | ||
| }, | ||
| "event": { | ||
| "kind": "event", | ||
| "original": "{\"role_id\":\"63622d93d274d9489dbbgresdcv6a1cf\",\"data_scope_id\":\"fgreg63622d93d274d9489db6a1cf\",\"allowed_scopes_impersonation\":[\"63622d93d274d9489db6a1cf\",\"63622d93d274d9489db6a1cc\"],\"first_name\":\"john\",\"last_name\":\"doe\",\"email\":\"[email protected]\",\"title\":\"Software Engineer\",\"department\":\"example\",\"user_name\":\"john.doe\",\"last_updated\":\"Sat, 10 Mar 2025 18:53:09 GMT\",\"source\":\"example source\",\"uuid\":\"63622d93d274d9489db6a1cf\",\"role_name\":\"example role\",\"data_scope_name\":\"example data scope\",\"last_login\":\"Sat, 08 Mar 2025 18:53:09 GMT\"}" | ||
| }, | ||
| "related": { | ||
| "user": [ | ||
| "john", | ||
| "doe", | ||
kcreddy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "[email protected]", | ||
| "john.doe", | ||
| "63622d93d274d9489db6a1cf" | ||
| ] | ||
| }, | ||
| "tags": [ | ||
| "preserve_duplicate_custom_fields" | ||
| ], | ||
| "user": { | ||
| "domain": "example.com", | ||
| "email": "[email protected]", | ||
| "full_name": "john doe", | ||
| "id": "63622d93d274d9489db6a1cf", | ||
| "name": "john.doe", | ||
| "roles": [ | ||
| "example role" | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "axonius": { | ||
| "user": { | ||
| "allowed_scopes_impersonation": [ | ||
| "63622d93d27cvdsfa4d9489db6a1cf", | ||
| "63622d93d2dvfwe74d9489db6a1cc" | ||
| ], | ||
| "data_scope_id": "fgreg63622d93d274d9489db6a1cf", | ||
| "data_scope_name": "test data scope", | ||
| "department": "test", | ||
| "email": "[email protected]", | ||
| "first_name": "alias", | ||
| "last_login": "2025-03-09T18:53:09.000Z", | ||
| "last_name": "doe", | ||
| "last_updated": "2025-03-11T18:53:09.000Z", | ||
| "role_id": "63622vfed93d274d9489dbbgresdcv6a1cf", | ||
| "role_name": "test role", | ||
| "source": "test source", | ||
| "title": "Security Analyst", | ||
| "user_name": "alias.doe", | ||
| "uuid": "63622d93d274ihvbngvbhd9489db6a1cf" | ||
| } | ||
| }, | ||
| "ecs": { | ||
| "version": "9.2.0" | ||
| }, | ||
| "event": { | ||
| "kind": "event", | ||
| "original": "{\"role_id\":\"63622vfed93d274d9489dbbgresdcv6a1cf\",\"data_scope_id\":\"fgreg63622d93d274d9489db6a1cf\",\"allowed_scopes_impersonation\":[\"63622d93d27cvdsfa4d9489db6a1cf\",\"63622d93d2dvfwe74d9489db6a1cc\"],\"first_name\":\"alias\",\"last_name\":\"doe\",\"email\":\"[email protected]\",\"title\":\"Security Analyst\",\"department\":\"test\",\"user_name\":\"alias.doe\",\"last_updated\":\"Sun, 11 Mar 2025 18:53:09 GMT\",\"source\":\"test source\",\"uuid\":\"63622d93d274ihvbngvbhd9489db6a1cf\",\"role_name\":\"test role\",\"data_scope_name\":\"test data scope\",\"last_login\":\"Sun, 09 Mar 2025 18:53:09 GMT\"}" | ||
| }, | ||
| "related": { | ||
| "user": [ | ||
| "alias", | ||
| "doe", | ||
| "[email protected]", | ||
| "alias.doe", | ||
| "63622d93d274ihvbngvbhd9489db6a1cf" | ||
| ] | ||
| }, | ||
| "tags": [ | ||
| "preserve_duplicate_custom_fields" | ||
| ], | ||
| "user": { | ||
| "domain": "example.com", | ||
| "email": "[email protected]", | ||
| "full_name": "alias doe", | ||
| "id": "63622d93d274ihvbngvbhd9489db6a1cf", | ||
| "name": "alias.doe", | ||
| "roles": [ | ||
| "test role" | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "axonius": { | ||
| "user": { | ||
| "allowed_scopes_impersonation": [ | ||
| "63622d93d27vdfrew4d9489db6a1cf", | ||
| "63622d93d27fvdwe4d9489db6a1cc" | ||
| ], | ||
| "data_scope_id": "fgreghtgrtefdgrt63622d93d274d9489db6a1cf", | ||
| "data_scope_name": "sample data scope", | ||
| "department": "sample", | ||
| "email": "[email protected]", | ||
| "first_name": "bob", | ||
| "last_login": "2025-03-08T18:53:09.000Z", | ||
| "last_name": "doe", | ||
| "last_updated": "2025-03-12T18:53:09.000Z", | ||
| "role_id": "63622d93d27xcvdgre4d9489dbbgresdcv6a1cf", | ||
| "role_name": " role", | ||
| "source": "sample source", | ||
| "title": "Cloud Operations Engineer", | ||
| "user_name": "bob.doe", | ||
| "uuid": "78ij63622d93d274d9489db6a1cf" | ||
| } | ||
| }, | ||
| "ecs": { | ||
| "version": "9.2.0" | ||
| }, | ||
| "event": { | ||
| "kind": "event", | ||
| "original": "{\"role_id\":\"63622d93d27xcvdgre4d9489dbbgresdcv6a1cf\",\"data_scope_id\":\"fgreghtgrtefdgrt63622d93d274d9489db6a1cf\",\"allowed_scopes_impersonation\":[\"63622d93d27vdfrew4d9489db6a1cf\",\"63622d93d27fvdwe4d9489db6a1cc\"],\"first_name\":\"bob\",\"last_name\":\"doe\",\"email\":\"[email protected]\",\"title\":\"Cloud Operations Engineer\",\"department\":\"sample\",\"user_name\":\"bob.doe\",\"last_updated\":\"Mon, 12 Mar 2025 18:53:09 GMT\",\"source\":\"sample source\",\"uuid\":\"78ij63622d93d274d9489db6a1cf\",\"role_name\":\" role\",\"data_scope_name\":\"sample data scope\",\"last_login\":\"Mon, 08 Mar 2025 18:53:09 GMT\"}" | ||
| }, | ||
| "related": { | ||
| "user": [ | ||
| "bob", | ||
| "doe", | ||
| "[email protected]", | ||
| "bob.doe", | ||
| "78ij63622d93d274d9489db6a1cf" | ||
| ] | ||
| }, | ||
| "tags": [ | ||
| "preserve_duplicate_custom_fields" | ||
| ], | ||
| "user": { | ||
| "domain": "example.com", | ||
| "email": "[email protected]", | ||
| "full_name": "bob doe", | ||
| "id": "78ij63622d93d274d9489db6a1cf", | ||
| "name": "bob.doe", | ||
| "roles": [ | ||
| " role" | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
12 changes: 12 additions & 0 deletions
12
packages/axonius/data_stream/user/_dev/test/system/test-default-config.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| input: cel | ||
| service: axonius | ||
| vars: | ||
| url: http://{{Hostname}}:{{Port}} | ||
| api_key: xxxx | ||
| secret_key: xxxx | ||
| data_stream: | ||
| vars: | ||
| preserve_original_event: true | ||
| preserve_duplicate_custom_fields: true | ||
| assert: | ||
| hit_count: 2 |
79 changes: 79 additions & 0 deletions
79
packages/axonius/data_stream/user/agent/stream/cel.yml.hbs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| config_version: 2 | ||
| interval: {{interval}} | ||
| resource.tracer: | ||
| enabled: {{enable_request_tracer}} | ||
| filename: "../../logs/cel/http-request-trace-*.ndjson" | ||
| maxbackups: 5 | ||
| {{#if proxy_url}} | ||
| resource.proxy_url: {{proxy_url}} | ||
| {{/if}} | ||
| {{#if ssl}} | ||
| resource.ssl: {{ssl}} | ||
| {{/if}} | ||
| {{#if http_client_timeout}} | ||
| resource.timeout: {{http_client_timeout}} | ||
| {{/if}} | ||
| resource.url: {{url}} | ||
|
|
||
| state: | ||
| api_key: {{api_key}} | ||
| secret_key: {{secret_key}} | ||
| redact: | ||
| fields: | ||
| - api_key | ||
| - secret_key | ||
| program: | | ||
| request( | ||
| "GET", | ||
| state.url.trim_right("/") + "/api/v2/users" | ||
| ).with({ | ||
| "Header":{ | ||
| "Accept": ["application/json"], | ||
| "api-key": [state.api_key], | ||
| "api-secret": [state.secret_key], | ||
| } | ||
| }).do_request().as(resp, resp.StatusCode == 200 ? | ||
| resp.Body.decode_json().as(body, | ||
| { | ||
| "events": body.?users.orValue([]).map(e, { | ||
| "message": e.encode_json(), | ||
| }), | ||
| "api_key": state.api_key, | ||
| "secret_key": state.secret_key, | ||
| } | ||
| ) | ||
| : | ||
| { | ||
| "events": { | ||
| "error": { | ||
| "code": string(resp.StatusCode), | ||
| "id": string(resp.Status), | ||
| "message": "GET" + state.url.trim_right("/") + "/api/v2/users/: " + ( | ||
| size(resp.Body) != 0 ? | ||
| string(resp.Body) | ||
| : | ||
| string(resp.Status) + ' (' + string(resp.StatusCode) + ')' | ||
| ), | ||
| }, | ||
| }, | ||
| "api_key": state.api_key, | ||
| "secret_key": state.secret_key, | ||
| } | ||
| ) | ||
| tags: | ||
| {{#if preserve_original_event}} | ||
| - preserve_original_event | ||
| {{/if}} | ||
| {{#if preserve_duplicate_custom_fields}} | ||
| - preserve_duplicate_custom_fields | ||
| {{/if}} | ||
| {{#each tags as |tag|}} | ||
| - {{tag}} | ||
| {{/each}} | ||
| {{#contains "forwarded" tags}} | ||
| publisher_pipeline.disable_host: true | ||
| {{/contains}} | ||
| {{#if processors}} | ||
| processors: | ||
| {{processors}} | ||
| {{/if}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.