Skip to content
Closed

Main #11826

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
6c12124
Delete README.md
usd877 Feb 14, 2025
98e4653
Create README.md
usd877 Feb 14, 2025
d092f83
Create sast.yml
usd877 Feb 14, 2025
74e6241
Update sast.yml
usd877 Feb 14, 2025
83f0045
Update sast.yml
usd877 Feb 14, 2025
025af14
Update sast.yml
usd877 Feb 14, 2025
a27bb90
Update README.md
usd877 Feb 14, 2025
e949acd
Create dast.yml
usd877 Feb 14, 2025
69816d2
Update dast.yml
usd877 Feb 14, 2025
2852e85
Update dast.yml
usd877 Feb 14, 2025
b96bed2
Update dast.yml
usd877 Feb 14, 2025
3ee7c18
Update dast.yml
usd877 Feb 14, 2025
762e796
Update dast.yml
usd877 Feb 14, 2025
7096563
Update dast.yml
usd877 Feb 14, 2025
165a7f1
Update dast.yml
usd877 Feb 14, 2025
6ad4b6f
Update dast.yml
usd877 Feb 14, 2025
be6a81b
Update dast.yml
usd877 Feb 14, 2025
de78c75
Update dast.yml
usd877 Feb 14, 2025
156128b
Update dast.yml
usd877 Feb 14, 2025
731a2e1
Update dast.yml
usd877 Feb 14, 2025
16afdc8
Update README.md
usd877 Feb 14, 2025
89e5671
Create security-checks.yml
usd877 Feb 14, 2025
e3071ac
Delete .github/workflows/security-checks.yml
usd877 Feb 14, 2025
d90e51a
Update build-docker-images-for-testing.yml
usd877 Feb 14, 2025
5e80bad
Update fetch-oas.yml
usd877 Feb 14, 2025
fb4bec4
Update unit-tests.yml
usd877 Feb 14, 2025
3c3c8b6
Update unit-tests.yml
usd877 Feb 14, 2025
c40d660
Update unit-tests.yml
usd877 Feb 14, 2025
a2b44aa
Update unit-tests.yml
usd877 Feb 14, 2025
1b8a3f3
Update unit-tests.yml
usd877 Feb 14, 2025
91faa56
Update unit-tests.yml
usd877 Feb 14, 2025
cc9b047
Update unit-tests.yml
usd877 Feb 14, 2025
b4db64d
Update unit-tests.yml
usd877 Feb 14, 2025
fefa11d
Update unit-tests.yml
usd877 Feb 14, 2025
5ed42e5
Update unit-tests.yml
usd877 Feb 14, 2025
a638648
Update unit-tests.yml
usd877 Feb 14, 2025
6c34dca
Update unit-tests.yml
usd877 Feb 14, 2025
2f6235a
Update unit-tests.yml
usd877 Feb 14, 2025
59f37b5
Update unit-tests.yml
usd877 Feb 14, 2025
013726a
Update unit-tests.yml
usd877 Feb 14, 2025
07ef80a
Update unit-tests.yml
usd877 Feb 14, 2025
35fccf4
Update unit-tests.yml
usd877 Feb 14, 2025
22ba70b
Update unit-tests.yml
usd877 Feb 14, 2025
af46aa3
Update unit-tests.yml
usd877 Feb 14, 2025
bf6c29d
Update unit-tests.yml
usd877 Feb 14, 2025
8390ada
Update unit-tests.yml
usd877 Feb 14, 2025
fdafc8d
Update unit-tests.yml
usd877 Feb 14, 2025
5025d9c
Update unit-tests.yml
usd877 Feb 14, 2025
91edc45
Create tests.py
usd877 Feb 14, 2025
99f612d
Delete .github/workflows/tests.py
usd877 Feb 14, 2025
9a46702
Update unit-tests.yml
usd877 Feb 14, 2025
face903
Create env.example
usd877 Feb 14, 2025
1049d8d
Delete env.example
usd877 Feb 14, 2025
1a8fc31
Update unit-tests.yml
usd877 Feb 14, 2025
d03e8a2
Update unit-tests.yml
usd877 Feb 14, 2025
528d541
Update README.md
usd877 Feb 14, 2025
ef51eb6
Create security-gateway.yml
usd877 Feb 14, 2025
8b9ab99
Update security-gateway.yml
usd877 Feb 14, 2025
141bd01
Update security-gateway.yml
usd877 Feb 14, 2025
184efc8
Update security-gateway.yml
usd877 Feb 14, 2025
49986cc
Update README.md
usd877 Feb 14, 2025
91e468f
Create security-checks.yml
usd877 Feb 14, 2025
01d68ff
Update pr-labeler.yml
usd877 Feb 14, 2025
03fb829
Delete .github/workflows/security-checks.yml
usd877 Feb 14, 2025
88d7d79
Update pr-labeler.yml
usd877 Feb 14, 2025
225051f
Update detect-merge-conflicts.yaml
usd877 Feb 14, 2025
f58e260
Update release-x-manual-helm-chart.yml
usd877 Feb 14, 2025
b6f72a6
Update README.md
usd877 Feb 15, 2025
0ddfdd9
Create security-checks.yml
usd877 Feb 15, 2025
416391a
Update security-checks.yml
usd877 Feb 15, 2025
b8a4382
Update README.md
usd877 Feb 15, 2025
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
19 changes: 1 addition & 18 deletions .github/workflows/build-docker-images-for-testing.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
name: "Build Docker Images For Testing"

