I Tried Deploying the CrowdStrike Falcon Container Sensor on Amazon ECS on Fargate Tasks

I Tried Deploying the CrowdStrike Falcon Container Sensor on Amazon ECS on Fargate Tasks

I deployed the CrowdStrike Falcon container sensor on Amazon ECS on Fargate tasks, where sensors can't be installed on the host. This covers patching the task definition and how tasks and detections appear in the Falcon console.
2026.11.30

This page has been translated by machine translation. View original

Hello, this is Hayashi.

CrowdStrike Falcon is a security product provided by CrowdStrike.
Falcon detects and prevents attacks based on information collected by a "sensor" installed on PCs and servers.
What Falcon detects can be checked in the web management console, the "Falcon console".

https://www.crowdstrike.com/ja-jp/platform/

In environments where users manage the host, the sensor is installed on the host even when protecting containers.
With AWS Fargate, AWS manages the host, so users cannot install a sensor on the host.
For such environments, CrowdStrike provides a "container sensor" that runs inside the application container.

There are two ways to deploy the container sensor to an Amazon ECS on Fargate task.

  • Patching the task definition
  • Patching the container image

This time, I tried the method of patching the task definition.
I ran the utility included in the sensor image and checked how the task and detections appear in the Falcon console.

Test environment

Item Details
AWS region Tokyo (ap-northeast-1)
Falcon region US-2
Container sensor version 8.12.0-8207
Application container Detection Container
Fargate platform version 1.4.0
CPU architecture x86_64
Environment where Docker commands were run AWS CodeBuild

For the application container, I used the "Detection Container" published by CrowdStrike.
Detection Container repeatedly runs scripts that reproduce attack techniques at intervals of 100 to 1800 seconds.

https://github.com/CrowdStrike/detection-container

Architecture

Architecture diagram

The sensor worked with only outbound communication from the task to CrowdStrike Falcon.
The task is in a private subnet and connects to the internet via a Regional NAT Gateway.
Also, no public IP address is assigned to the task, and no inbound rules are configured in the security group.

Task definition before patching

I created the task definition based on the ECS on Fargate example (ecs-task-definition.json) in the Detection Container repository.
The changes from the example were the image, CPU architecture, task execution role, and log settings.

Here is the task definition I created.

{
  "family": "detection-container",
  "networkMode": "awsvpc",
  "requiresCompatibilities": ["FARGATE"],
  "cpu": "256",
  "memory": "512",
  "runtimePlatform": {
    "cpuArchitecture": "X86_64",
    "operatingSystemFamily": "LINUX"
  },
  "executionRoleArn": "arn:aws:iam::<アカウントID>:role/falcon-fargate-test-task-execution-role",
  "containerDefinitions": [
    {
      "name": "detection-container",
      "image": "<アカウントID>.dkr.ecr.ap-northeast-1.amazonaws.com/detection-container:20261102",
      "essential": true,
      "entryPoint": ["/entrypoint.sh"],
      "logConfiguration": {
        "logDriver": "awslogs",
        "options": {
          "awslogs-group": "/ecs/detection-container",
          "awslogs-region": "ap-northeast-1",
          "awslogs-stream-prefix": "ecs"
        }
      }
    }
  ]
}

With this task definition, I created the service detection-container in the ECS cluster falcon-fargate-test.

Steps

1. Creating an API client

The sensor image is pulled from CrowdStrike's registry.
To pull it, you need the client ID and secret of a Falcon API client.

From the Falcon console menu, I opened "Support and resources" → "Resources and tools" → "API clients and keys".
I clicked "Create API client" and entered fargate-sensor-pull as the client name.
For scopes, I selected "Read" for Falcon Images Download and Sensor Download.

In the "Create API client" dialog, Read is checked for Falcon Images Download and Sensor Download (red frame)

The client ID and secret shown at creation are used in step 2.

2. Copying the sensor image

I copied the sensor image from CrowdStrike's registry to Amazon ECR.
For the copy, I used the script falcon-container-sensor-pull.sh published by CrowdStrike.

https://github.com/CrowdStrike/falcon-scripts/tree/main/bash/containers/falcon-container-sensor-pull

I created the destination repository falcon-sensor/falcon-container in Amazon ECR beforehand.
Here are the commands to copy the sensor image.

export FALCON_CLIENT_ID=<クライアントID>
export FALCON_CLIENT_SECRET=<シークレット>

