Documentation
¶
Index ¶
Constants ¶
const ( ConfigFileNameBase = "code-security.datadog" LegacyConfigFileName = "dd-iac-scan.config" )
Variables ¶
This section is empty.
Functions ¶
func UnparseConfig ¶ added in v1.1.1
UnparseConfig turns a parsed configuration into a YAML file. It ignores the LegacyExcludeResults field, since it's not representable in YAML. You will need to handle it externally if you need to.
Types ¶
type IacConfig ¶
type IacConfig struct {
IgnoreRules []string
OnlyRules []string
IgnorePaths []string
OnlyPaths []string
IgnoreSeverities []string
OnlySeverities []string
IgnoreCategories []string
OnlyCategories []string
LegacyExcludeResults []string
RuleConfigs map[string]IacRuleConfig
IgnorePlatforms []string
OnlyPlatforms []string
}
func ParseConfig ¶
ParseConfig turns a YAML configuration file into a parsed configuration
func ReadConfiguration ¶
func ReadConfiguration(ctx context.Context, rootPath string, options ...ReadConfigurationOption) (*IacConfig, []byte, error)
ReadConfiguration reads the local config file (if any), applies all options (e.g. WithDatadog), and returns the parsed result. Options are always applied even when no local file exists, so server-side customizations are fetched regardless of local file presence.
type IacRuleConfig ¶ added in v1.3.2
IacRuleConfig holds per-rule overrides: path scoping and severity override. nil slices mean "no restriction". A nil Severity means "no override".
type InvalidLocalConfigError ¶ added in v1.2.0
type InvalidLocalConfigError struct {
// contains filtered or unexported fields
}
InvalidLocalConfigError is returned when the local IaC configuration file cannot be read or parsed. It does NOT cover errors from remote config sources such as Datadog API calls via WithDatadog.
func (*InvalidLocalConfigError) Error ¶ added in v1.2.0
func (e *InvalidLocalConfigError) Error() string
func (*InvalidLocalConfigError) Unwrap ¶ added in v1.2.0
func (e *InvalidLocalConfigError) Unwrap() error
type ReadConfigurationOption ¶ added in v1.1.1
func WithDatadog ¶ added in v1.1.1
func WithDatadog(client datadog.Client, repoUrl string) ReadConfigurationOption
WithDatadog calls the Datadog backend to append server-side customizations to the local repo config.