Skip to main content

Install Upwind on Amazon ECS and AWS Fargate

Overview

This page provides instructions for installing the Upwind components in an ECS cluster using the AWS Fargate launch type.

Prerequisites

  1. An existing Amazon ECS cluster . To deploy one, see Getting started with Amazon ECS .
  2. Upwind Cluster Manager requires at least one private subnet with a NAT Gateway.
  3. The security group for the cluster manager must allow inbound traffic on port 8082 from all other tasks in the cluster. By default, the cluster manager will use the default security group for the VPC.

Install

Step 1: Generate Credentials

note

This step is relevant only if you want to create new client credentials. If you already have client credentials, you can skip this step.

Select the + (plus) symbol at the top of the screen and select Connect ECS Cluster. Select Generate a new one to create a new client ID and client secret. Provide a name and select Generate. Alternatively, you can generate it in the Credentials page in the console. For more information review the documentation on Credentials.

After you have generated the secret, it will automatically be copied into step 3 and inserted into the UPWIND_CLIENT_ID and UPWIND_CLIENT_SECRET fields.

Step 2: Choose ECS Cluster

Select the ECS Cluster you would like to connect.

Step 3: Choose Installation Method

Select the appropriate installation method for your environment from the available options to install the Upwind Cluster Manager and deploy the Upwind Sensor.

Step 3.1: Install the Upwind Cluster Manager

Copy the Terraform module code snippet from the Upwind Management Console and save it to a file named main.tf. Replace the placeholders with the appropriate values, either directly or by setting Terraform variables.

To install the Upwind Cluster Manager, run the following command:

terraform init && terraform apply

Step 3.2: Deploy the Upwind Sensor

Upwind provides two deployment methods: Sidecar Deployment and Embedded Deployment. Choose the method that best meets your needs and proceed with the instructions for your selected deployment method.

This approach allows monitoring of AWS Fargate containers without any modifications to the application container image.

Add the Upwind Sensor Sidecar Container

Add a new container definition for the Upwind Sensor sidecar container:

resource "aws_ecs_task_definition" "example" {
# ...

container_definitions = jsonencode([
# { ... },

{
container = {
name = "upwind-tracer"
image = "public.ecr.aws/upwindsecurity/images/tracer:0.1.1"
essential = false
}
}
])
}

For each application container, set the following sections; environment, valuesFrom, entrypoint, command, and linuxParameters:

resource "aws_ecs_task_definition" "example" {
container_definitions = jsonencode([
{
# Specify the UPWIND_TRACER_API_HOST environment variable
# to set the report forwarding destination.
environment = {
"UPWIND_TRACER_API_HOST" = "upwind-cluster-manager.upwind-<cluster-name>.private:8082",
}

# Map the tracer's container image directory into your application image.
volumesFrom = [
{
sourceContainer = "upwind-tracer"
readOnly = true
}
]

# Specify the entrypoint and command. If you already use an entrypoint,
# move it to be the first argument for the command field.
entrypoint = [
"/var/lib/upwind/upwind-tracer"
]

command = [
"/path/to/command",
"--arg1",
"--arg2",
]

# Add the SYS_PTRACE capability to allow the tracer to monitor the
# processes and connections of applications within the container,
# even if they are running under a non-root user.
linuxParameters = {
capabilities = {
add = [
"SYS_PTRACE"
],
}
}
},

# Container definition for the Upwind Tracer sidecar.
{ /* ... */ }
])
}

Apply Changes

To update the task definition, run the following command:

terraform apply

Test Connectivity

To verify the connectivity of your ECS cluster, run the following command:

aws ecs describe-services \
--cluster [your-cluster-name] \
--services upwind-sensor upwind-cluster-manager

Expected Output:

  • Ensure ServiceStatus is ACTIVE for the upwind-cluster-manager service.
  • Ensure DesiredCount and RunningCount are equal, typically set to 1, for the upwind-cluster-manager service.
  • Ensure DeploymentStatuses are PRIMARY for all deployments, and DeploymentCount match.

Troubleshooting

If you encounter any issues during the installation process, please click the chat button for live connection with an expert from Upwind.