Skip to content

Commit

Permalink
[Auditbeat] Cherry-pick #12740 to 6.8: Process dataset: Do not… (#12759)
Browse files Browse the repository at this point in the history
Remove the non-root warning on Windows as `os.Geteuid()` always returns `-1`.

(cherry picked from commit ba9c79e)
  • Loading branch information
Christoph Wurm authored Jul 3, 2019
1 parent 0f19b7c commit b32b6ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ https://github.com/elastic/beats/compare/v6.8.0...6.8.1[Check the HEAD diff]

*Auditbeat*

- Process dataset: Do not show non-root warning on Windows. {pull}12740[12740]

*Filebeat*

*Heartbeat*
Expand Down
3 changes: 2 additions & 1 deletion x-pack/auditbeat/module/system/process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"fmt"
"os"
"os/user"
"runtime"
"strconv"
"time"

Expand Down Expand Up @@ -160,7 +161,7 @@ func New(base mb.BaseMetricSet) (mb.MetricSet, error) {
ms.log.Debug("No state timestamp found")
}

if os.Geteuid() != 0 {
if runtime.GOOS != "windows" && os.Geteuid() != 0 {
ms.log.Warn("Running as non-root user, will likely not report all processes.")
}

Expand Down

0 comments on commit b32b6ba

Please sign in to comment.