Port 22 is exposed
Description
This rule detects whether port 22 is exposed in Dockerfiles. Exposing port 22 in Docker containers poses security risks by potentially allowing unauthorized users to gain SSH access. Therefore, avoid exposing port 22 and use more secure methods for managing and accessing your containers.
Code Example
dockerfile
- EXPOSE 22 + # Do not expose port 22
...Remediation
Docker
To mitigate this issue, remove any EXPOSE instructions related to port 22. Consider using more secure alternatives to SSH for managing your containers.
Example:
Rule Details
| Field | Value |
|---|---|
| ID | IAC-0834 |
| Severity | LOW |
| IaC Type | dockerfile |
| Frameworks | Docker |
| Checkov ID | CKV_DOCKER_1 |