Skip to content

Commit

Permalink
Disable seccomp filter for osquerybeat (#34165) (#34166)
Browse files Browse the repository at this point in the history
* Disable seccomp filter for osquerybeat

* Update NOTICE.txt

(cherry picked from commit dcf189b)

Co-authored-by: Aleksandr Maus <aleksandr.maus@elastic.co>
  • Loading branch information
mergify[bot] and aleksmaus committed Jan 4, 2023
1 parent 0d90255 commit 561a3e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion NOTICE.txt
@@ -1,5 +1,5 @@
Elastic Beats
Copyright 2014-2022 Elasticsearch BV
Copyright 2014-2023 Elasticsearch BV

This product includes software developed by The Apache Software
Foundation (http://www.apache.org/).
Expand Down
11 changes: 8 additions & 3 deletions libbeat/cmd/instance/beat.go
Expand Up @@ -429,8 +429,12 @@ func (b *Beat) launch(settings Settings, bt beat.Creator) error {
}
}

if err := seccomp.LoadFilter(b.Config.Seccomp); err != nil {
return err
// Do not load seccomp for osquerybeat, it was disabled before V2 in the configuration file
// https://github.com/elastic/beats/blob/7cf873fd340172c33f294500ccfec948afd7a47c/x-pack/osquerybeat/osquerybeat.yml#L16
if b.Info.Beat != "osquerybeat" {
if err := seccomp.LoadFilter(b.Config.Seccomp); err != nil {
return err
}
}

beater, err := b.createBeater(bt)
Expand Down Expand Up @@ -553,7 +557,7 @@ func (b *Beat) TestConfig(settings Settings, bt beat.Creator) error {
}())
}

//SetupSettings holds settings necessary for beat setup
// SetupSettings holds settings necessary for beat setup
type SetupSettings struct {
Dashboard bool
Pipeline bool
Expand All @@ -566,6 +570,7 @@ type SetupSettings struct {
}

// Setup registers ES index template, kibana dashboards, ml jobs and pipelines.
//
//nolint:forbidigo // required to give feedback to user
func (b *Beat) Setup(settings Settings, bt beat.Creator, setup SetupSettings) error {
return handleError(func() error {
Expand Down

0 comments on commit 561a3e1

Please sign in to comment.