Skip to content

Commit 560cc6c

Browse files
committed
Merge branch 'dev' of https://github.com/MaibornWolff/SecObserve into stackable
2 parents 0c22a40 + 260f210 commit 560cc6c

110 files changed

Lines changed: 1864 additions & 956 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_push_dev.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
steps:
2020
-
2121
name: Checkout
22-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
2323
with:
2424
persist-credentials: false
2525
-
2626
name: Set up QEMU
27-
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
27+
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
2828
-
2929
name: Set up Docker Buildx
3030
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
@@ -69,12 +69,12 @@ jobs:
6969
steps:
7070
-
7171
name: Checkout
72-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
72+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
7373
with:
7474
persist-credentials: false
7575
-
7676
name: Set up QEMU
77-
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
77+
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
7878
-
7979
name: Set up Docker Buildx
8080
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0

.github/workflows/build_push_release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ jobs:
2121
steps:
2222
-
2323
name: Checkout
24-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
2525
with:
2626
persist-credentials: false
2727
ref: 'v${{ github.event.inputs.release }}'
2828
-
2929
name: Set up QEMU
30-
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
30+
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
3131
-
3232
name: Set up Docker Buildx
3333
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
@@ -67,13 +67,13 @@ jobs:
6767
steps:
6868
-
6969
name: Checkout
70-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
70+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
7171
with:
7272
persist-credentials: false
7373
ref: 'v${{ github.event.inputs.release }}'
7474
-
7575
name: Set up QEMU
76-
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
76+
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
7777
-
7878
name: Set up Docker Buildx
7979
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
@@ -114,7 +114,7 @@ jobs:
114114
node-version: 24
115115
-
116116
name: Checkout
117-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
117+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
118118
with:
119119
ref: 'v${{ github.event.inputs.release }}'
120120
-

.github/workflows/check_backend.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
contents: read
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
1717
with:
1818
persist-credentials: false
1919
- name: Set up Python
@@ -63,7 +63,7 @@ jobs:
6363
contents: read
6464
runs-on: ubuntu-latest
6565
steps:
66-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
66+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
6767
with:
6868
persist-credentials: false
6969
- name: Unittests
@@ -89,7 +89,7 @@ jobs:
8989
runs-on: ubuntu-latest
9090
steps:
9191
- name: Checkout code
92-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
92+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
9393
with:
9494
persist-credentials: false
9595
fetch-depth: 0
@@ -98,7 +98,7 @@ jobs:
9898
with:
9999
name: coverage-report
100100
- name: Run SonarQube scan for backend
101-
uses: SonarSource/sonarqube-scan-action@7006c4492b2e0ee0f816d36501671557c97f5995 # v8
101+
uses: SonarSource/sonarqube-scan-action@713881670b6b3676cda39549040e2d88c70d582e # v8
102102
env:
103103
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_BACKEND }}
104104
with:

.github/workflows/check_frontend.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
contents: read
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
13+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
1414
with:
1515
persist-credentials: false
1616
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
@@ -37,7 +37,7 @@ jobs:
3737
contents: read
3838
runs-on: ubuntu-latest
3939
steps:
40-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
40+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
4141
with:
4242
persist-credentials: false
4343
- name: End-to-end tests
@@ -57,13 +57,13 @@ jobs:
5757
steps:
5858
-
5959
name: Checkout code
60-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
60+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
6161
with:
6262
persist-credentials: false
6363
fetch-depth: 0
6464
-
6565
name: Run SonarQube scan for frontend
66-
uses: SonarSource/sonarqube-scan-action@7006c4492b2e0ee0f816d36501671557c97f5995 # v8
66+
uses: SonarSource/sonarqube-scan-action@713881670b6b3676cda39549040e2d88c70d582e # v8
6767
env:
6868
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FRONTEND }}
6969
with:

.github/workflows/generate_sboms.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
node-version: 24
2222
-
2323
name: Checkout
24-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
24+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
2525
with:
2626
ref: 'v${{ github.event.inputs.release }}'
2727
-

.github/workflows/publish_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
permissions:
1515
contents: write
1616
steps:
17-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
1818
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1919
with:
2020
python-version: 3.x

.github/workflows/release_helm_chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
22+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
2323
with:
2424
persist-credentials: false
2525
fetch-depth: 0

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
steps:
3131
- name: "Checkout code"
32-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
3333
with:
3434
persist-credentials: false
3535

@@ -64,6 +64,6 @@ jobs:
6464

6565
# Upload the results to GitHub's code scanning dashboard.
6666
- name: "Upload to code-scanning"
67-
uses: github/codeql-action/upload-sarif@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4.36.0
67+
uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
6868
with:
6969
sarif_file: results.sarif

