Validate Expose Port 22

Description

Exposing port 22 in a Dockerfile can pose security risks by potentially allowing unauthorized access to the containerized system. This policy aims to validate whether port 22 is exposed in Dockerfiles to enhance security practices.

Kyverno policy

Refer to the Nirmata curated policies - validate-expose-port-22.

Resource example

Below is an example of a Dockerfile enforcing this policy.

FROM ubuntu:latest

EXPOSE 8080