-
Notifications
You must be signed in to change notification settings - Fork 395
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
Upload dockerd socket mount detection rule and test file #3360
Conversation
|
thanks for the contribution! can you add a positive and negative test case annotation to the code? cf https://semgrep.dev/docs/writing-rules/testing-rules/ |
Done :) |
This looks good to me, thanks for the contribution! |
Hey @0xDC0DE, can we merge? |
Update the rule for checking if FEATURE_SECURE_PROCESSING is set to TRUE for DocumentBuilderFactory object.
java/lang/security/audit/xxe/documentbuilderfactory-disallow-doctype-decl-missing.yaml
Outdated
Show resolved
Hide resolved
…aml" This reverts commit c1e2281.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
to escape container and execute arbitrary commands on the host machine. | ||
languages: | ||
- dockerfile | ||
- yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0xDC0DE why we have yaml listed as a language here?
This PR adds a new rule, along with a test file, for dockerd unix socket file i.e.
docker.sock
mount detection.Description
Docker works in client-server architecture. In a normal setup,
docker
command issued in the CLI interacts with the docker server(dockerd
) using a Remote API or Unix Socket File(docker.sock
) - the latter is often encountered. However, in a scenario where an attacker breaks into the container that has/var/run/docker.sock
mounted, it can be leveraged to execute arbitrary commands on the host machine i.e. to talk back to the host machine thereby providing a way for escaping the container.Example
Here's a dummy Dockerfile that mounts docker.sock file:
Upon running Semgrep with the provided rule, this is how the output looks like:
Thanks.