| Description | When installing the Lacework Agent as a sidecar to a container application that passes in a string as its entrypoint in ECS Fargate, its necessary to make changes to how this is defined in the task definition to preserve the expected string. The installation script for the Lacework Agent sidecar has been developed to operate as an entrypoint, and after execution will forward any succeeding values on to the application. However, it must be prepended to any existing value in the entrypoint field in order to do so. |
| Scope | |
| Solution |
While it's possible to define a string as the entrypoint when no other arguments are present, when there are values present for both the entrypoint and command fields, or there are multiple entries in either the entrypoint or command fields the values are interpolated into an array for execution. This is especially problematic when there are syntax sensitive strings that need to be preserved.
For example, when starting a Java application while passing debug options to the JVM: The predefined ENTRYPOINT prior to Lacework Agent Sidecar introduction:
For those unfamiliar with debugging Java applications the entire string:
...is passed to the JVM which will allow a developer to remotely attach to the JVM process using JDWP via a socket. "server=y" indicates it is a server process we are attaching to, "suspend=n" tells the java process not to wait during bootstrap for a debugger to attach to it, and "address=5005" is the debugging port the developer should open up a socket to. In this example it's necessary to preserve this string exactly as it is shown, however, when prepending this with the instruction to run the agent sidecar script the string becomes malformed in the resulting json.
MALFORMED EXAMPLESThe examples below shown below are not exhaustive of all the possible combinations, but meant to represent the most frequently tried. The described solution below is the only known workaround for this problem due to the way multiple arguments are handled by Docker since they are interpolated into an array using commas as the delimiter - attempts to escape the commas are unsuccessful also. EXAMPLE 1 ENTRYPOINT:
COMMAND: [LEFT BLANK] EXAMPLE 1 JSON RESULT
EXAMPLE 2 ENTRYPOINT:
COMMAND:
EXAMPLE 2 JSON RESULT
WorkaroundSince the JVM arguments must be preserved as a single string, it's necessary to edit the JSON in the AWS ECS Task Definition to produce the following: Step 1 ENTRYPOINT:
COMMAND:
Step 2 Having saved the task definition, from the AWS ECS console you will need to edit the json that was produced so the JVM arguments are preserved correctly in the array:
Reference LinksYou may have noticed the explicit call to use the bash shell via /bin/bash rather than the recommended default in our Lacework docs to use /bin/sh. This is intentional, Java applications use dot notated variables such as server.url, server.port for example, and these may be defined as Environment Variables in your task definition. Most shells do not handle dot notated variables and in order to preserve them you will need to use /bin/bash - you can read more about this in the article “Lacework Sidecar Agent on ECS Fargate with Dot Notated Environment Variables” |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2026 Fortinet, Inc. All Rights Reserved.