on:
workflow_dispatch:
workflow_call:

jobs:
build:
# build with docker so we can use layer caching
name: Build Docker Images
runs-on: ubuntu-latest
strategy:
matrix:
docker-image: [django, nginx, integration-tests]
os: [alpine, debian]
exclude:
- docker-image: integration-tests
os: alpine
build-docker-images-for-testing.yml

steps:
- name: Checkout
Expand Down
77 changes: 77 additions & 0 deletions .github/workflows/dast.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: DAST Analysis with Nikto

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
dast:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

# Установка необходимых инструментов
- name: Install DAST tools
run: |
sudo apt-get update
sudo apt-get install -y nikto

# Запуск вашего приложения (если необходимо)
- name: Start application
run: |
# Здесь запустите ваше приложение локально
# Например, для Flask-приложения:
nohup python app.py > app.log 2>&1 &
echo "Waiting for the application to start..."
sleep 20 # Даем приложению время на запуск

# Проверка доступности целевого URL
- name: Check if target URL is reachable
id: url-check
run: |
if curl -s --head --fail ${{ secrets.DAST_TARGET_URL }} > /dev/null; then
echo "URL is reachable."
echo "url_reachable=true" >> $GITHUB_ENV
else
echo "Target URL is not reachable! Skipping DAST scan."
echo "url_reachable=false" >> $GITHUB_ENV
exit 0 # Продолжаем выполнение пайплайна без ошибки
fi

# Запуск Nikto для проверки веб-сервера (только если URL доступен)
- name: Run Nikto Scan
if: env.url_reachable == 'true'
run: |
mkdir -p reports
echo "Running Nikto scan on ${{ secrets.DAST_TARGET_URL }}"
nikto -host ${{ secrets.DAST_TARGET_URL }} -output reports/nikto_report.txt -Format txt || true
if [ ! -f "reports/nikto_report.txt" ]; then
echo "Nikto report not found! Creating an empty report."
echo "No issues found during Nikto scan." > reports/nikto_report.txt
fi

# Сохранение отчетов как артефактов
- name: Upload DAST reports
if: always() # Выполнить этот шаг всегда, независимо от успеха предыдущих шагов
uses: actions/upload-artifact@v4
with:
name: dast-reports
path: reports/

# Опционально: Отправка результатов в систему управления уязвимостями
- name: Send results to vulnerability management system
if: always() # Выполнить этот шаг всегда, независимо от успеха предыдущих шагов
run: |
if [ -f "reports/nikto_report.txt" ]; then
curl -X POST -H "Content-Type: multipart/form-data" \
-F "nikto=@reports/nikto_report.txt" \
${{ secrets.VULN_MANAGEMENT_API }}
else
echo "Nikto report is empty or not found! Skipping sending results."
fi
42 changes: 26 additions & 16 deletions .github/workflows/detect-merge-conflicts.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,34 @@
name: "Detect Merge Conflicts"
name: Detect Merge Conflicts

