Repository navigation
Merge pull request #4 from mathiscapart/feat/http-honeypot-epic2 #13
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
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - prod | |
| - preprod | |
| - staging | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Lint Python code | |
| uses: astral-sh/ruff-action@v3 | |
| - name: Lint Dockerfiles | |
| uses: hadolint/hadolint-action@v3.3.0 | |
| with: | |
| recursive: true | |
| - name: Bandit | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install bandit | |
| - run: bandit -r honeypots/ pipeline/ dashboard/ -ll -ii | |
| build: | |
| needs: lint | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - image: honeypot-ftp | |
| context: ./honeypots/ftp | |
| - image: honeypot-http | |
| context: ./honeypots/http | |
| - image: honeypot-ssh | |
| context: ./honeypots/ssh | |
| - image: honeybot | |
| context: ./attacker | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: | | |
| qualite863/${{ matrix.image }} | |
| tags: | | |
| type=ref,event=branch | |
| type=raw,value=latest,enable=${{ github.ref == 'refs/heads/prod' || github.ref == 'refs/heads/main' }} | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=sha | |
| - name: Login Docker | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Set up Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build and push | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: ${{ matrix.context }} | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha,scope=${{ matrix.image }} | |
| cache-to: type=gha,mode=max,scope=${{ matrix.image }} | |
| scan: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - image: honeypot-ftp | |
| - image: honeypot-http | |
| - image: honeypot-ssh | |
| - image: honeybot | |
| steps: | |
| - uses: aquasecurity/trivy-action@master | |
| with: | |
| image-ref: "qualite863/${{ matrix.image }}:latest" | |
| format: "table" | |
| exit-code: 1 | |
| ignore-unfixed: true | |
| severity: "CRITICAL,HIGH" |