Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
47 changes: 47 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Security

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
secret-detection:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0

- name: TruffleHog secret detection
uses: trufflesecurity/trufflehog@main
with:
extra_args: --results=verified,unknown

sast:
runs-on: ubuntu-latest
container:
image: semgrep/semgrep
steps:
- uses: actions/checkout@v6

- name: Semgrep SAST
run: semgrep scan --error --config p/python --config p/bandit --config p/secrets .

dependency-review:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v6

- name: Dependency review
uses: actions/dependency-review-action@v4
with:
fail-on-severity: high
6 changes: 4 additions & 2 deletions src/vowl/contracts/check_reference_generated.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,8 @@ def count_where(*conditions: exp.Expression) -> exp.Expression:
if pattern is None:
# Fall through to JDK format pattern (validated in __init__)
pattern = _jdk_format_to_regex(val)
assert pattern is not None # guaranteed by _validate_format
if pattern is None:
raise RuntimeError(f"_jdk_format_to_regex returned None for '{val}' — _validate_format should have rejected this")
cast_col = exp.TryCast(
this=col, to=exp.DataType.build("VARCHAR"), safe=True
)
Expand All @@ -596,7 +597,8 @@ def count_where(*conditions: exp.Expression) -> exp.Expression:

# date / timestamp / time — already validated in _validate_format
pattern = _jdk_format_to_regex(val)
assert pattern is not None # guaranteed by _validate_format
if pattern is None:
raise RuntimeError(f"_jdk_format_to_regex returned None for '{val}' — _validate_format should have rejected this")
cast_col = exp.TryCast(
this=col, to=exp.DataType.build("VARCHAR"), safe=True
)
Expand Down
2 changes: 1 addition & 1 deletion src/vowl/contracts/models/generate_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# Bandit B404: This is a trusted, repository-maintained developer utility script
# that intentionally invokes a local codegen CLI; subprocess is required here.
import subprocess # nosec B404
import subprocess # nosec B404 # nosemgrep: gitlab.bandit.B404
import sys
from pathlib import Path

Expand Down
Loading