Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add the check for pidMode #76

Merged
merged 2 commits into from
Apr 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ The `check-ecs-exec.sh` doesn't support checking this item for shared VPC subnet
19. **🟡 Environment Variables : defined**
SSM uses the AWS SDK which uses the [default chain](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html#credentials-default) when determining authentication. This means if AWS_ACCESS_KEY, AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY are defined in the environment variables and the permissions there do not provide the required permissions for SSM to work, then the execute-command will fail. It is recomended not to define these environment variables.

20. **🟡 PidMode : task**
If you are [sharing a PID namespace in a task](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#other_task_definition_params), you can only start ECS Exec sessions into one container. See the "Considerations for using ECS Exec" in [the ECS official documentation](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html#ecs-exec-considerations) for more details.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind adding a line break back in after line 132?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ollypom -san
Thank you for pointing it out !
I added a line after line 132 so could you please review this PR again ?
Thanks !!


## Security

See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
Expand Down
11 changes: 11 additions & 0 deletions check-ecs-exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -714,4 +714,15 @@ for containerName in $containerNameList; do
idx=$((idx+1))
done

# 12. Check PID mode
pidMode=$(echo "${taskDefJson}" | jq -r ".taskDefinition.pidMode")
printf "${COLOR_DEFAULT} PidMode | "
if [[ ${pidMode} = "task" ]]; then
printf "${COLOR_YELLOW}${pidMode} \n"
elif [[ ${pidMode} = "host" ]]; then
printf "${COLOR_GREEN}${pidMode} \n"
else
printf "${COLOR_GREEN}Not Configured \n"
fi

printf "\n"