- Newest
- Most votes
- Most comments
The AWS Inspector finding you're encountering is checking for security best practices in your ECS task definitions. Since you've already set the User parameter to "1000" in your container definition, you've actually already addressed the finding correctly.
The finding is looking for one of two conditions to be satisfied:
- Either set a non-root user (which you've done by setting User: "1000")
- OR set Privileged to true (which isn't supported in Fargate)
Since you're using Fargate as your launch type (indicated by RequiresCompatibilities: [FARGATE]), you cannot use privileged containers as you correctly noted. However, by specifying a non-root user (1000), you've already satisfied the security requirement that the finding is checking for.
The finding should be resolved once AWS Inspector re-evaluates your task definition. If the finding persists, you might need to verify that the task definition has been properly deployed and that the Inspector is evaluating the latest version of your task definition.
This approach aligns with the security best practice of running containers with the least privilege necessary, which is preferable to running containers in privileged mode anyway.
Sources
Ecs Task Definition | Amazon Q, Detector Library
ecs-task-definition-nonroot-user - AWS Config
Amazon ECS task definition parameters for Amazon EC2 - Amazon Elastic Container Service
I think AWS Inspector does not scan your task definition and instead scans your docker image in ECR. the user related definition needs to be in the dockerfile as well as shown below.
FROM public.ecr.aws/docker/library/python:3.12-slim
# Create app user
RUN groupadd -g 1000 appuser \
&& useradd -u 1000 -g 1000 -m appuser
WORKDIR /app
COPY . /app
RUN chown -R appuser:appuser /app
USER appuser
CMD ["python", "app.py"]
Relevant content
- asked 3 years ago

Even after setting User: "1000" in the task definition, the AWS Inspector finding still hasn’t cleared. I’ve already run on-demand scans three separate times, but the finding continues to appear.