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
}
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 and parses the configuration file in the local repository. It returns the parsed configuration and the YAML file (or a YAML conversion, in the case of legacy configurations).
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