Skip to content

Commit 96f5d3f

Browse files
committed
Merge branch 'dev' of https://github.com/MaibornWolff/SecObserve into stackable
2 parents cd27e53 + 724ef3e commit 96f5d3f

23 files changed

+1132
-1769
lines changed

.github/workflows/check_vulnerabilities.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,35 @@ jobs:
1818
with:
1919
so_configuration: 'so_configuration_code.yml'
2020
SO_API_TOKEN: ${{ secrets.SO_API_TOKEN }}
21+
22+
check_code_sonarqube_backend:
23+
runs-on: ubuntu-latest
24+
steps:
25+
-
26+
name: Checkout code
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
with:
29+
fetch-depth: 0
30+
-
31+
name: Run SonarQube scan for backend
32+
uses: SonarSource/sonarqube-scan-action@v5
33+
env:
34+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
35+
with:
36+
projectBaseDir: backend
37+
38+
check_code_sonarqube_frontend:
39+
runs-on: ubuntu-latest
40+
steps:
41+
-
42+
name: Checkout code
43+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
44+
with:
45+
fetch-depth: 0
46+
-
47+
name: Run SonarQube scan for frontend
48+
uses: SonarSource/sonarqube-scan-action@v5
49+
env:
50+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FRONTEND }}
51+
with:
52+
projectBaseDir: frontend

backend/application/commons/api/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ def patch(self, request: Request, pk: int = None) -> Response: # pylint: disabl
112112
if not request_serializer.is_valid():
113113
raise ValidationError(request_serializer.errors)
114114

115+
if request_serializer.validated_data.get("feature_automatic_osv_scanning"):
116+
request_serializer.validated_data["feature_license_management"] = True
117+
115118
settings = Settings.load()
116119
request_serializer.update(settings, request_serializer.validated_data)
117120

backend/config/settings/base.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from pathlib import Path
66

77
import environ
8+
from csp.constants import NONE, SELF
89

910
from application.__init__ import __version__
1011

@@ -267,11 +268,15 @@ def whitenoise_security_headers(headers: dict, path: str, url: str) -> None:
267268
# https://docs.djangoproject.com/en/dev/ref/settings/#x-frame-options
268269
X_FRAME_OPTIONS = "DENY"
269270
# https://django-csp.readthedocs.io/en/latest/configuration.html
270-
CSP_SCRIPT_SRC = ("'self'",)
271-
CSP_OBJECT_SRC = ("'none'",)
272-
CSP_BASE_URI = ("'none'",)
273-
CSP_FRAME_ANCESTORS = ("'self'",)
274-
CSP_FORM_ACTION = ("'self'",)
271+
CONTENT_SECURITY_POLICY = {
272+
"DIRECTIVES": {
273+
"script-src": [SELF],
274+
"object-src": [NONE],
275+
"frame-ancestors": [SELF],
276+
"form-action": [SELF],
277+
"base-uri": [NONE],
278+
},
279+
}
275280
# https://docs.djangoproject.com/en/dev/ref/middleware/#http-strict-transport-security
276281
SECURE_HSTS_SECONDS = 31536000
277282
SECURE_HSTS_PRELOAD = True

backend/poetry.lock

Lines changed: 145 additions & 131 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ python = ">= 3.10, < 3.13"
1212
# Django
1313
# ------------------------------------------------------------------------------
1414
gunicorn = "23.0.0" # https://github.com/benoitc/gunicorn
15-
django = "5.1.7" # https://www.djangoproject.com/
15+
django = "5.1.8" # https://www.djangoproject.com/
1616
django-environ = "0.12.0" # https://github.com/joke2k/django-environ
1717
django-filter = "25.1" # https://github.com/carltongibson/django-filter
18-
django-csp = "3.8" # https://github.com/mozilla/django-csp
18+
django-csp = "4.0" # https://github.com/mozilla/django-csp
1919
django-picklefield = "3.3" # https://github.com/gintas/django-picklefield
2020
django-encrypted-model-fields = "0.6.5" # https://gitlab.com/lansharkconsulting/django/django-encrypted-model-fields
2121
argon2-cffi = "23.1.0" # https://github.com/hynek/argon2_cffi

backend/sonar-project.properties

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
sonar.projectKey=maibornwolff-gmbh_SecObserve_backend
2+
sonar.organization=maibornwolff-gmbh
3+
4+
5+
# This is the name and version displayed in the SonarCloud UI.
6+
sonar.projectName=SecObserve Backend
7+
#sonar.projectVersion=1.0
8+
9+
10+
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
11+
#sonar.sources=.
12+
13+
# Encoding of the source code. Default is default system encoding
14+
#sonar.sourceEncoding=UTF-8
15+
16+
sonar.python.version=3.12
17+
sonar.exclusions=**/unittests/**,**/migrations/**

docker-compose-prod-mysql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ networks:
1010
services:
1111

1212
traefik:
13-
image: "traefik:v3.3.4"
13+
image: "traefik:v3.3.5"
1414
container_name: "prod_traefik"
1515
command:
1616
- "--log.level=INFO"

docker-compose-prod-postgres.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ networks:
1010
services:
1111

1212
traefik:
13-
image: "traefik:v3.3.4"
13+
image: "traefik:v3.3.5"
1414
container_name: "prod_traefik"
1515
command:
1616
- "--log.level=INFO"

end_to_end_tests/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

end_to_end_tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
"author": "",
1010
"devDependencies": {
1111
"@playwright/test": "1.51.1",
12-
"@types/node": "22.13.14"
12+
"@types/node": "22.14.0"
1313
}
1414
}

0 commit comments

Comments
 (0)