Skip to content
Open
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
37 changes: 37 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "06:00"
timezone: "Europe/Warsaw"
open-pull-requests-limit: 10
labels:
- "dependencies"
- "python"

- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "06:15"
timezone: "Europe/Warsaw"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "docker"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "06:30"
timezone: "Europe/Warsaw"
open-pull-requests-limit: 5
labels:
- "dependencies"
- "github-actions"
73 changes: 73 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CodeQL Advanced

on:
push:
branches:
- main
- master
- dev
pull_request:
branches:
- main
- master
- dev
schedule:
- cron: '23 3 * * 1'
workflow_dispatch:

permissions:
actions: read
contents: read
packages: read
security-events: write

concurrency:
group: codeql-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- language: python
build-mode: none

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-and-quality
config: |
paths-ignore:
- media/**
- '**/__pycache__/**'
- '**/*.md'

- name: Set up Python
if: matrix.language == 'python'
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install dependencies (Python)
if: matrix.language == 'python'
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: /language:${{ matrix.language }}
6 changes: 1 addition & 5 deletions core/interceptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,7 @@ class TLSContextFactory:

@classmethod
def client_context(cls, alpn: List[str] = None) -> ssl.SSLContext:
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
ctx = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
ctx.minimum_version = ssl.TLSVersion.TLSv1_2
try:
ctx.set_ciphers(cls.CIPHERS)
Expand All @@ -574,8 +572,6 @@ def client_context(cls, alpn: List[str] = None) -> ssl.SSLContext:
def server_context(cls, cert_path: str, key_path: str, alpn: List[str] = None) -> ssl.SSLContext:
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
ctx.load_cert_chain(certfile=cert_path, keyfile=key_path)
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
ctx.minimum_version = ssl.TLSVersion.TLSv1_2
try:
ctx.set_ciphers(cls.CIPHERS)
Expand Down