aws ecr get-login-password --region ap-northeast-1 \
  | docker login --username AWS --password-stdin <アカウントID>.dkr.ecr.ap-northeast-1.amazonaws.com

bash falcon-container-sensor-pull.sh -t falcon-container \
  --copy <アカウントID>.dkr.ecr.ap-northeast-1.amazonaws.com/falcon-sensor
  • -t falcon-container specifies the container sensor as the sensor type
  • --copy specifies the destination registry and namespace

I did not specify the sensor version or the Falcon region.
The script retrieved the latest version and detected the region automatically.

The destination became falcon-sensor/falcon-container:8.12.0-8207.

3. Patching the task definition

The sensor image includes a utility that patches task definitions.
The utility is a command-line program that starts when you run the sensor image as a container.
When you pass it the task definition JSON, the utility writes the patched JSON to standard output.

I saved the task definition before patching as spec/taskdef.json.
Here is the command to patch the task definition.

# Token for referencing the app image from Amazon ECR (base64 -w 0 is the Linux syntax)
ECR_PASSWORD=$(aws ecr get-login-password --region ap-northeast-1)
ECR_AUTH=$(printf '%s' "AWS:$ECR_PASSWORD" | base64 -w 0)
PULL_TOKEN=$(printf '%s' "{\"auths\":{\"<アカウントID>.dkr.ecr.ap-northeast-1.amazonaws.com\":{\"auth\":\"$ECR_AUTH\"}}}" | base64 -w 0)

# CID
FALCON_CID=$(bash falcon-container-sensor-pull.sh -t falcon-container --get-cid)

FALCON_IMAGE=<アカウントID>.dkr.ecr.ap-northeast-1.amazonaws.com/falcon-sensor/falcon-container:8.12.0-8207

docker run --rm -v "$PWD/spec:/var/run/spec" "$FALCON_IMAGE" \
  -cid "$FALCON_CID" \
  -image "$FALCON_IMAGE" \
  -pulltoken "$PULL_TOKEN" \
  -ecs-spec-file /var/run/spec/taskdef.json > patched.json
  • -cid specifies the Falcon CID that the sensor connects to
  • -image specifies the sensor image used by the container added by the patch
  • -pulltoken specifies the credentials for the registry that stores the app image
  • -ecs-spec-file specifies the JSON of the task definition to patch

I checked the options in the utility's help.
CID is CrowdStrike's Customer ID.
Using --get-cid of the pull script, I retrieved the CID corresponding to the API client.

Here are the changes the utility made to the task definition.

Target Change
Container Added crowdstrike-falcon-init-container, which copies the sensor files to a shared volume
Volume Added crowdstrike-falcon-volume, mounted on both containers
App entry point Changed to entrypoint-ecs.sh on the shared volume, with the original /entrypoint.sh specified as an argument
App environment variables Added FALCONCTL_OPTS with the CID set
App capabilities Added SYS_PTRACE
App startup order Set to start after crowdstrike-falcon-init-container completes

crowdstrike-falcon-init-container is an init container that starts before the app container, copies the sensor files, and then exits.

Here are the entry points of the two containers extracted from the patched task definition.

{
  "containerDefinitions": [
    {
      "name": "detection-container",
      "entryPoint": [
        "/tmp/CrowdStrike/rootfs/lib64/ld-linux-x86-64.so.2",
        "--library-path",
        "/tmp/CrowdStrike/rootfs/lib64",
        "/tmp/CrowdStrike/rootfs/bin/bash",
        "/tmp/CrowdStrike/rootfs/entrypoint-ecs.sh",
        "/entrypoint.sh"
      ]
    },
    {
      "name": "crowdstrike-falcon-init-container",
      "entryPoint": [
        "/bin/bash",
        "-c",
        "chmod u+rwx /tmp/CrowdStrike && mkdir -p /tmp/CrowdStrike/rootfs/lib  && cp -r /bin /etc /lib64 /usr /entrypoint-ecs.sh /tmp/CrowdStrike/rootfs && chmod -R a=rX /tmp/CrowdStrike"
      ]
    }
  ]
}

When I ran it without specifying -pulltoken, the utility failed because it could not retrieve the app image information from the registry.

level=error msg="Failed to retrieve image details" containerName=detection-container
level=fatal msg="Failed to run patching utility app" error="patch ECS spec file: inject to taskdefinition spec: retrieve info from registry: ... (credentials tried: 1)"

