mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 10:17:05 +08:00
Chore: Add WARN log if grafana server process is running with elevated privileges (#35205)
* warn on linux * add warning for grpc plugins * add windows support * update go.mod * reorganize imports * update naming * remove Windows logic * simplify and add check for when UID and EUID don't match * fix build * tidy go.mod * feedback * cleanup + migrate
This commit is contained in:
@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/grafana/grafana-plugin-sdk-go/backend"
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/infra/process"
|
||||
"github.com/grafana/grafana/pkg/plugins/backendplugin"
|
||||
"github.com/hashicorp/go-plugin"
|
||||
)
|
||||
@ -72,6 +73,14 @@ func (p *grpcPlugin) Start(ctx context.Context) error {
|
||||
return errors.New("no compatible plugin implementation found")
|
||||
}
|
||||
|
||||
elevated, err := process.IsRunningWithElevatedPrivileges()
|
||||
if err != nil {
|
||||
p.logger.Debug("Error checking plugin process execution privilege", "err", err)
|
||||
}
|
||||
if elevated {
|
||||
p.logger.Warn("Plugin process is running with elevated privileges. This is not recommended")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user