For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/static_analysis/static_analysis_rules/docker-best-practices/expose-admin-ports.md. A documentation index is available at /llms.txt.
This product is not supported for your selected Datadog site. ().

Metadata

ID: docker-best-practices/expose-admin-ports

Language: Docker

Severity: Warning

Category: Security

CWE: 284

Description

Never expose admin ports such as the SSH port 22 in your container. It increases the surface of attack of your containers.

Non-Compliant Code Examples

FROM debian:jessie
EXPOSE 22

Compliant Code Examples

FROM debian:jessie
EXPOSE 443
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Security