Skip to content
Merged
Show file tree
Hide file tree
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.
Oct 30, 2018
c107ca9
Adding a newline to fields.asciidoc.
Oct 30, 2018
52ad924
Move user to own metricset and add change detection.
Nov 6, 2018
74a9e51
Roll back host metricset.
Nov 6, 2018
ba605ce
Allow compile without cgo.
Nov 6, 2018
cfcd957
Fix error message.
Nov 6, 2018
10da750
That newline cannot matter...
Nov 7, 2018
989576c
Add persistence between restarts.
Nov 7, 2018
5524e80
Change to event.action.
Nov 7, 2018
c96eed5
Fix test data generation.
Nov 7, 2018
3e05cee
Change to existing_user.
Nov 7, 2018
e3158e6
Fix test data generation.
Nov 7, 2018
0c73f94
Roll back data_generator.go
Nov 7, 2018
459fff8
Minor fixes.
Nov 8, 2018
30f215b
Fix error.
Nov 8, 2018
0f134fa
Refactor sending events.
Nov 8, 2018
6d15fad
Add state_id.
Nov 8, 2018
6c9c949
Periodic state.
Nov 8, 2018
9e068f5
Import order.
Nov 9, 2018
8472701
Readable passwd field.
Nov 9, 2018
114cc44
Read shadow file to detect password changes.
Nov 9, 2018
75d73dd
Read /etc/groups to add group membership info to users.
Nov 12, 2018
a55f6e2
Stat files to detect possible changes.
Nov 12, 2018
8d04139
Spelling.
Nov 12, 2018
f6e54a5
Change method order for readability.
Nov 12, 2018
1f3eecb
Improvements to config files.
Nov 13, 2018
18399d0
Add top-level user information.
Nov 13, 2018
5268806
Switch to new UUID library.
Nov 14, 2018
0681300
Use full encrypted password for change detection, store as SHA-512 hash.
Nov 14, 2018
96da651
Hash entire password field.
Nov 16, 2018
29db642
Checkout auditbeat/docs/fields.asciidoc from master.
Nov 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions auditbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4965,3 +4965,4 @@ Kubernetes container image


--

1 change: 1 addition & 0 deletions x-pack/auditbeat/include/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ import (
_ "github.com/elastic/beats/x-pack/auditbeat/module/system/host"
_ "github.com/elastic/beats/x-pack/auditbeat/module/system/packages"
_ "github.com/elastic/beats/x-pack/auditbeat/module/system/processes"
_ "github.com/elastic/beats/x-pack/auditbeat/module/system/user"
)
9 changes: 7 additions & 2 deletions x-pack/auditbeat/module/system/_meta/config.yml.tmpl
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
{{ if .Reference -}}
{{ end -}}
- module: system

metricsets:
- host
- packages
- processes
{{ if eq .GOOS "linux" -}}
- user
{{- end }}

state.period: 12h

report_changes: true

{{ if eq .GOOS "darwin" -}}
{{ else if eq .GOOS "windows" -}}
{{ else -}}
Expand Down
38 changes: 38 additions & 0 deletions x-pack/auditbeat/module/system/user/_meta/data.json
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": {
"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"
}
}
}
}
8 changes: 8 additions & 0 deletions x-pack/auditbeat/module/system/user/_meta/docs.asciidoc
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
60 changes: 60 additions & 0 deletions x-pack/auditbeat/module/system/user/_meta/fields.yml
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
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).
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.
31 changes: 31 additions & 0 deletions x-pack/auditbeat/module/system/user/config.go
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,
}
Loading