The guide CrowdStrike publishes on GitHub says -pulltoken is an option for task definitions that have no entry point or command.
In this case, it was required even for a task definition with entryPoint specified.

https://github.com/CrowdStrike/Container-Security/tree/main/aws-ecs

The token specified with -pulltoken was not included in the patched task definition.

4. Registering the task definition and updating the service

I was able to register the patched JSON as a task definition without any changes.
Here are the commands to register the task definition and update the service to the new revision.

aws ecs register-task-definition --region ap-northeast-1 \
  --cli-input-json file://patched.json

aws ecs update-service --region ap-northeast-1 \
  --cluster falcon-fargate-test --service detection-container \
  --task-definition detection-container:<リビジョン>

When I updated the service, a task with the new revision started.
In the started task, the init container completed with exit code 0 and the app container was running.
Here is the container status checked with describe-tasks of the AWS CLI.

[
  { "name": "crowdstrike-falcon-init-container", "status": "STOPPED", "exit": 0 },
  { "name": "detection-container", "status": "RUNNING", "exit": null }
]

Display in the Falcon console

The task appeared as a host in Falcon about 5 seconds after startup.
Here is the task information displayed in the Falcon console.

Item Display
Hostname ARN of the ECS task
Type Pod
OS version RHEL 9.8 (base image of Detection Container)
Sensor version 8.12.8207.0
Cloud provider AWS
Resource ID ID of the ECS task

I checked the host details on the "Asset details" screen.
In the host list under "Host setup and management", select "Asset details" from the menu at the right end of the row to open it.

In "System" of the asset details, the device type is shown as Pod and the OS version as RHEL 9.8

The "Kubernetes and containers" tab of "Asset details" has an asset graph.
In the asset graph, I could check the relationships among the task, the container image, and the source Amazon ECR.

In the asset graph, the ECS task, the container image detection-container, and the Amazon ECR image reference are shown connected by lines

Labels indicating the ECS cluster and task definition were not displayed on the "Asset details" screen.
The labels were included in the host information retrieved with falcon_search_hosts of CrowdStrike MCP.

Label Value
com.amazonaws.ecs.cluster ARN of the cluster
com.amazonaws.ecs.task-arn ARN of the task
com.amazonaws.ecs.task-definition-family detection-container
com.amazonaws.ecs.task-definition-version Revision of the task definition
com.amazonaws.ecs.container-name detection-container

When I replaced the task, the new task became a separate host.
Also, the hosts of stopped tasks remained in the host list.

Checking detections

Detections are displayed in "Endpoint detections" under "Endpoint security" → "Monitor" in the Falcon console.
It took about 1 minute from when Detection Container ran the tests until the detections appeared.

The endpoint detections list shows 5 detections with "High" severity. The names include the ARN of the ECS task

In the process tree of the detection details, you can check the parent-child relationships of processes and their command lines.
In this detection, bash launched from the web server php-fpm was executing a reverse shell.

Process tree of the detection. The task leads to bash, php-fpm, and bash in that order, and the last bash is marked as the detection

The "Action taken" in the detection details was "Policy disabled - process not killed".

Detection details. The action taken is shown as "Policy disabled - process not killed" (red frame)

In Falcon, what to detect and what to prevent is configured in a "prevention policy".
In this environment, Falcon assigned the default prevention policy to the task, and all settings in this policy were disabled.
As a result, Falcon displayed the detections but did not kill the processes.

Summary

I tried deploying the CrowdStrike Falcon container sensor to an Amazon ECS on Fargate task.

  • When you patch the task definition with the utility included in the sensor image, the sensor starts inside the application container
  • The started task appears in Falcon as a host in about 5 seconds, and the hostname is the ARN of the ECS task
  • Detection Container's tests appeared as detections in the Falcon console in about 1 minute
  • In this environment, the default prevention policy with all settings disabled was assigned to the task, and Falcon did not kill the processes

I hope this article is helpful to someone. Thank you for reading to the end!

References

https://www.crowdstrike.com/ja-jp/platform/

https://github.com/CrowdStrike/Container-Security/tree/main/aws-ecs

https://github.com/CrowdStrike/falcon-scripts/tree/main/bash/containers/falcon-container-sensor-pull

https://github.com/CrowdStrike/detection-container

https://github.com/CrowdStrike/falconutil-action

Share this article

AWSのお困り事はクラスメソッドへ