Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMLII-2213 Add FIPS agent image option #1310

Merged
merged 5 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions common/config/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ const (
DDAgentSite = "site"
DDAgentMajorVersion = "majorVersion"
DDAgentExtraEnvVars = "extraEnvVars" // extraEnvVars is expected in the format: <key1>=<value1>,<key2>=<value2>,...
DDAgentJMX = "jmx"
DDAgentFIPS = "fips"

// Updater Namespace
DDUpdaterParamName = "deploy"
Expand Down Expand Up @@ -430,3 +432,11 @@ func (e *CommonEnvironment) GetIntWithDefault(config *sdkconfig.Config, paramNam

return defaultValue
}

func (e *CommonEnvironment) AgentFIPS() bool {
return e.GetBoolWithDefault(e.AgentConfig, DDAgentFIPS, false)
}

func (e *CommonEnvironment) AgentJMX() bool {
return e.GetBoolWithDefault(e.AgentConfig, DDAgentJMX, false)
}
3 changes: 3 additions & 0 deletions components/datadog/agent/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ func dockerAgentComposeManifest(agentImagePath string, apiKey pulumi.StringInput
func defaultAgentParams(params *dockeragentparams.Params) {
// After setting params.FullImagePath check if you need to use JMX Docker image
defer func(p *dockeragentparams.Params) {
if p.FIPS {
p.FullImagePath += "-fips"
}
if p.JMX {
p.FullImagePath = fmt.Sprintf("%s-jmx", p.FullImagePath)
}
Expand Down
10 changes: 10 additions & 0 deletions components/datadog/dockeragentparams/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ type Params struct {
EnvironmentVariables pulumi.StringMap
// PulumiDependsOn is a list of resources to depend on.
PulumiDependsOn []pulumi.ResourceOption
// FIPS is true if FIPS image is needed.
FIPS bool
}

type Option = func(*Params) error
Expand Down Expand Up @@ -91,6 +93,14 @@ func WithJMX() func(*Params) error {
}
}

// WithFIPS makes the image FIPS enabled
func WithFIPS() func(*Params) error {
return func(p *Params) error {
p.FIPS = true
return nil
}
}

func WithFullImagePath(fullImagePath string) func(*Params) error {
return func(p *Params) error {
p.FullImagePath = fullImagePath
Expand Down
8 changes: 8 additions & 0 deletions scenarios/aws/ec2/vm_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ func VMRunWithDocker(ctx *pulumi.Context) error {
agentOptions = append(agentOptions, dockeragentparams.WithImageTag(env.AgentVersion()))
}

if env.AgentJMX() {
agentOptions = append(agentOptions, dockeragentparams.WithJMX())
}

if env.AgentFIPS() {
agentOptions = append(agentOptions, dockeragentparams.WithFIPS())
}

if env.AgentUseFakeintake() {
fakeIntakeOptions := []fakeintake.Option{}

Expand Down
Loading