mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-11-20 15:52:12 +01:00
ci: signed release provenance, pinned dependencies, security scanning
- Release files get a SHA256SUMS file and a Sigstore-signed build provenance attestation (gh attestation verify). - The workflows read the repo only. A new release job, which runs no build tools, is the only one that can write: it uploads the files with gh and pushes the version bump. The third-party release actions are gone. - Every action is pinned to a commit SHA, esptool and the libraries to exact versions. The release tag reaches the shell through env, and set_version.sh rejects tags that aren't versions. - New workflows: CodeQL (C++ via the native build, JS, Python, Actions), OpenSSF Scorecard, zizmor. Dependabot moves the action pins. - SECURITY.md: private reporting, checking a download. README badges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8c7a2dee12
commit
5c57d1a2cd
9 changed files with 306 additions and 77 deletions
14
.github/dependabot.yml
vendored
Normal file
14
.github/dependabot.yml
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
# The workflows' actions are pinned to commit SHAs; Dependabot moves the pins.
|
||||||
|
# PlatformIO libraries aren't covered: bump lib_deps in platformio.ini by hand.
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: github-actions
|
||||||
|
directory: /
|
||||||
|
schedule:
|
||||||
|
interval: weekly
|
||||||
|
# A week for a hijacked release to be caught before it lands here.
|
||||||
|
cooldown:
|
||||||
|
default-days: 7
|
||||||
|
groups:
|
||||||
|
actions:
|
||||||
|
patterns: ["*"]
|
||||||
17
.github/set_version.sh
vendored
Normal file
17
.github/set_version.sh
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Writes a release's version into the sources: bash .github/set_version.sh v4.0.1
|
||||||
|
# The build jobs build with it, the release job commits it.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
VERSION="${1#v}"
|
||||||
|
# The version goes into sed replacements and into the firmware, so only
|
||||||
|
# digits, letters, dots and dashes: 4.0.1, 4.0.0.beta, 4.1.0-rc1.
|
||||||
|
if [[ ! "$VERSION" =~ ^[0-9]+(\.[0-9A-Za-z-]+)*$ ]]; then
|
||||||
|
echo "Not a version: $1" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed -i "s/#define FW_VERSION \"v[0-9.]*\"/#define FW_VERSION \"v${VERSION}\"/" src/ConfigSettings.h
|
||||||
|
sed -i "s/^[0-9.].*/${VERSION}/" data-src/appversion
|
||||||
|
sed -i "s/\?v=[0-9.]*c/?v=${VERSION}c/g" data-src/index.html
|
||||||
|
sed -i "s/appVersion = 'v[0-9.]*'/appVersion = 'v${VERSION}'/" data-src/index.js
|
||||||
167
.github/workflows/build.yaml
vendored
167
.github/workflows/build.yaml
vendored
|
|
@ -7,6 +7,10 @@ on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
|
# Read-only unless a job asks for more.
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Unit tests
|
name: Unit tests
|
||||||
|
|
@ -14,10 +18,12 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
|
|
||||||
|
|
@ -40,7 +46,7 @@ jobs:
|
||||||
--markdown "$GITHUB_STEP_SUMMARY" --markdown-title "Native tests coverage"
|
--markdown "$GITHUB_STEP_SUMMARY" --markdown-title "Native tests coverage"
|
||||||
|
|
||||||
- name: Upload coverage report
|
- name: Upload coverage report
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: coverage-cpp
|
name: coverage-cpp
|
||||||
path: coverage/
|
path: coverage/
|
||||||
|
|
@ -52,12 +58,16 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
|
||||||
with:
|
with:
|
||||||
node-version: "22"
|
node-version: "22"
|
||||||
|
# No cache: a release build must not pick up what a PR left in one.
|
||||||
|
package-manager-cache: false
|
||||||
|
|
||||||
# The protocol 2 client (data-src/js) against the recorded fixtures.
|
# The protocol 2 client (data-src/js) against the recorded fixtures.
|
||||||
# Coverage: a table in the log, and lcov for the HTML report.
|
# Coverage: a table in the log, and lcov for the HTML report.
|
||||||
|
|
@ -78,7 +88,7 @@ jobs:
|
||||||
--title "ESPSomfy-RTS web UI tests"
|
--title "ESPSomfy-RTS web UI tests"
|
||||||
|
|
||||||
- name: Upload coverage report
|
- name: Upload coverage report
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: coverage-js
|
name: coverage-js
|
||||||
path: coverage/html/
|
path: coverage/html/
|
||||||
|
|
@ -103,13 +113,13 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download native tests coverage
|
- name: Download native tests coverage
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||||
with:
|
with:
|
||||||
name: coverage-cpp
|
name: coverage-cpp
|
||||||
path: site/cpp
|
path: site/cpp
|
||||||
|
|
||||||
- name: Download web UI tests coverage
|
- name: Download web UI tests coverage
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||||
with:
|
with:
|
||||||
name: coverage-js
|
name: coverage-js
|
||||||
path: site/js
|
path: site/js
|
||||||
|
|
@ -129,18 +139,17 @@ jobs:
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Upload site
|
- name: Upload site
|
||||||
uses: actions/upload-pages-artifact@v3
|
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
|
||||||
with:
|
with:
|
||||||
path: site
|
path: site
|
||||||
|
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
id: deploy
|
id: deploy
|
||||||
uses: actions/deploy-pages@v4
|
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
|
||||||
|
|
||||||
build:
|
build:
|
||||||
# Don't build or publish firmware that fails its tests.
|
# Don't build or publish firmware that fails its tests.
|
||||||
needs: [test, webui]
|
needs: [test, webui]
|
||||||
permissions: write-all
|
|
||||||
name: ${{ matrix.name }}
|
name: ${{ matrix.name }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
|
@ -220,42 +229,25 @@ jobs:
|
||||||
obname: SomfyController.onboard.esp32p4es.bin
|
obname: SomfyController.onboard.esp32p4es.bin
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Get Release
|
|
||||||
if: github.event_name == 'release'
|
|
||||||
id: get_release
|
|
||||||
uses: bruceadams/get-release@v1.3.2
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
# The release job commits the same change once all the builds pass.
|
||||||
- name: Update version from release tag
|
- name: Update version from release tag
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
run: |
|
env:
|
||||||
VERSION="${{ github.event.release.tag_name }}"
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
VERSION="${VERSION#v}"
|
run: bash .github/set_version.sh "$TAG"
|
||||||
sed -i "s/#define FW_VERSION \"v[0-9.]*\"/#define FW_VERSION \"v${VERSION}\"/" src/ConfigSettings.h
|
|
||||||
sed -i "s/^[0-9.].*/${VERSION}/" data-src/appversion
|
|
||||||
sed -i "s/\?v=[0-9.]*c/?v=${VERSION}c/g" data-src/index.html
|
|
||||||
sed -i "s/appVersion = 'v[0-9.]*'/appVersion = 'v${VERSION}'/" data-src/index.js
|
|
||||||
|
|
||||||
- name: Commit version update
|
|
||||||
if: github.event_name == 'release' && matrix.env == 'esp32dev'
|
|
||||||
run: |
|
|
||||||
git config user.name "github-actions[bot]"
|
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git add src/ConfigSettings.h data-src/appversion data-src/index.html data-src/index.js
|
|
||||||
git commit -m "chore: bump version to ${{ github.event.release.tag_name }}"
|
|
||||||
git push origin HEAD:${{ github.event.release.target_commitish }}
|
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
|
|
||||||
- name: Install PlatformIO and esptool
|
- name: Install PlatformIO and esptool
|
||||||
run: pip install pioarduino==6.2.0 esptool
|
run: pip install pioarduino==6.2.0 esptool==5.4.0
|
||||||
|
|
||||||
- name: Build LittleFS image
|
- name: Build LittleFS image
|
||||||
run: pio run -e ${{ matrix.env }} -t buildfs
|
run: pio run -e ${{ matrix.env }} -t buildfs
|
||||||
|
|
@ -299,7 +291,7 @@ jobs:
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
if: github.event_name != 'release'
|
if: github.event_name != 'release'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.name }}
|
name: ${{ matrix.name }}
|
||||||
path: |
|
path: |
|
||||||
|
|
@ -311,44 +303,77 @@ jobs:
|
||||||
${{ matrix.obname }}.zip
|
${{ matrix.obname }}.zip
|
||||||
retention-days: 5
|
retention-days: 5
|
||||||
|
|
||||||
- name: Upload LittleFS
|
# Under their release names, for the release job.
|
||||||
|
- name: Collect release files
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
uses: shogo82148/actions-upload-release-asset@v1.7.5
|
run: |
|
||||||
with:
|
mkdir release
|
||||||
github_token: ${{ github.token }}
|
cp .pio/build/${{ matrix.env }}/littlefs.bin release/${{ matrix.fsname }}
|
||||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
cp .pio/build/${{ matrix.env }}/firmware.bin release/${{ matrix.fwname }}
|
||||||
asset_name: ${{ matrix.fsname }}
|
cp ${{ matrix.obname }}.zip ${{ matrix.elfname }}.zip release/
|
||||||
asset_path: .pio/build/${{ matrix.env }}/littlefs.bin
|
|
||||||
overwrite: true
|
|
||||||
|
|
||||||
- name: Upload firmware
|
- name: Upload release files
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
uses: shogo82148/actions-upload-release-asset@v1.7.5
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||||
with:
|
with:
|
||||||
github_token: ${{ github.token }}
|
name: release-${{ matrix.env }}
|
||||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
path: release/
|
||||||
asset_name: ${{ matrix.fwname }}
|
retention-days: 1
|
||||||
asset_path: .pio/build/${{ matrix.env }}/firmware.bin
|
|
||||||
overwrite: true
|
|
||||||
|
|
||||||
- name: Upload onboard image
|
# The only job that can write to the repo, and it runs no build tools: the
|
||||||
|
# builds above can't touch the release, this job only adds their files to it.
|
||||||
|
release:
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
uses: shogo82148/actions-upload-release-asset@v1.7.5
|
needs: build
|
||||||
with:
|
name: Publish release
|
||||||
github_token: ${{ github.token }}
|
runs-on: ubuntu-latest
|
||||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
permissions:
|
||||||
asset_name: ${{ matrix.obname }}.zip
|
contents: write # the release's files, the version bump commit
|
||||||
asset_path: ${{ matrix.obname }}.zip
|
id-token: write # Sigstore signs the attestations
|
||||||
overwrite: true
|
attestations: write
|
||||||
asset_content_type: application/zip
|
|
||||||
|
|
||||||
- name: Upload ELF
|
steps:
|
||||||
if: github.event_name == 'release'
|
- name: Download release files
|
||||||
uses: shogo82148/actions-upload-release-asset@v1.7.5
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
||||||
with:
|
with:
|
||||||
github_token: ${{ github.token }}
|
pattern: release-*
|
||||||
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
path: dist
|
||||||
asset_name: ${{ matrix.elfname }}.zip
|
merge-multiple: true
|
||||||
asset_path: ${{ matrix.elfname }}.zip
|
|
||||||
overwrite: true
|
- name: Checksums
|
||||||
asset_content_type: application/zip
|
working-directory: dist
|
||||||
|
run: |
|
||||||
|
sha256sum * > SHA256SUMS
|
||||||
|
cat SHA256SUMS
|
||||||
|
|
||||||
|
# Signed statements that this workflow built each file from this commit:
|
||||||
|
# gh attestation verify <file> --repo cjkas/ESPSomfy-RTS
|
||||||
|
- name: Attest build provenance
|
||||||
|
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2
|
||||||
|
with:
|
||||||
|
subject-path: |
|
||||||
|
dist/*.bin
|
||||||
|
dist/*.zip
|
||||||
|
|
||||||
|
- name: Upload to the release
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
run: gh release upload "$TAG" dist/* --clobber --repo "$GITHUB_REPOSITORY"
|
||||||
|
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
||||||
|
with:
|
||||||
|
persist-credentials: true # pushes the version bump
|
||||||
|
|
||||||
|
- name: Commit version update
|
||||||
|
env:
|
||||||
|
TAG: ${{ github.event.release.tag_name }}
|
||||||
|
TARGET: ${{ github.event.release.target_commitish }}
|
||||||
|
run: |
|
||||||
|
bash .github/set_version.sh "$TAG"
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add src/ConfigSettings.h data-src/appversion data-src/index.html data-src/index.js
|
||||||
|
git commit -m "chore: bump version to $TAG"
|
||||||
|
git push origin "HEAD:$TARGET"
|
||||||
|
|
|
||||||
66
.github/workflows/codeql.yml
vendored
Normal file
66
.github/workflows/codeql.yml
vendored
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
name: CodeQL
|
||||||
|
|
||||||
|
# Static analysis for security bugs. Findings go to the repo's
|
||||||
|
# Security > Code scanning page and onto the PR's diff.
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
schedule:
|
||||||
|
- cron: "17 3 * * 1"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analyze:
|
||||||
|
name: Analyze (${{ matrix.language }})
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
# The C++ is what the native env builds: the protocol, the config
|
||||||
|
# records, MQTT, the radio frames. The rest needs the ESP32 toolchain,
|
||||||
|
# which CodeQL doesn't trace.
|
||||||
|
- language: c-cpp
|
||||||
|
build-mode: manual
|
||||||
|
- language: javascript-typescript
|
||||||
|
build-mode: none
|
||||||
|
- language: python
|
||||||
|
build-mode: none
|
||||||
|
- language: actions
|
||||||
|
build-mode: none
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Initialize CodeQL
|
||||||
|
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
|
||||||
|
with:
|
||||||
|
languages: ${{ matrix.language }}
|
||||||
|
build-mode: ${{ matrix.build-mode }}
|
||||||
|
queries: security-and-quality
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
if: matrix.language == 'c-cpp'
|
||||||
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
||||||
|
with:
|
||||||
|
python-version: "3.12"
|
||||||
|
|
||||||
|
- name: Build the native tests
|
||||||
|
if: matrix.language == 'c-cpp'
|
||||||
|
run: |
|
||||||
|
pip install pioarduino==6.2.0
|
||||||
|
pio test -e native --without-testing
|
||||||
|
|
||||||
|
- name: Analyze
|
||||||
|
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
|
||||||
|
with:
|
||||||
|
category: /language:${{ matrix.language }}
|
||||||
39
.github/workflows/scorecard.yml
vendored
Normal file
39
.github/workflows/scorecard.yml
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
name: Scorecard
|
||||||
|
|
||||||
|
# OpenSSF Scorecard: rates the repo's supply chain practices (pinned
|
||||||
|
# dependencies, token permissions, branch protection, code review, ...).
|
||||||
|
# Results go to Security > Code scanning and to the README badge.
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
branch_protection_rule:
|
||||||
|
schedule:
|
||||||
|
- cron: "41 4 * * 1"
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
analysis:
|
||||||
|
name: Scorecard analysis
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
security-events: write # the results to code scanning
|
||||||
|
id-token: write # publishing the results for the badge
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Run analysis
|
||||||
|
uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
|
||||||
|
with:
|
||||||
|
results_file: results.sarif
|
||||||
|
results_format: sarif
|
||||||
|
publish_results: true
|
||||||
|
|
||||||
|
- name: Upload to code scanning
|
||||||
|
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
|
||||||
|
with:
|
||||||
|
sarif_file: results.sarif
|
||||||
29
.github/workflows/zizmor.yml
vendored
Normal file
29
.github/workflows/zizmor.yml
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
name: zizmor
|
||||||
|
|
||||||
|
# Lints the workflows for security problems: unpinned actions, broad token
|
||||||
|
# permissions, template injection. Findings go to Security > Code scanning.
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- ".github/**"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
zizmor:
|
||||||
|
name: Workflow security
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
security-events: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Check out code
|
||||||
|
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Run zizmor
|
||||||
|
uses: zizmorcore/zizmor-action@53290badfa369cb0bf7ad16342cb62c2fa47ac7b # v0.8.0
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
[](https://github.com/cjkas/ESPSomfy-RTS/actions/workflows/build.yaml) [](https://github.com/cjkas/ESPSomfy-RTS/actions/workflows/codeql.yml) [](https://scorecard.dev/viewer/?uri=github.com/cjkas/ESPSomfy-RTS)
|
||||||
|
|
||||||
## This is a fork which was created because the original repo seems to be bandoned and I was annoyed by constant restarts of my ESPSomfy. I've fixed some of the major issues caused by watchdog restarts. There are also compiled binaries in my fork if someone is experiencing same issues
|
## This is a fork which was created because the original repo seems to be bandoned and I was annoyed by constant restarts of my ESPSomfy. I've fixed some of the major issues caused by watchdog restarts. There are also compiled binaries in my fork if someone is experiencing same issues
|
||||||
|
|
||||||
* Fixed a lot of bugs causing constant restarts by migrating to AsyncWebServer and AsyncSockets
|
* Fixed a lot of bugs causing constant restarts by migrating to AsyncWebServer and AsyncSockets
|
||||||
|
|
|
||||||
35
SECURITY.md
Normal file
35
SECURITY.md
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
# Security
|
||||||
|
|
||||||
|
## Reporting a vulnerability
|
||||||
|
|
||||||
|
Please don't open a public issue. Report it privately through [GitHub's vulnerability reporting](https://github.com/cjkas/ESPSomfy-RTS/security/advisories/new) and give the firmware version, the board, and the steps to reproduce it.
|
||||||
|
|
||||||
|
Fixes go into the latest release only, so check that the problem is still there in it.
|
||||||
|
|
||||||
|
The Home Assistant integration has [its own repo](https://github.com/cjkas/ESPSomfy-RTS-HA) and its own reporting page.
|
||||||
|
|
||||||
|
## What the device protects against
|
||||||
|
|
||||||
|
The device is meant for a local network. In the Secured mode every route and the socket need a login. The threat model, what is in scope and what isn't, is in [docs/SECURITY_PLAN.md](docs/SECURITY_PLAN.md) and [ADR 0006](docs/adr/0006-two-security-modes-eleven-http-routes.md). Don't expose the device to the internet.
|
||||||
|
|
||||||
|
## Checking a download
|
||||||
|
|
||||||
|
Each release file (`.bin`, `.zip`) comes with a signed attestation that this repo's [build workflow](.github/workflows/build.yaml) built it from the release's commit. Check one with the [GitHub CLI](https://cli.github.com/):
|
||||||
|
|
||||||
|
```
|
||||||
|
gh attestation verify SomfyController.ino.esp32.bin --repo cjkas/ESPSomfy-RTS
|
||||||
|
```
|
||||||
|
|
||||||
|
Or compare the checksums with the release's `SHA256SUMS` file:
|
||||||
|
|
||||||
|
```
|
||||||
|
sha256sum --check --ignore-missing SHA256SUMS
|
||||||
|
```
|
||||||
|
|
||||||
|
Releases before 4.0.2 have neither.
|
||||||
|
|
||||||
|
## How the build is kept clean
|
||||||
|
|
||||||
|
- Every action in the workflows is pinned to a commit, and libraries to exact versions. Dependabot proposes action updates after a week's cooldown.
|
||||||
|
- The workflows can only read the repo by default. Only the release job can write, and it runs no build tools.
|
||||||
|
- [CodeQL](.github/workflows/codeql.yml) scans the C++, the web UI, the Python scripts and the workflows on every PR. [zizmor](.github/workflows/zizmor.yml) lints the workflows, and [OpenSSF Scorecard](.github/workflows/scorecard.yml) rates the repo's practices. Findings are on the repo's Security tab.
|
||||||
|
|
@ -21,11 +21,13 @@ platform = https://github.com/pioarduino/platform-espressif32/releases/download/
|
||||||
framework = arduino
|
framework = arduino
|
||||||
; Unit tests only run on the PC: pio test -e native
|
; Unit tests only run on the PC: pio test -e native
|
||||||
test_ignore = *
|
test_ignore = *
|
||||||
|
; Exact versions: a new release of a library only gets into the firmware
|
||||||
|
; through a PR that bumps it here.
|
||||||
lib_deps =
|
lib_deps =
|
||||||
bblanchon/ArduinoJson@^7.2.2
|
bblanchon/ArduinoJson@7.4.3
|
||||||
knolleary/PubSubClient@^2.8
|
knolleary/PubSubClient@2.8
|
||||||
esp32async/ESPAsyncWebServer@^3.12.1
|
esp32async/ESPAsyncWebServer@3.12.1
|
||||||
esp32async/AsyncTCP@^3.5.0
|
esp32async/AsyncTCP@3.5.0
|
||||||
extra_scripts =
|
extra_scripts =
|
||||||
pre:app_version.py
|
pre:app_version.py
|
||||||
pre:minify.py
|
pre:minify.py
|
||||||
|
|
@ -155,7 +157,7 @@ test_framework = unity
|
||||||
test_build_src = yes
|
test_build_src = yes
|
||||||
build_src_filter = -<*> +<Utils.cpp> +<ConfigRecords.cpp> +<MqttDisco.cpp> +<SomfyFrame.cpp> +<JsonFormatter.cpp> +<ShadeMotion.cpp> +<ShadeSensors.cpp> +<ShadeBehaviour.cpp> +<PulseDecoder.cpp> +<TxBuffer.cpp> +<RadioScheduler.cpp> +<ShadeRequests.cpp> +<entryPoints/MqttCommands.cpp> +<ItemSnapshot.cpp> +<ModelEditor.cpp> +<ShadeChanges.cpp> +<ProtoSchema.cpp> +<ProtoFrame.cpp> +<ProtoSync.cpp> +<ProtoParse.cpp> +<ProtoSlots.cpp> +<ProtoOps.cpp> +<ProtoEdits.cpp> +<ProtoSettings.cpp> +<ProtoAssembly.cpp>
|
build_src_filter = -<*> +<Utils.cpp> +<ConfigRecords.cpp> +<MqttDisco.cpp> +<SomfyFrame.cpp> +<JsonFormatter.cpp> +<ShadeMotion.cpp> +<ShadeSensors.cpp> +<ShadeBehaviour.cpp> +<PulseDecoder.cpp> +<TxBuffer.cpp> +<RadioScheduler.cpp> +<ShadeRequests.cpp> +<entryPoints/MqttCommands.cpp> +<ItemSnapshot.cpp> +<ModelEditor.cpp> +<ShadeChanges.cpp> +<ProtoSchema.cpp> +<ProtoFrame.cpp> +<ProtoSync.cpp> +<ProtoParse.cpp> +<ProtoSlots.cpp> +<ProtoOps.cpp> +<ProtoEdits.cpp> +<ProtoSettings.cpp> +<ProtoAssembly.cpp>
|
||||||
lib_deps =
|
lib_deps =
|
||||||
bblanchon/ArduinoJson@^7.2.2
|
bblanchon/ArduinoJson@7.4.3
|
||||||
build_flags =
|
build_flags =
|
||||||
-std=gnu++17
|
-std=gnu++17
|
||||||
-Isrc
|
-Isrc
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue