Skip to content

Commit c8ab341

Browse files
committed
CodeQL and bandit security checks (CI/CD)
1 parent 13d24c0 commit c8ab341

2 files changed

Lines changed: 61 additions & 0 deletions

File tree

.github/workflows/bandit.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Python Security Check (Bandit)
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
bandit:
9+
name: Run Bandit Security Analysis
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check out code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.12'
20+
21+
- name: Install Bandit
22+
run: pip install bandit
23+
24+
- name: Run Bandit
25+
run: |
26+
bandit -r custom_components/enpal_webparser -ll

.github/workflows/codeql.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "CodeQL Analysis"
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 3 * * 0' # optional: wöchentlicher Scan (Sonntag 03:00)
8+
9+
jobs:
10+
analyze:
11+
name: Analyze
12+
runs-on: ubuntu-latest
13+
permissions:
14+
actions: read
15+
contents: read
16+
security-events: write
17+
18+
strategy:
19+
matrix:
20+
language: [python]
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v3
25+
26+
- name: Initialize CodeQL
27+
uses: github/codeql-action/init@v3
28+
with:
29+
languages: ${{ matrix.language }}
30+
31+
- name: Autobuild
32+
uses: github/codeql-action/autobuild@v3
33+
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@v3

0 commit comments

Comments
 (0)