Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Dep-def.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sc-deployment
labels:
app: securitycheck
namespace: dev
spec:
replicas: 3
template:
metadata:
name: sc-pod
labels:
app: securitycheck
spec:
containers:
- name: sc-container
image: us-central1-docker.pkg.dev/secure-air-461520-g7/juneserver/security-playground
selector:
matchLabels:
app: securitycheck
16 changes: 16 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pipeline{
agent any
environment{
PROJECT_ID= 'secure-air-461520-g7'
REGION= 'us-central1'
REPO= 'juneserver'
}
stages{
stage('Build'){
steps{
echo 'Code is pushed'
}

}
}
}
14 changes: 14 additions & 0 deletions Loadbalancer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: sc-loadbalancer
namespace: dev
labels:
app: securitycheck
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 8081
selector:
app: securitycheck
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Deploy the docker image in your environment, and setup the probe health check to
You can also run the image locally:

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


Expand All @@ -42,13 +42,13 @@ The health check endpoint is `/health` on port `8080` and returns the `200` HTTP
You can retrieve a file's contents by sending a `GET` request to the application's URL.

```bash
$ curl <URL>:8080/<PATH>
$ curl <URL>:8081/<PATH>
```

For example:

```bash
$ curl localhost:8080/etc/shadow
$ curl localhost:8081/etc/shadow
```

This will return the content of the `/etc/shadow` file in the container running locally.
Expand All @@ -60,13 +60,13 @@ This will return the content of the `/etc/shadow` file in the container running
You can write data to a file by sending a `POST` request to the application's URL with the desired content.

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

For example:

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

This command writes the string hello-world to /bin/hello.
Expand All @@ -78,13 +78,13 @@ This command writes the string hello-world to /bin/hello.
To execute a command, send a `POST` request to the `/exec` endpoint with the command as the payload.

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

For example:

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

This will run the command and return its STDOUT output.
Empty file added resource-
Empty file.
14 changes: 14 additions & 0 deletions resource-limit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: LimitRange
metadata:
name: sc-limitrange
namespace: dev
spec:
limits:
- default:
cpu: "200m"
memory: "256Mi"
defaultRequest:
cpu: "100m"
memory: "128Mi"
type: Container
13 changes: 13 additions & 0 deletions resource-quota.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: ResourceQuota
metadata:
name: sc-resourcequota
namespace: dev
spec:
hard:
limits.cpu: "1200m"
requests.cpu: "600m"
limits.memory: "2000Mi"
requests.memory: "1000Mi"
pods: 10