github.com/DataDog/datadog-agent/pkg/security/secl@v0.55.0-devel.0.20240517055856-10c4965fea94/rules/policy_provider.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 rules holds rules related files
     7  package rules
     8  
     9  import (
    10  	"github.com/hashicorp/go-multierror"
    11  )
    12  
    13  // DefaultPolicyName is the name of the default policy
    14  // the default policy has a slightly privileged position when loading the rules
    15  const DefaultPolicyName = "default.policy"
    16  
    17  // PolicyProvider defines a rule provider
    18  type PolicyProvider interface {
    19  	LoadPolicies([]MacroFilter, []RuleFilter) ([]*Policy, *multierror.Error)
    20  	SetOnNewPoliciesReadyCb(func())
    21  
    22  	Start()
    23  	Close() error
    24  
    25  	// Type returns the type of policy provider, like 'directoryPolicyProvider'
    26  	Type() string
    27  }