on:
workflow_dispatch:
pull_request:
branches:
- dev
- master
- bugfix
- release/*

pull_request_target:
types: [synchronize]
- main

permissions:
contents: read # Чтение содержимого репозитория
pull-requests: write # Запись в pull request для добавления комментариев

jobs:
main:
detect-conflicts:
runs-on: ubuntu-latest

steps:
- name: check if prs are conflicted
uses: eps1lon/actions-label-merge-conflict@1df065ebe6e3310545d4f4c4e862e43bdca146f0 # v3.0.3
- name: Checkout code
uses: actions/checkout@v3

- name: Check for merge conflicts
run: |
if git merge-base --is-ancestor main HEAD; then
echo "No merge conflicts detected."
else
echo "Merge conflicts detected!"
exit 1
fi

- name: Comment on PR if conflicts found
if: failure()
uses: thollander/actions-comment-pull-request@v1
with:
dirtyLabel: "conflicts-detected"
repoToken: "${{ secrets.GITHUB_TOKEN }}"
commentOnDirty: "This pull request has conflicts, please resolve those before we can evaluate the pull request."
commentOnClean: "Conflicts have been resolved. A maintainer will review the pull request shortly."
message: "Merge conflicts have been detected. Please resolve them before merging this PR."
token: ${{ secrets.GITHUB_TOKEN }}
64 changes: 17 additions & 47 deletions .github/workflows/fetch-oas.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,28 @@
name: Fetch OpenAPI Specifications

on:
workflow_call:
inputs:
version:
type: string
description: |
The version to be associated with the GitHub release that's created or updated.
This will override any version calculated by the release-drafter.
required: true
workflow_dispatch: {} # Запуск по-demand
schedule:
- cron: '0 0 * * *' # Ежедневный запуск в полночь

env:
release_version: ${{ github.event.inputs.version || github.event.inputs.release_number }}
permissions:
contents: read # Только чтение содержимого репозитория

jobs:
oas_fetch:
name: Fetch OpenAPI Specifications
fetch-oas:
runs-on: ubuntu-latest
strategy:
matrix:
file-type: [yaml, json]
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: release/${{ env.release_version }}

- name: Load docker images
run: |-
docker pull defectdojo/defectdojo-django:${{ env.release_version }}-alpine
docker pull defectdojo/defectdojo-nginx:${{ env.release_version }}-alpine
docker images

- name: Start Dojo
run: docker compose up --no-deps -d postgres nginx uwsgi
env:
DJANGO_VERSION: ${{ env.release_version }}-alpine
NGINX_VERSION: ${{ env.release_version }}-alpine

- name: Download OpenAPI Specifications
run: |-
wget 'http://localhost:8080/api/v2/oa3/schema/?format=${{ matrix.file-type }}' -O oas.${{ matrix.file-type }} --tries=10 --retry-on-http-error=502

- name: Logs
if: always()
run: docker compose logs --tail="2500"
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Shutdown
if: always()
run: docker compose down
- name: Fetch OpenAPI specs
run: |
curl -o openapi.json ${{ secrets.OPENAPI_URL }}
echo "Fetched OpenAPI specification successfully."

- name: Upload oas.${{ matrix.file-type }} as artifact
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
- name: Upload OpenAPI spec as artifact
uses: actions/upload-artifact@v4
with:
name: oas-${{ matrix.file-type }}
path: oas.${{ matrix.file-type }}
retention-days: 1
name: openapi-spec
path: openapi.json
33 changes: 21 additions & 12 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
name: PR Labeler

# run on pull_request_target because we need write access to the GItHub API
# don't run any code from PR here!
on:
pull_request_target:
types:
[opened, synchronize, reopened]
pull_request:
types: [opened, synchronize]

permissions:
contents: read # Чтение содержимого репозитория
pull-requests: write # Запись в pull request для добавления меток

jobs:
labeler:
permissions:
contents: read
pull-requests: write
name: "Autolabeler"
runs-on: ubuntu-latest

steps:
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
- name: Checkout code
uses: actions/checkout@v3

- name: Apply labels to PR
uses: actions/github-script@v6
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = ['needs-review', 'automated'];
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: labels,
});
Loading