github.com/DataDog/datadog-agent/pkg/security/secl@v0.55.0-devel.0.20240517055856-10c4965fea94/model/variables.go (about)

     1  // Unless explicitly stated otherwise all files in this repository are licensed
     2  // under the Apache License Version 2.0.
     3  // This product includes software developed at Datadog (https://www.datadoghq.com/).
     4  // Copyright 2016-present Datadog, Inc.
     5  
     6  // Package model holds model related files
     7  package model
     8  
     9  import (
    10  	"github.com/DataDog/datadog-agent/pkg/security/secl/compiler/eval"
    11  )
    12  
    13  var (
    14  	// SECLVariables set of variables
    15  	SECLVariables = map[string]eval.VariableValue{
    16  		"process.pid": eval.NewIntVariable(func(ctx *eval.Context) int {
    17  			pc := ctx.Event.(*Event).ProcessContext
    18  			if pc == nil {
    19  				return 0
    20  			}
    21  			return int(pc.Process.Pid)
    22  		}, nil),
    23  	}
    24  )