Repository navigation
79 lines (69 loc) · 2.72 KB
/
Copy pathcodeql.yml
File metadata and controls
79 lines (69 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CodeQL
on:
push:
branches: [ 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
schedule:
- cron: '0 7 * * 1'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
# Required so CodeQL can upload findings to the Security tab.
security-events: write
defaults:
run:
shell: bash -e {0}
jobs:
analyze:
name: CodeQL (C, security)
runs-on: ubuntu-latest
container:
image: ghcr.io/wolfssl/wolfcose-ci@sha256:c073c7afb4cd3f296b8c1a305db2f718530b7a8aca899482629aee3a5cf8bfbc
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Trust workspace
if: runner.os == 'Linux'
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
# Full-feature wolfSSL so every wolfCOSE code path is compiled and
# therefore visible to CodeQL.
- name: Build wolfSSL
run: |
cd ~
git clone --depth 1 https://github.com/wolfSSL/wolfssl.git
cd wolfssl
./autogen.sh
./configure --enable-ecc --enable-ed25519 --enable-ed448 \
--enable-curve25519 --enable-curve448 \
--enable-aesgcm --enable-aesccm --enable-aescbc \
--enable-sha384 --enable-sha512 \
--enable-keygen --enable-hkdf --enable-aeskeywrap \
--enable-chacha --enable-poly1305 \
--enable-mldsa --enable-rsapss \
--prefix=$HOME/wolfssl-install
make -j$(nproc)
make install
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: c-cpp
build-mode: manual
# security-extended runs only the security query suites. The default
# "security-and-quality" pack also flags maintainability nits (long
# functions, comment density), which we intentionally exclude here.
queries: security-extended
- name: Build wolfCOSE
run: |
export WOLFSSL_DIR=$HOME/wolfssl-install
export LD_LIBRARY_PATH=$WOLFSSL_DIR/lib
make CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"
make eat-psa-test CFLAGS="-std=c99 -DHAVE_ANONYMOUS_INLINE_AGGREGATES=1 -Os -Wall -Wextra -Wpedantic -Wshadow -Wconversion -I./include -isystem $WOLFSSL_DIR/include" \
LDFLAGS="-L$WOLFSSL_DIR/lib -lwolfssl"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:c-cpp"