File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
profiler/src/ProfilerEngine/Datadog.Profiler.Native Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 2222#define _GNU_SOURCE
2323#include < errno.h>
2424#include " cgroup.h"
25+ #include < sys/auxv.h>
2526#endif
2627
2728#include < chrono>
@@ -386,6 +387,17 @@ bool OpSysTools::IsSafeToStartProfiler(double coresThreshold)
386387 }
387388 }
388389
390+ // Check if process is running is a secure-execution mode
391+ auto at_secure = getauxval (AT_SECURE);
392+ Log::Info (" Is process running in a secure execution mode ? " , std::boolalpha, at_secure);
393+ // Reasons for which AT_SECURE is true:
394+ // User ID != Effective User ID
395+ Log::Info (" Process User ID differs from Effective User ID ? " , std::boolalpha, getuid () != geteuid ());
396+ // Group ID != Effective Group ID
397+ Log::Info (" Process Group ID differs from Effective Group ID ? " , std::boolalpha, getgid () != getegid ());
398+ // TODO check capabilities (for now checking capabilities requires additional packages/libraries)
399+ // if at_secure is true, we know that it due to the capabilities
400+
389401 return false ;
390402 }
391403
You can’t perform that action at this time.
0 commit comments