Skip to content

[Heartbeat][Agent] Seccomp / synthetics bugfix improvements#28514

Merged
andrewvc merged 8 commits intoelastic:masterfrom
andrewvc:seccomp-improvements
Oct 19, 2021
Merged

[Heartbeat][Agent] Seccomp / synthetics bugfix improvements#28514
andrewvc merged 8 commits intoelastic:masterfrom
andrewvc:seccomp-improvements

Conversation

@andrewvc
Copy link
Copy Markdown
Contributor

@andrewvc andrewvc commented Oct 18, 2021

Fixes a variety of seccomp and synthetics execution related issues:

  1. Adds the setcap syscall, which chrome invokes to drop all privileges. Chrome crashes w/o this.
  2. Adds the getgroups syscall, which we use to log the active groups
  3. Improves logging for process execution failures with more detail
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas

Using capabilities breaks docker when run with `--cap-drop` which
sometimes happens. We should find a way to fail gracefully instead.
@andrewvc andrewvc added bug Team:obs-ds-hosted-services Label for the Observability Hosted Services team v7.16.0 backport-v7.16.0 Automated backport with mergify labels Oct 18, 2021
@andrewvc andrewvc requested a review from justinkambic October 18, 2021 19:16
@andrewvc andrewvc self-assigned this Oct 18, 2021
@andrewvc andrewvc requested a review from a team as a code owner October 18, 2021 19:16
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/uptime (Team:Uptime)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Oct 18, 2021
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Oct 18, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Duration: 82 min 22 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

@andrewvc andrewvc changed the title [Heartbeat][Agent] Seccomp improvements [Heartbeat][Agent] Seccomp / synthetics bugfix improvements Oct 18, 2021
Copy link
Copy Markdown
Member

@vigneshshanmugam vigneshshanmugam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andrewvc andrewvc merged commit 81c38fc into elastic:master Oct 19, 2021
@andrewvc andrewvc deleted the seccomp-improvements branch October 19, 2021 18:10
mergify bot pushed a commit that referenced this pull request Oct 19, 2021
Fixes a variety of seccomp and synthetics execution related issues:

Adds the setcap syscall, which chrome invokes to drop all privileges. Chrome crashes w/o this.
Adds the getgroups syscall, which we use to log the active groups
Improves logging for process execution failures with more detail

(cherry picked from commit 81c38fc)
andrewvc added a commit that referenced this pull request Oct 19, 2021
…28539)

Fixes a variety of seccomp and synthetics execution related issues:

Adds the setcap syscall, which chrome invokes to drop all privileges. Chrome crashes w/o this.
Adds the getgroups syscall, which we use to log the active groups
Improves logging for process execution failures with more detail

(cherry picked from commit 81c38fc)

Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>
Icedroid pushed a commit to Icedroid/beats that referenced this pull request Nov 1, 2021
…28514)

Fixes a variety of seccomp and synthetics execution related issues:

Adds the setcap syscall, which chrome invokes to drop all privileges. Chrome crashes w/o this.
Adds the getgroups syscall, which we use to log the active groups
Improves logging for process execution failures with more detail
@shahzad31
Copy link
Copy Markdown
Contributor

Post FF Testing looks good

verified that heartbeat is runnign as a process in the container

sh-4.2$ ps aux | grep heartbeat
elastic+      97  0.9  1.6 1706532 101412 ?      Sl   14:52   0:00 /usr/share/elastic-agent/data/elastic-agent-5ad13f/install/heartbeat-7.16.0-SNAPSHOT-linux-x86_64/heartbeat -E setup.ilm.enabled=false -E setup.template.enabled=false -E management.enabled=true -E logging.level=debug -E logging.level=info -E http.enabled=true -E http.host=unix:///usr/share/elastic-agent/data/tmp/default/heartbeat/heartbeat.sock -E logging.json=true -E logging.ecs=true -E logging.files.path=/usr/share/elastic-agent/data/logs/default -E logging.files.name=heartbeat-json.log -E logging.files.keepfiles=7 -E logging.files.permission=0640 -E logging.files.interval=1h -E path.data=/usr/share/elastic-agent/data/run/default/heartbeat--7.16.0-SNAPSHOT
elastic+    1267  0.0  0.0   9108   788 pts/0    S+   14:54   0:00 grep heartbeat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v7.16.0 Automated backport with mergify bug Team:obs-ds-hosted-services Label for the Observability Hosted Services team v7.16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants