-
Notifications
You must be signed in to change notification settings - Fork 1
feat: implement advanced dashboard enhancements and devops automation #2
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
base: master
Are you sure you want to change the base?
Changes from all commits
c72ede9
c899841
a1b42d9
7b9172b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: CI/CD Pipeline | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main, master] | ||
| pull_request: | ||
| branches: [main, master] | ||
| repository_dispatch: | ||
| types: [manual-trigger] | ||
|
|
||
| jobs: | ||
| lint-and-test: | ||
| name: Lint and Test | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
| cache: 'pip' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install flake8 pytest | ||
| make install | ||
|
|
||
| - name: Check Integrity Hashes | ||
| run: make check-hashes | ||
|
|
||
| - name: Run Linting | ||
| run: make lint | ||
|
|
||
| - name: Run Tests | ||
| run: make test | ||
|
|
||
| - name: Validate Docker Compose | ||
| run: docker compose config | ||
|
|
||
| build-docker: | ||
| name: Build Docker Image | ||
| needs: lint-and-test | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') | ||
| steps: | ||
| - name: Checkout Code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build and Load Docker Image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: . | ||
| load: true | ||
| tags: cyberpot-attack-map:latest | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| name: Docker | ||
|
|
||
| # This workflow uses actions that are not certified by GitHub. | ||
| # They are provided by a third-party and are governed by | ||
| # separate terms of service, privacy policy, and support | ||
| # documentation. | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: '43 17 * * *' | ||
| push: | ||
| branches: [ "3.0.0" ] | ||
| # Publish semver tags as releases. | ||
| tags: [ 'v*.*.*' ] | ||
| pull_request: | ||
| branches: [ "3.0.0" ] | ||
|
|
||
| env: | ||
| # Use docker.io for Docker Hub if empty | ||
| REGISTRY: ghcr.io | ||
| # github.repository as <account>/<repo> | ||
| IMAGE_NAME: ${{ github.repository }} | ||
|
|
||
|
|
||
| jobs: | ||
| build: | ||
|
|
||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| # This is used to complete the identity challenge | ||
| # with sigstore/fulcio when running outside of PRs. | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # Install the cosign tool except on PR | ||
| # https://github.com/sigstore/cosign-installer | ||
| - name: Install cosign | ||
| if: github.event_name != 'pull_request' | ||
| uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0 | ||
| with: | ||
| cosign-release: 'v2.2.4' | ||
|
|
||
| # Set up BuildKit Docker container builder to be able to build | ||
| # multi-platform images and export cache | ||
| # https://github.com/docker/setup-buildx-action | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 | ||
|
|
||
| # Login against a Docker registry except on PR | ||
| # https://github.com/docker/login-action | ||
| - name: Log into registry ${{ env.REGISTRY }} | ||
| if: github.event_name != 'pull_request' | ||
| uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| # Extract metadata (tags, labels) for Docker | ||
| # https://github.com/docker/metadata-action | ||
| - name: Extract Docker metadata | ||
| id: meta | ||
| uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 | ||
| with: | ||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
|
||
| # Build and push Docker image with Buildx (don't push on PR) | ||
| # https://github.com/docker/build-push-action | ||
| - name: Build and push Docker image | ||
| id: build-and-push | ||
| uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 | ||
| with: | ||
| context: . | ||
| push: ${{ github.event_name != 'pull_request' }} | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
|
|
||
| # Sign the resulting Docker image digest except on PRs. | ||
| # This will only write to the public Rekor transparency log when the Docker | ||
| # repository is public to avoid leaking data. If you would like to publish | ||
| # transparency data even for private images, pass --force to cosign below. | ||
| # https://github.com/sigstore/cosign | ||
| - name: Sign the published Docker image | ||
| if: ${{ github.event_name != 'pull_request' }} | ||
| env: | ||
| # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable | ||
| TAGS: ${{ steps.meta.outputs.tags }} | ||
| DIGEST: ${{ steps.build-and-push.outputs.digest }} | ||
| # This step uses the identity token to provision an ephemeral certificate | ||
| # against the sigstore community Fulcio instance. | ||
| run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Use an official Python runtime as a parent image | ||
| FROM python:3.10-slim | ||
|
|
||
| # Set environment variables | ||
| ENV PYTHONDONTWRITEBYTECODE 1 | ||
| ENV PYTHONUNBUFFERED 1 | ||
|
|
||
| # Set the working directory in the container | ||
| WORKDIR /app | ||
|
|
||
| # Install system dependencies | ||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| build-essential \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Install Python dependencies | ||
| COPY requirements.txt . | ||
| RUN pip install --no-cache-dir -r requirements.txt | ||
|
|
||
| # Copy the rest of the application code | ||
| COPY . . | ||
|
|
||
| # Expose the web server port | ||
| EXPOSE 64299 | ||
|
|
||
| # Default command (can be overridden to run DataServer.py) | ||
| CMD ["python", "AttackMapServer.py"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| version: '3.8' | ||
|
|
||
| services: | ||
| attack-map-server: | ||
| build: . | ||
| image: cyberpot-attack-map:latest | ||
| ports: | ||
| - "64299:64299" | ||
| depends_on: | ||
| - map_redis | ||
| environment: | ||
| - CYBERPOT_ATTACKMAP_TEXT=ENABLED | ||
| - MAP_REDIS_URL=redis://map_redis:6379 | ||
| networks: | ||
| - attack-map-net | ||
| command: python AttackMapServer.py | ||
|
|
||
| data-server: | ||
| build: . | ||
| image: cyberpot-attack-map:latest | ||
| depends_on: | ||
| - map_redis | ||
| - elasticsearch | ||
| environment: | ||
| - CYBERPOT_ATTACKMAP_TEXT=ENABLED | ||
| - MAP_REDIS_HOST=map_redis | ||
| - MAP_ES_URL=http://elasticsearch:9200 | ||
| networks: | ||
| - attack-map-net | ||
| command: python DataServer.py | ||
|
|
||
| map_redis: | ||
| image: redis:7-alpine | ||
| networks: | ||
| - attack-map-net | ||
|
|
||
| # Assuming Elasticsearch is provided externally or defined here | ||
| elasticsearch: | ||
| image: docker.elastic.co/elasticsearch/elasticsearch:8.18.1 | ||
| environment: | ||
| - discovery.type=single-node | ||
| - xpack.security.enabled=false | ||
| networks: | ||
| - attack-map-net | ||
|
Comment on lines
+37
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: As of January 15, 2026 the latest Elasticsearch 8.x release is 8.19.9. [1][2] Sources:
Update Elasticsearch version and address security/persistence concerns.
Consider updating the version, and for persistence add a volume mount. Document these limitations if they are intentional for non-production use. 🤖 Prompt for AI Agents |
||
|
|
||
| networks: | ||
| attack-map-net: | ||
| driver: bridge | ||
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.
🧩 Analysis chain
🏁 Script executed:
Repository: khulnasoft/cyberpot-attack-map
Length of output: 448
Update cosign-installer and cosign to current versions.
The workflow uses
cosign-installer@v3.5.0andcosign-release: v2.2.4, both of which are significantly outdated. Latest available versions arecosign-installer@v4.0.0(orv3.10.1for v3 branch) andcosign@v3.0.4(orv2.6.2for v2 branch). Supply-chain security tools should be kept current to benefit from security fixes and improvements. Consider updating to at least v3.10.1+ and v2.6.2+ respectively.🤖 Prompt for AI Agents