privileged

package
v0.0.0-...-45a9bcf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package privileged implements language detection that relies on elevated permissions.

An example of privileged language detection would be binary analysis, where the binary must be inspected to determine the language it was compiled from.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockPrivilegedDetectors

func MockPrivilegedDetectors(t *testing.T, newDetectors []languagemodels.Detector)

MockPrivilegedDetectors is used in tests to inject mock tests. It should be called before `DetectWithPrivileges`

Types

type LanguageDetector

type LanguageDetector struct {
	// contains filtered or unexported fields
}

LanguageDetector is a struct that is used by the system probe to run through the list of detectors that require elevated privileges to run. It contains some extra state such as a cached hostProc value, as well as a cache for processes that reuse a binary which has already been seen.

func NewLanguageDetector

func NewLanguageDetector() LanguageDetector

NewLanguageDetector constructs a new LanguageDetector

func (*LanguageDetector) DetectWithPrivileges

func (l *LanguageDetector) DetectWithPrivileges(procs []languagemodels.Process) []languagemodels.Language

DetectWithPrivileges is used by the system probe to detect languages for languages that require binary analysis to detect.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL