-
Notifications
You must be signed in to change notification settings - Fork 5k
[Auditbeat] Add user metricset #8835
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
cwurm
merged 31 commits into
elastic:feature-auditbeat-host
from
cwurm:users_host_metricset
Nov 16, 2018
Merged
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
ac0dc1b
Add users information to host metricset.
c107ca9
Adding a newline to fields.asciidoc.
52ad924
Move user to own metricset and add change detection.
74a9e51
Roll back host metricset.
ba605ce
Allow compile without cgo.
cfcd957
Fix error message.
10da750
That newline cannot matter...
989576c
Add persistence between restarts.
5524e80
Change to event.action.
c96eed5
Fix test data generation.
3e05cee
Change to existing_user.
e3158e6
Fix test data generation.
0c73f94
Roll back data_generator.go
459fff8
Minor fixes.
30f215b
Fix error.
0f134fa
Refactor sending events.
6d15fad
Add state_id.
6c9c949
Periodic state.
9e068f5
Import order.
8472701
Readable passwd field.
114cc44
Read shadow file to detect password changes.
75d73dd
Read /etc/groups to add group membership info to users.
a55f6e2
Stat files to detect possible changes.
8d04139
Spelling.
f6e54a5
Change method order for readability.
1f3eecb
Improvements to config files.
18399d0
Add top-level user information.
5268806
Switch to new UUID library.
0681300
Use full encrypted password for change detection, store as SHA-512 hash.
96da651
Hash entire password field.
29db642
Checkout auditbeat/docs/fields.asciidoc from master.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4965,3 +4965,4 @@ Kubernetes container image | |
|
|
||
|
|
||
| -- | ||
|
|
||
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
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,38 @@ | ||
| { | ||
| "@timestamp": "2017-10-12T08:05:34.853Z", | ||
| "beat": { | ||
| "hostname": "host.example.com", | ||
| "name": "host.example.com" | ||
| }, | ||
| "event": { | ||
| "module": "system", | ||
| "dataset": "user", | ||
| "type": "state", | ||
| "action": "existing_user", | ||
| "id": "57ee8bb6-a3da-4c43-b0d9-0688ccdc88d0" | ||
| }, | ||
| "user": { | ||
| "id": 1001, | ||
| "name": "ubuntu" | ||
| }, | ||
| "system": { | ||
| "user": { | ||
cwurm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| "uid": 1001, | ||
| "gid": 1001, | ||
| "name": "ubuntu", | ||
| "dir": "/home/ubuntu", | ||
| "shell": "/bin/bash", | ||
| "user_information": "Ubuntu", | ||
| "group": [ | ||
| { | ||
| "name": "sudo", | ||
| "gid": 27 | ||
| } | ||
| ], | ||
| "password": { | ||
| "type": "shadow_password", | ||
| "last_changed": "2018-09-21T00:00:00.000Z" | ||
| } | ||
| } | ||
| } | ||
| } | ||
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,8 @@ | ||
| The System `user` metricset provides ... TODO. | ||
|
|
||
| The module is implemented for Linux. | ||
|
|
||
| [float] | ||
| === Configuration options | ||
|
|
||
| TODO |
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,60 @@ | ||
| - name: user | ||
| type: group | ||
| description: > | ||
| `user` contains information about the users on a system. | ||
| release: experimental | ||
| fields: | ||
| - name: name | ||
| type: keyword | ||
| description: > | ||
| User name. | ||
| - name: uid | ||
| type: integer | ||
| description: > | ||
| User ID. | ||
| - name: gid | ||
| type: integer | ||
| description: > | ||
| Group ID. | ||
| - name: dir | ||
| type: keyword | ||
| description: > | ||
| User's home directory. | ||
| - name: shell | ||
| type: keyword | ||
| description: > | ||
| Program to run at login. | ||
| - name: user_information | ||
| type: text | ||
| description: > | ||
| General user information. On Linux, this is the gecos field. | ||
| - name: group | ||
cwurm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| type: object | ||
| description: > | ||
| `group` contains information about any groups the user is part of (beyond the user's primary group). | ||
| fields: | ||
| - name: name | ||
| type: keyword | ||
| description: > | ||
| Group name. | ||
| - name: gid | ||
| type: integer | ||
| description: > | ||
| Group ID. | ||
| - name: password | ||
| type: group | ||
| description: > | ||
| `password` contains information about a user's password (not the password itself). | ||
cwurm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| fields: | ||
| - name: type | ||
| type: keyword | ||
| description: > | ||
| A user's password type. Possible values are `shadow_password` | ||
| (the password hash is in the shadow file), `password_disabled`, | ||
| `no_password` (this is dangerous as anyone can log in), and | ||
| `crypt_password` (when the password field in /etc/passwd seems | ||
| to contain an encrypted password). | ||
| - name: last_changed | ||
| type: date | ||
| description: > | ||
| The day the user's password was last changed. | ||
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,31 @@ | ||
| // Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| // or more contributor license agreements. Licensed under the Elastic License; | ||
| // you may not use this file except in compliance with the Elastic License. | ||
|
|
||
| package user | ||
|
|
||
| import ( | ||
| "time" | ||
| ) | ||
|
|
||
| // Config defines the metricset's configuration options. | ||
| type Config struct { | ||
| StatePeriod time.Duration `config:"state.period"` | ||
| UserStatePeriod time.Duration `config:"user.state.period"` | ||
| } | ||
|
|
||
| // Validate validates the host metricset config. | ||
| func (c *Config) Validate() error { | ||
| return nil | ||
| } | ||
|
|
||
| func (c *Config) effectiveStatePeriod() time.Duration { | ||
| if c.UserStatePeriod != 0 { | ||
| return c.UserStatePeriod | ||
| } | ||
| return c.StatePeriod | ||
| } | ||
|
|
||
| var defaultConfig = Config{ | ||
| StatePeriod: 12 * time.Hour, | ||
| } |
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.