-
Notifications
You must be signed in to change notification settings - Fork 508
add docker-compose dev stack, Dockerfile, scripts #2732
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
Open
kevinmuoz
wants to merge
2
commits into
kevoreilly:master
Choose a base branch
from
kevinmuoz:feat/dockerize-cape-updates
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| WEB_PORT=8000 | ||
| RESULT_PORT=2042 | ||
| PG_PORT=5432 | ||
| MONGO_PORT=27017 | ||
|
|
||
| POSTGRES_USER=cape | ||
| POSTGRES_PASSWORD=cape | ||
| POSTGRES_DB=cape |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| FROM mirror.gcr.io/library/python:3.11-bookworm | ||
|
|
||
| RUN apt-get update \ | ||
| && apt-get upgrade -y \ | ||
| && apt-get install -y --no-install-recommends git libgraphviz-dev tcpdump libcap2-bin iproute2 | ||
|
|
||
| RUN useradd -ms /bin/bash cape | ||
|
|
||
| COPY pcap.sh pcap.sh | ||
| RUN bash pcap.sh | ||
|
|
||
| COPY install.sh install.sh | ||
| RUN bash install.sh | ||
|
|
||
| WORKDIR /cape | ||
|
|
||
| RUN bash conf/copy_configs.sh | ||
| RUN chown -R cape:cape /cape | ||
|
|
||
| COPY run.sh run.sh | ||
|
|
||
| USER cape | ||
| ENTRYPOINT ["bash", "run.sh"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| services: | ||
| cape-db: | ||
| image: postgres:bookworm | ||
| hostname: cape-db | ||
| restart: always | ||
kevinmuoz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ports: | ||
| - "127.0.0.1:${PG_PORT:-5432}:5432" | ||
| environment: | ||
| POSTGRES_USER: ${POSTGRES_USER:-cape} | ||
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-cape} | ||
| POSTGRES_DB: ${POSTGRES_DB:-cape} | ||
| PGDATA: /var/lib/postgresql/data/pgdata | ||
| volumes: | ||
| - ../pg-data:/var/lib/postgresql/data | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-cape} -d ${POSTGRES_DB:-cape}"] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 10 | ||
| start_period: 30s | ||
|
|
||
|
|
||
| mongodb: | ||
| image: mongo:6 | ||
| command: ["--bind_ip_all"] | ||
| volumes: | ||
| - ../mongodata:/data/db | ||
| ports: | ||
| - "127.0.0.1:${MONGO_PORT:-27017}:27017" | ||
| restart: unless-stopped | ||
| healthcheck: | ||
| test: ["CMD", "mongosh", "--eval", "db.runCommand({ ping: 1 })"] | ||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 12 | ||
| start_period: 20s | ||
|
|
||
| cape-server: | ||
| build: ./ | ||
kevinmuoz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| hostname: cape-server | ||
| restart: unless-stopped | ||
| depends_on: | ||
| cape-db: | ||
| condition: service_healthy | ||
| mongodb: | ||
| condition: service_healthy | ||
| environment: | ||
| - WEB_PORT=${WEB_PORT:-8000} | ||
| ports: | ||
| - "127.0.0.1:${RESULT_PORT:-2042}:2042" # result server | ||
| - "127.0.0.1:${WEB_PORT:-8000}:8000" # web ui | ||
| volumes: | ||
| - ../custom:/cape/custom | ||
| - ../custom/conf:/cape/custom/conf | ||
| cap_add: | ||
| - NET_ADMIN | ||
| - NET_RAW | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| git clone https://github.com/nbdy/CAPEv2 cape | ||
kevinmuoz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| cd cape | ||
|
|
||
| bash extra/yara_installer.sh | ||
| bash extra/libvirt_installer.sh | ||
kevinmuoz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| python -m venv venv | ||
| source venv/bin/activate | ||
| pip install -r requirements.txt | ||
| pip install -r extra/optional_dependencies.txt | ||
| pip install -U flare-floss | ||
kevinmuoz marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| groupadd pcap | ||
| usermod -a -G pcap cape | ||
| chgrp pcap /usr/bin/tcpdump | ||
| setcap cap_net_raw,cap_net_admin=eip /usr/bin/tcpdump |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| source venv/bin/activate | ||
| python cuckoo.py & | ||
|
|
||
| cd web | ||
|
|
||
| : "${WEB_PORT:=8000}" | ||
|
|
||
| python manage.py migrate | ||
| python manage.py runserver 0.0.0.0:${WEB_PORT} | ||
kevinmuoz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.