Skip to content

Commit

Permalink
Create rule S6473: Exposing administration services is security-sensi…
Browse files Browse the repository at this point in the history
…tive (#4347)
  • Loading branch information
github-actions[bot] authored Oct 2, 2024
1 parent 686c405 commit 38ddcd3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
2 changes: 2 additions & 0 deletions rules/S6473/ansible/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
54 changes: 54 additions & 0 deletions rules/S6473/ansible/rule.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Exposing administration services can lead to unauthorized access to containers
or escalation of privilege inside of containers.

Administration services like SSH might contain vulnerabilities, hard-coded
credentials, or other security issues that increase the attack surface of a
container deployment. +
Even if the ports of the services do not get forwarded to the host system, by
default they are reachable from other containers in the same network. A
malicious actor that gets access to one container could use such services to
escalate access and privileges.

== Ask Yourself Whether

* The container starts an administration service.

There is a risk if you answered yes to the question.


== Recommended Secure Coding Practices

* Do not start SSH, VNC, RDP or similar administration services in containers.


== Sensitive Code Example

[source,yaml]
----
- name: Podman tasks
hosts: server
tasks:
- name: Start SSH server
containers.podman.podman_container:
name: container
image: lscr.io/linuxserver/openssh-server:version-9.7_p1-r4
publish:
- "22:2222" # Sensitive
----

include::../see.adoc[]


ifdef::env-github,rspecator-view[]

'''
== Implementation Specification
(visible only on this page)

include::../message.adoc[]

include::../highlighting.adoc[]

'''

endif::env-github,rspecator-view[]
2 changes: 1 addition & 1 deletion rules/S6473/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "Exposing administration services is security-sensitive",
"title": "Exposing administration services in containers is security-sensitive",
"type": "SECURITY_HOTSPOT",
"code": {
"impacts": {
Expand Down

0 comments on commit 38ddcd3

Please sign in to comment.