Skip to content

Commit 49e08c2

Browse files
committed
Enable FIPS mode when requested
1 parent 46cf347 commit 49e08c2

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

docs/framework-dynatrace_one_agent.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ The credential payload of the service may contain the following entries:
3030
| `environmentid` | Your Dynatrace environment ID is the unique identifier of your Dynatrace environment. You can find it in the deploy Dynatrace section within your environment.
3131
| `networkzone` | (Optional) Network zones are Dynatrace entities that represent your network structure. They help you to route the traffic efficiently, avoiding unnecessary traffic across data centers and network regions. Enter the network zone you wish to pass to the server during the OneAgent Download.
3232
| `skiperrors` | (Optional) The errors during agent download are skipped and the injection is disabled. Use this option at your own risk. Possible values are 'true' and 'false'. This option is disabled by default!
33+
| `enablefips`| (Optional) Enables the use of [FIPS 140 cryptographic algorithms](https://docs.dynatrace.com/docs/shortlink/oneagentctl#fips-140). Possible values are 'true' and 'false'. This option is disabled by default!
3334

3435
## Configuration
3536
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to [Configuration and Extension][].

lib/java_buildpack/framework/dynatrace_one_agent.rb

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ def release
7171
environment_variables = @droplet.environment_variables
7272
environment_variables.add_environment_variable(LD_PRELOAD, agent_path(manifest))
7373

74+
if enable_fips?
75+
@logger.warn { "DELETE FIPS FLAG FILE, because this is true: #{credentials[ENABLE_FIPS]}" }
76+
File.delete(@droplet.sandbox + 'agent/dt_fips_disabled.flag')
77+
end
78+
7479
dynatrace_environment_variables(manifest)
7580
end
7681

@@ -87,6 +92,8 @@ def supports?
8792

8893
APITOKEN = 'apitoken'
8994

95+
ENABLE_FIPS = 'enablefips'
96+
9097
DT_APPLICATION_ID = 'DT_APPLICATIONID'
9198

9299
DT_CONNECTION_POINT = 'DT_CONNECTION_POINT'
@@ -109,8 +116,9 @@ def supports?
109116

110117
SKIP_ERRORS = 'skiperrors'
111118

112-
private_constant :APIURL, :APITOKEN, :DT_APPLICATION_ID, :DT_CONNECTION_POINT, :DT_NETWORK_ZONE, :DT_LOGSTREAM,
113-
:DT_TENANT, :DT_TENANTTOKEN, :ENVIRONMENTID, :FILTER, :NETWORKZONE, :SKIP_ERRORS
119+
private_constant :APIURL, :APITOKEN, :ENABLE_FIPS, :DT_APPLICATION_ID, :DT_CONNECTION_POINT, :DT_NETWORK_ZONE,
120+
:DT_LOGSTREAM, :DT_TENANT, :DT_TENANTTOKEN, :LD_PRELOAD, :ENVIRONMENTID, :FILTER, :NETWORKZONE,
121+
:SKIP_ERRORS
114122

115123
def agent_download_url
116124
download_uri = "#{api_base_url(credentials)}/v1/deployment/installer/agent/unix/paas/latest?include=java" \
@@ -196,6 +204,10 @@ def skip_errors?
196204
credentials[SKIP_ERRORS].to_b
197205
end
198206

207+
def enable_fips?
208+
credentials[ENABLE_FIPS].to_b
209+
end
210+
199211
def tenanttoken(manifest)
200212
manifest['tenantToken']
201213
end

0 commit comments

Comments
 (0)