AGENTS.md

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# AGENTS.md
2+
3+
## Project Overview
4+
SecObserve is an open-source vulnerability management system designed for software development and cloud environments. It aggregates security findings from various tools and provides a centralized platform for managing, analyzing, and tracking vulnerabilities.
5+
6+
## Backend
7+
8+
### Tech stack
9+
10+
- **Backend**: Python 3.12+, Django 6, Django REST Framework
11+
- **Database**: Supports MySQL (via `pymysql`) and PostgreSQL (via `psycopg`)
12+
- **Task Queue**: Huey
13+
- **API Documentation**: OpenAPI 3 (via `drf-spectacular`)
14+
- **Web Server**: Gunicorn
15+
- **Package Management**: Poetry
16+
17+
### Structure
18+
19+
- `backend.application`:
20+
- `access_control`: Manages users, API tokens and authorization.
21+
- `authorization`: Implements RBAC (roles and permissions).
22+
- `background_tasks`: Functionality for tasks running in the background.
23+
- `commons`: Cross-cutting functions and data, including settings.
24+
- `constance`: Unused, is needed for a transition.
25+
- `core`: Core functionality around products and their observations.
26+
- `epss`: Enrichment of observations with Exploit Prediction Scoring System (EPSS) and exploitation data.
27+
- `import_observations`: Handles importing security observations from various parsers (e.g., Trivy, Snyk, ZAP, etc.).
28+
- `issue_tracker`: Integrates with external issue trackers (e.g., Jira, GitHub, GitLab).
29+
- `licenses`: Manages and tracks software licenses.
30+
- `metrics`: Provides metrics about observations and licenses.
31+
- `notifications`: Sends notifications to Slack, MS Teams and email for various events.
32+
- `rules`: Implements rules to automatically amend status, severity and priority of observations.
33+
- `vex`: Import and export of Vulnerability Exploitability eXchange (VEX) information.
34+
- `backend.config`: Configurations
35+
- `backend.templates`: Fixed content
36+
37+
### Unit tests
38+
39+
- Stored under `backend.unittests` with same structure as `application`
40+
- Test classes derived from `unittests.base_test_case.BaseTestCase`
41+
- Use `@patch` annotation for mocks
42+
43+
### Development Workflow
44+
45+
### Prerequisites
46+
47+
- Python 3.12+
48+
- Poetry for dependency management
49+
50+
#### Setup and Running
51+
52+
- **Install dependencies**:
53+
54+
```bash
55+
poetry install
56+
```
57+
- **Start development server** (including frontend):
58+
59+
```bash
60+
./bin/dev.sh
61+
```
62+
63+
#### Testing
64+
65+
- **Unit tests**:
66+
```bash
67+
./bin/unittests.sh
68+
```
69+
- **Code Quality**:
70+
```bash
71+
cd backend
72+
73+
# Formatting
74+
black .
75+
isort.
76+
77+
# Linting
78+
flake8
79+
./bin/run_pylint.sh
80+
81+
# Type Checking
82+
./bin/run_mypy.sh
83+
```
84+
85+
### Key Patterns
86+
87+
- **Service Layer**: Business logic should reside in `application.<app_name>.services`.
88+
- **API Layer**: REST endpoints are defined in `application.<app_name>.api`.
89+
- **Query Layer**: Database queries are abstracted in `application.<app_name>.queries`.
90+
- **Parsers**: Import logic for external tools is located in `application.import_observations.parsers`.
91+
92+
### Coding Standards
93+
94+
- **Line Length**: 120 characters (configured via `black`).
95+
- **Type Hinting**: Strongly encouraged throughout the codebase.
96+
- **Documentation**: Use docstrings for complex logic; otherwise, keep code self-documenting with clear identifiers.
97+
98+
## Frontend
99+
100+
### Tech Stack
101+
- **Framework**: React 19 with TypeScript
102+
- **UI Library**: Material-UI 7 with ECharts integration
103+
- **Admin Panel**: react-admin 5 (CRUD interfaces for data management)
104+
- **Build Tool**: Vite
105+
- **Styling**: Emotion (CSS-in-JS)
106+
- **Charts**: Chart.js with react-chartjs-2
107+
- **Markdown**: MDXEditor, marked, markdown-to-jsx
108+
- **Diagrams**: Mermaid
109+
- **Authentication**: OIDC (via `react-oidc-context` and `oidc-client-ts`)
110+
- **Package Management**: npm
111+
112+
### Structure
113+
- `frontend/src/`:
114+
- `access_control`: Manages users, API tokens and authorization.
115+
- `background_tasks`: Functionality for tasks running in the background.
116+
- `commons/`: Shared components, layout, and utilities
117+
- `layout/`: Main Layout, SubMenu, ListHeader
118+
- `custom_fields/`: Reusable field components
119+
- `settings/`: Application settings UI
120+
- `core`: Core functionality around products and their observations.
121+
- `dashboard`: Dashboard showing different metrics.
122+
- `import_observations`: Handles importing security observations from various parsers (e.g., Trivy, Snyk, ZAP, etc.).
123+
- `licenses`: Manages and tracks software licenses.
124+
- `metrics`: Provides metrics about observations and licenses.
125+
- `notifications`: Sends notifications to Slack, MS Teams and email for various events.
126+
- `rules`: Implements rules to automatically amend status, severity and priority of observations.
127+
- `types`: Declaration of environment variables.
128+
- `vex`: Import and export of Vulnerability Exploitability eXchange (VEX) information.
129+
130+
### Key Patterns
131+
- **Pages**: List, Show, Create, and Edit components for each entity (aligned with react-admin patterns).
132+
- **Runtime Config**: `runtime-env-cra` library injects environment variables at build time.
133+
134+
### Development Workflow
135+
136+
#### Prerequisites
137+
- Node.js (compatible with Vite 8)
138+
139+
#### Setup and Running
140+
1. **Install dependencies**:
141+
```bash
142+
cd frontend
143+
npm install
144+
```
145+
2. **Start development server**:
146+
```bash
147+
npm start
148+
```
149+
3. **Build for production**:
150+
```bash
151+
npm run build
152+
```
153+
154+
#### Code Quality
155+
```bash
156+
# Linting
157+
npm run lint
158+
159+
# Formatting and import sorting (Prettier)
160+
prettier -w src
161+
```
162+
163+
### Coding Standards
164+
- **Line Length**: 120 characters (configured via `.prettierrc.json`).
165+
- **TypeScript**: Strict mode enabled; all components should be fully typed.
166+
- **Component Style**: Functional components with hooks; no class components.

backend/application/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "1.53.0"
1+
__version__ = "1.54.0"
22

33
import pymysql
44

0 commit comments

Comments
 (0)