Skip to content

Latest commit

 

History

History
90 lines (51 loc) · 2.04 KB

README.md

File metadata and controls

90 lines (51 loc) · 2.04 KB

Security Playground

last commit licence docker pulls

The security playground is an HTTP web server to simulate security breaches. It allows you to read, write, and execute commands in a containerized environment.

Build

$ docker build -t sysdiglabs/security-playground:latest .

Installation

Deploy the docker image in your environment, and setup the probe health check to the /health:8080 endpoint if required.

You can also run the image locally:

$ docker run --rm -p 8080:8080 sysdiglabs/security-playground

Usage

The application provides endpoints for:

Health checks

The health check endpoint is /health on port 8080 and returns the 200 HTTP status code.

Reading a file

You can retrieve a file's contents by sending a GET request to the application's URL.

$ curl <URL>:8080/<PATH>

For example:

$ curl localhost:8080/etc/shadow

This will return the content of the /etc/shadow file in the container running locally.

Writing a file

You can write data to a file by sending a POST request to the application's URL with the desired content.

$ curl -X POST <URL>:8080/<PATH> -d 'content=<CONTENT>'

For example:

$ curl -X POST localhost:8080/bin/hello -d 'content=hello-world'

This command writes the string hello-world to /bin/hello.

Executing a command

To execute a command, send a POST request to the /exec endpoint with the command as the payload.

$ curl -X POST <URL>:8080/exec -d 'command=<CMD>'

For example:

$ curl -X POST localhost:8080/exec -d 'command=ls'

This will run the command and return its STDOUT output.