Giter Club home page Giter Club logo

Comments (12)

eimann avatar eimann commented on May 14, 2024 3

The ping binary should not have suid set, but rather have appropriate capabilities:

$ getcap /bin/ping
/bin/ping = cap_net_raw+ep

Same goes for the exporter:
sudo setcap cap_net_raw+ep blackbox_exporter

With this setting the exporter will run properly without suid/uid=0 set.

from blackbox_exporter.

StianOvrevage avatar StianOvrevage commented on May 14, 2024 1

I'm hitting this problem as well. Can't use setcap within the container either.

from blackbox_exporter.

sdurrheimer avatar sdurrheimer commented on May 14, 2024 1

Can you guys try with the master tag ?
The current latest tag is based on alpine and run with an unprivileged user golang.
The current master tag is based on busybox and run as root.

from blackbox_exporter.

brian-brazil avatar brian-brazil commented on May 14, 2024

This seems like more of a Docker/security/systemd problem than one with the blackbox exporter. I'd suggest asking those communities how to get raw socket access.

0 means failure, in general for boolean metrics 0 is false and 1 is true.

from blackbox_exporter.

kaihendry avatar kaihendry commented on May 14, 2024

Is the golang program somehow dropping perms I wonder? Inside the container I can ping fine.

[root@rojak system]# docker exec -i -t blackboxprober sh
/bin $ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=58 time=2.023 ms
64 bytes from 8.8.8.8: seq=1 ttl=58 time=1.748 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss

from blackbox_exporter.

brian-brazil avatar brian-brazil commented on May 14, 2024

ping is SUID, so it has root.

from blackbox_exporter.

kaihendry avatar kaihendry commented on May 14, 2024

can't the golang binary be setup to also have suid in the Dockerfile?

from blackbox_exporter.

jimmidyson avatar jimmidyson commented on May 14, 2024

So if we want to run this in Docker we should probably try to do the same thing in this exporter? AFAIK ping is suid, raises privs to open socket & then returns to non-suid to continue. Can we do the same?

from blackbox_exporter.

brian-brazil avatar brian-brazil commented on May 14, 2024

It's a bit more complicated as 1) we'd need to support dropping privs on all platforms with all the associated options and 2) we'd need to share the one open socket across all the scrapes.

from blackbox_exporter.

jimmidyson avatar jimmidyson commented on May 14, 2024

True but doable. Could be a "fun" challenge :)

from blackbox_exporter.

StianOvrevage avatar StianOvrevage commented on May 14, 2024

Working!

probe_success 1

Thanks!

from blackbox_exporter.

brian-brazil avatar brian-brazil commented on May 14, 2024

We've documented the requirements now.

from blackbox_exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.