rpz

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaskTimestamps          = true
	IgnoreFirstProcessFiles = true
	WorkingDirPathIndex     int64
)

Functions

func AccessedPathUri added in v0.2.6

func AccessedPathUri(g *rdf.Graph, pathIndex int64) rdf.Uri

func AddAccessedPathTriples added in v0.2.6

func AddAccessedPathTriples(g *rdf.Graph, accessed []AccessedPath)

func AddArgumentTriples

func AddArgumentTriples(g *rdf.Graph, arguments []Argument)

func AddExecutionTriples

func AddExecutionTriples(g *rdf.Graph, executions []Execution)

func AddFileOpenTriples

func AddFileOpenTriples(g *rdf.Graph, fileOpens []FileOpen)

func AddPathRoleTriples

func AddPathRoleTriples(g *rdf.Graph, pathRoles []PathRole)

func AddProcessTriples

func AddProcessTriples(g *rdf.Graph, processes []Process)

func AddRunTriples

func AddRunTriples(g *rdf.Graph, trace Trace, run WorkflowRun)

func ArgumentUri

func ArgumentUri(g *rdf.Graph, executionURI rdf.Uri, id int64) rdf.Uri

func D

func D(id int64) string

func E

func E(id int64) string

func ExecutionUri

func ExecutionUri(g *rdf.Graph, id int64) rdf.Uri

func FileAccessUri

func FileAccessUri(g *rdf.Graph, processID int64, openID int64) rdf.Uri

func GetTraceGraph

func GetTraceGraph(trace Trace) *rdf.Graph

func I

func I(id int64) string

func O

func O(id int64) string

func P

func P(id int64) string

func PathIndex

func PathIndex(path string) (pathIndex int64, ok bool)

func PathRoleURI

func PathRoleURI(g *rdf.Graph, id int64) rdf.Uri

func Prepend

func Prepend(s string, i int64) string

func ProcessUri

func ProcessUri(g *rdf.Graph, id int64) rdf.Uri

func Q

func Q(s string) string

func R

func R(id int64) string

func Role

func Role(path string) string

func RunBaseUri added in v0.2.6

func RunBaseUri(g *rdf.Graph, run WorkflowRun) rdf.Uri

func TrimWorkingDirPrefix

func TrimWorkingDirPrefix(absolutePath string) string

func WriteAccessedPathFacts

func WriteAccessedPathFacts(w io.Writer, accessed []AccessedPath)

func WriteArgumentFacts

func WriteArgumentFacts(w io.Writer, arguments []Argument)

func WriteExecutionFacts

func WriteExecutionFacts(w io.Writer, executed []Execution)

func WriteFileOpenFacts

func WriteFileOpenFacts(w io.Writer, opens []FileOpen)

func WritePathRoleFacts

func WritePathRoleFacts(w io.Writer, pathRoles []PathRole)

func WriteProcessFacts

func WriteProcessFacts(writer io.Writer, processes []Process)

func WriteRunFacts

func WriteRunFacts(writer io.Writer, run WorkflowRun)

func WriteTraceFacts

func WriteTraceFacts(file io.Writer, trace Trace)

Types

type AccessedPath

type AccessedPath struct {
	AccessID  string
	RunID     int64
	Absolute  string
	Relative  string
	PathIndex int64
	PathRole  string
}

func GetAccessedPaths

func GetAccessedPaths(executed []Execution, opens []FileOpen) []AccessedPath

func (AccessedPath) String

func (f AccessedPath) String() string

type Argument

type Argument struct {
	ExecID int64
	Index  int64
	Value  string
}

Argument represents the arguments passed to executions recorded in the executed_files table of trace.sqlite3

func GetArguments

func GetArguments(executions []Execution) []Argument

GetArguments returns all arguments pass to execution recorded in the executed_files table of trace.sqlite3

func (Argument) String

func (a Argument) String() string

String prints one row of the executed_files table of trace.sqlite3 as a Prolog fact

type Execution

type Execution struct {
	ExecID     int64
	Name       string
	RunID      int64
	Timestamp  int64
	Process    int64
	Argv       string
	Envp       string
	WorkingDir string
}

Execution represents a row in the executed_files table of trace.sqlite3

func GetExecutions

func GetExecutions(db *sql.DB) []Execution

GetExecutions returns all rows in the executed_files table of trace.sqlite3

func (Execution) String

func (f Execution) String() string

String prints one row of the executed_files table of trace.sqlite3 as a Prolog fact

type FileOpen

type FileOpen struct {
	OpenID      int64
	RunID       int64
	Name        string
	Timestamp   int64
	Mode        int64
	IsDirectory bool
	Process     int64
}

FileOpen represents a row in the opened_files table of trace.sqlite3

func GetFileOpens

func GetFileOpens(trace Trace, db *sql.DB) []FileOpen

GetFileOpens returns all rows in the opened_files table of trace.sqlite3

func (FileOpen) String

func (fo FileOpen) String() string

String prints one row of the opened_files table of trace.sqlite3 as a Prolog fact

type PathRole

type PathRole struct {
	RunID     int64
	Path      string
	PathIndex int64
	Role      string
}

func GetPathRoleFacts

func GetPathRoleFacts(config cpr.Config, runID int64) []PathRole

func (PathRole) String

func (pr PathRole) String() string

type Process

type Process struct {
	ID        int64
	RunID     int64
	Parent    sql.NullInt64
	Timestamp int64
	IsThread  bool
	ExitCode  int64
}

Process represents a row in the processes table of trace.sqlite3

func GetProcesses

func GetProcesses(db *sql.DB) []Process

GetProcesses returns all rows in the processes table of trace.sqlite3

func (Process) String

func (p Process) String() string

String prints one row of the processes table of trace.sqlite3 as a Prolog fact

type Trace

type Trace struct {
	FirstProcess int64
	PathRoles    []PathRole
	Run          WorkflowRun
	Processes    []Process
	Executions   []Execution
	Arguments    []Argument
	FileOpens    []FileOpen
	Accesses     []AccessedPath
}

func ExtractTrace

func ExtractTrace(runName string, traceDir string, config cpr.Config) Trace

type WorkflowRun

type WorkflowRun struct {
	RunID   int64
	RunName string
}

func NewWorkflowRun

func NewWorkflowRun(runId int64, runName string) WorkflowRun

func (WorkflowRun) String

func (r WorkflowRun) String() string

Jump to

Keyboard shortcuts

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