Skip to content
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

[7.17](backport #32816) Add cap_net_raw requirements to heartbeat docs #33124

Merged
merged 1 commit into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions heartbeat/docs/running-on-docker.asciidoc
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
include::{libbeat-dir}/shared-docker.asciidoc[]

[float]
==== Required network capabilities

Under Docker, {beatname_uc} runs as a non-root user, but requires some privileged
network capabilities to operate correctly. Ensure that the +NET_RAW+
capability is available to the container.

["source","sh",subs="attributes"]
----
docker run --cap-add=NET_RAW {dockerimage}
----
19 changes: 19 additions & 0 deletions heartbeat/docs/running-on-kubernetes.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,22 @@ $ kubectl --namespace=kube-system get deployment/{beatname_lc}
NAME READY UP-TO-DATE AVAILABLE AGE
{beatname_lc} 1/1 1 1 1m
------------------------------------------------

[float]
==== Running {beatname_uc} as unprivileged user

Under Kubernetes, {beatname_uc} can run as a non-root user, but requires some privileged
network capabilities to operate correctly. Ensure that the +NET_RAW+
capability is available to the container.

["source","yaml",subs="attributes"]
----
containers:
- name: heartbeat
image: {dockerimage}
securityContext:
runAsUser: 1000
runAsGroup: 1000
capabilities:
add: [ NET_RAW ]
----
2 changes: 2 additions & 0 deletions libbeat/docs/shared-docker.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ ifeval::["{beatname_lc}"=="heartbeat"]
["source", "sh", subs="attributes"]
--------------------------------------------
docker run \
--cap-add=NET_RAW \
{dockerimage} \
setup -E setup.kibana.host=kibana:5601 \
-E output.elasticsearch.hosts=["elasticsearch:9200"] <1> <2>
Expand Down Expand Up @@ -206,6 +207,7 @@ docker run -d \
--name={beatname_lc} \
--user={beatname_lc} \
--volume="$(pwd)/{beatname_lc}.docker.yml:/usr/share/{beatname_lc}/{beatname_lc}.yml:ro" \
--cap-add=NET_RAW \
{dockerimage} \
--strict.perms=false -e \
-E output.elasticsearch.hosts=["elasticsearch:9200"] <1> <2>
Expand Down