Repository navigation
316 lines (310 loc) · 16.7 KB
/
Copy pathci.yml
File metadata and controls
316 lines (310 loc) · 16.7 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
name: QuantumGrid quality gates
on:
push:
branches: [main, "feat/**", "fix/**"]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: quantumgrid-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
ui:
name: Existing control centre lint and build
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui/quantumgrid
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # pinned upstream v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # pinned upstream v4
with:
node-version: "22"
cache: npm
cache-dependency-path: ui/quantumgrid/package-lock.json
- run: npm ci
- run: npm run lint
- run: npm run build
- name: Test mandatory first-boot root password setup
run: node --experimental-strip-types --test ../../tests/firstboot-password.test.mjs
- name: Test guarded IPv4 office segment provisioning API requests
run: node --experimental-strip-types --test ../../tests/office-segment-api.test.mjs
- name: Test guarded bridge VLAN API requests and response verification
run: node --experimental-strip-types --test ../../tests/office-vlan-api.test.mjs
- name: Test guarded inter-zone forwarding API requests and response verification
run: node --experimental-strip-types --test ../../tests/office-forwarding-api.test.mjs
- name: Test guarded firewall zone policy API requests and response verification
run: node --experimental-strip-types --test ../../tests/office-zone-policy-api.test.mjs
- name: Test guarded AP-to-VLAN network binding API requests
run: node --experimental-strip-types --test ../../tests/wireless-vlan-api.test.mjs
- name: Test DHCPv6 RA and NDP scope API requests and response verification
run: node --experimental-strip-types --test ../../tests/office-dhcp-ipv6-api.test.mjs
- name: Test guarded SSID-to-LAN/VLAN binding API contract
run: node --experimental-strip-types --test ../../tests/office-wifi-network-api.test.mjs
- name: Test guarded WAN port-forward API contract
run: node --experimental-strip-types --test ../../tests/office-port-forward-api.test.mjs
- name: Test managed IPv6 WAN pinhole API contract
run: node --experimental-strip-types --test ../../tests/office-ipv6-pinhole-api.test.mjs
- name: Test managed IPv6 pinhole enable-state API contract
run: node --experimental-strip-types --test ../../tests/office-ipv6-pinhole-toggle-api.test.mjs
- name: Test authenticated weekly wireless radio schedule API
run: node --experimental-strip-types --test ../../tests/wireless-radio-api.test.mjs
- name: Test CAKE profile API contract
run: node --experimental-strip-types --test ../../tests/sqm-cake-profile-api.test.mjs
- name: Test per-client DSCP API contract
run: node --experimental-strip-types --test ../../tests/sqm-client-qos-api.test.mjs
- name: Test static-IP client download DSCP API contract
run: node --experimental-strip-types --test ../../tests/sqm-client-qos-download-api.test.mjs
- name: Test Wi-Fi channel planner
run: node --experimental-strip-types --test ../../tests/wifi-channel-planner.test.mjs
- name: Test local Wi-Fi client history
run: node --experimental-strip-types --test ../../tests/wifi-client-history.test.mjs
- name: Test firewall posture review
run: node --experimental-strip-types --test ../../tests/firewall-posture.test.mjs
- name: Test policy routing table coverage analysis
run: node --experimental-strip-types --test ../../tests/policy-routing-analysis.test.mjs
- name: Test IPv4 and IPv6 static route API contract
run: node --experimental-strip-types --test ../../tests/static-routes-api.test.mjs
- name: Test authenticated TLS and native remote syslog API
run: node --experimental-strip-types --test ../../tests/remote-syslog-api.test.mjs
- name: Test authenticated read-only SNMPv3 API contract
run: node --experimental-strip-types --test ../../tests/snmpv3-api.test.mjs
- name: Test authenticated multi-AP usteer roaming API contract
run: node --experimental-strip-types --test ../../tests/usteer-api.test.mjs
- name: Test encrypted configuration backup container and integrity
run: node --experimental-strip-types --test ../../tests/config-backup-crypto.test.mjs
- name: Test measured interface throughput rates
run: node --experimental-strip-types --test ../../tests/interface-rates.test.mjs
- name: Test measured WireGuard peer rates
run: node --experimental-strip-types --test ../../tests/wireguard-peer-rates.test.mjs
- name: Test bounded conntrack history
run: node --experimental-strip-types --test ../../tests/conntrack-history.test.mjs
- name: Audit npm dependency advisories
shell: bash
run: |
set +e
npm audit --json > /tmp/quantumgrid-npm-audit.json
node --input-type=commonjs <<'NODE'
const fs = require("node:fs");
const report = JSON.parse(fs.readFileSync("/tmp/quantumgrid-npm-audit.json", "utf8"));
const vulnerabilities = report.vulnerabilities ?? {};
const findings = Object.entries(vulnerabilities).map(([name, item]) => ({
name,
severity: item.severity,
range: item.range,
direct: item.isDirect,
fixAvailable: item.fixAvailable,
advisories: (item.via ?? []).filter((entry) => typeof entry === "object").map((entry) => ({
title: entry.title,
url: entry.url,
range: entry.range,
})),
}));
console.log(JSON.stringify({
summary: report.metadata?.vulnerabilities ?? {},
findings,
}, null, 2));
if ((report.metadata?.vulnerabilities?.high ?? 0) > 0 ||
(report.metadata?.vulnerabilities?.critical ?? 0) > 0) {
process.exitCode = 1;
}
NODE
website:
name: Static website validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # pinned upstream v4
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # pinned upstream v5
with:
python-version: "3.12"
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # pinned upstream v4
with:
node-version: "22"
- run: python3 scripts/check-website.py
- run: node --check docs/site.js
firmware-scripts:
name: Firmware integration checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # pinned upstream v4
- name: Install Lua syntax checker
run: |
sudo apt-get update
sudo apt-get install -y lua5.1
- name: Test AW1000 release attestation verification
run: bash tests/verify-aw1000-release-attestation-smoke.sh
- name: Test AW1000 sysupgrade archive validation
run: bash tests/verify-aw1000-sysupgrade-smoke.sh
- name: Test AW1000 CycloneDX SBOM generation
run: |
python3 -m py_compile scripts/generate-aw1000-sbom.py tests/test_aw1000_sbom.py
python3 tests/test_aw1000_sbom.py
- name: Validate hardware profile contracts
run: |
python3 -m py_compile scripts/verify-device-profile.py tests/device-profile.py
python3 scripts/verify-device-profile.py profiles/arcadyan-aw1000.json --check-only
python3 tests/device-profile.py
- name: Check shell and Lua syntax
run: |
bash -n build.sh
bash -n quantumgrid-configure.sh
bash -n scripts/setup-aw1000-phone-feed.sh
bash -n tests/phone-feed-pin-smoke.sh
bash tests/phone-feed-pin-smoke.sh
bash -n scripts/verify-aw1000-ubi.sh
bash -n scripts/verify-aw1000-sysupgrade.sh
bash -n tests/verify-aw1000-sysupgrade-smoke.sh
bash -n scripts/install-aw1000-ubi.sh
sh -n scripts/inspect-aw1000-install-target.sh
sh -n files/etc/uci-defaults/91-quantumgrid-usteer-safe
sh -n files/etc/uci-defaults/92-quantumgrid-nss-safe
bash -n tests/nss-build-profile-smoke.sh
bash -n tests/install-aw1000-target-inspector-smoke.sh
bash -n scripts/verify-aw1000-release-manifest.sh
sh -n scripts/verify-aw1000-release-attestation.sh
bash -n tests/install-aw1000-ubi-smoke.sh
sh -n scripts/verify-openwrt-source.sh
bash -n scripts/check-openwrt-worktree.sh
bash -n tests/openwrt-worktree-smoke.sh
bash tests/openwrt-worktree-smoke.sh
bash -n scripts/verify-openwrt-feeds.sh
bash -n tests/openwrt-feed-pin-smoke.sh
bash -n scripts/pin-aw1000-nss-feeds.sh
bash -n tests/nss-feed-pin-smoke.sh
bash tests/nss-feed-pin-smoke.sh
bash tests/openwrt-feed-pin-smoke.sh
bash -n tests/openwrt-source-pin-smoke.sh
bash tests/openwrt-source-pin-smoke.sh
sh -n files/usr/bin/quantumgrid-hardware-io
sh -n files/usr/bin/quantumgrid-button-events
sh -n files/etc/init.d/quantumgrid-button-events
sh -n files/etc/uci-defaults/94-quantumgrid-button-events
sh -n files/etc/uci-defaults/95-quantumgrid-https-only
bash -n tests/https-only-defaults-smoke.sh
bash tests/https-only-defaults-smoke.sh
bash -n tests/dropbear-lan-binding-smoke.sh
bash tests/dropbear-lan-binding-smoke.sh
sh -n files/etc/uci-defaults/93-quantumgrid-audit-backup
bash -n tests/firmware-smoke.sh
bash -n scripts/secure-aw1000-snmpd-runtime-config.sh
bash -n tests/snmpd-runtime-umask-smoke.sh
luac5.1 -p files/usr/lib/lua/luci/controller/quantumgrid.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/routing.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/sqm.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/qos.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/qos_policing.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/client_policing.lua
luac5.1 -p files/usr/bin/quantumgrid-client-policing
sh -n files/etc/init.d/quantumgrid-client-policing
sh -n files/etc/hotplug.d/iface/98-quantumgrid-client-policing
sh -n files/etc/uci-defaults/98-quantumgrid-client-policing
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/mwan3.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/wireguard.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/conntrack.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/wireless.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/usteer.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/packages.lua
luac5.1 -p tests/packages-catalog.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/package_operations.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/kernel_modules.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/hardware_io.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/office_networks.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/firewall_inventory.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/firewall_runtime.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/management_transport.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/device_profile.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/device_identity.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/config_backup.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/audit.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/remote_syslog.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/snmpv3.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/cellular.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/radio_schedule.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/radio_scheduler.lua
luac5.1 -p files/usr/bin/quantumgrid-radio-scheduler
sh -n files/etc/init.d/quantumgrid-radio-scheduler
sh -n files/etc/uci-defaults/97-quantumgrid-radio-scheduler
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/acceleration.lua
luac5.1 -p files/usr/lib/lua/luci/quantumgrid/network_tuning.lua
- name: Test IPv4 and IPv6 policy rule parser
run: lua5.1 tests/policy-routing.lua
- name: Test bounded SQM queue update validation
run: lua5.1 tests/sqm-controls.lua
- name: Test per-client DSCP policy validation and inventory
run: lua5.1 tests/qos.lua
- name: Test per-client bandwidth policing validation and TC plan
run: lua5.1 tests/qos-policing.lua
- name: Test per-client policing runtime reconciliation
run: lua5.1 tests/qos-policing-runtime.lua
- name: Test client policing worker and service installation
run: bash tests/client-policing-worker-smoke.sh
- name: Test allowlisted runtime network tuning inventory and validation
run: lua5.1 tests/network-tuning.lua
- name: Test runtime network tuning API contract
run: node --experimental-strip-types --test tests/network-tuning-api.test.mjs
- name: Test bounded weekly wireless radio schedules
run: lua5.1 tests/radio-schedule.lua
- name: Test weekly radio scheduler runtime transitions and rollback
run: lua5.1 tests/radio-scheduler-runtime.lua
- name: Test bounded cellular modem telemetry
run: lua5.1 tests/cellular-status.lua
- name: Test bounded cellular QMI command collection
run: lua5.1 tests/cellular-collector.lua
- name: Test bounded mwan3 tracker telemetry
run: lua5.1 tests/mwan3-status.lua
- name: Test mwan3 member validation and rollback snapshots
run: lua5.1 tests/mwan3-config.lua
- name: Test mwan3 health and member API contracts
run: node --experimental-strip-types --test tests/mwan3-config-api.test.mjs
- name: Test redacted WireGuard peer telemetry
run: lua5.1 tests/wireguard-status.lua
- name: Test read-only conntrack capacity telemetry
run: lua5.1 tests/conntrack-status.lua
- name: Test wireless configuration validation
run: lua5.1 tests/wireless-controls.lua
- name: Test validated multi-AP usteer roaming policy and runtime summaries
run: lua5.1 tests/usteer-controls.lua
- name: Test installed APK and OPKG package inventory
run: lua5.1 tests/packages-inventory.lua
- name: Test available APK and OPKG repository catalogue
run: lua5.1 tests/packages-catalog.lua
- name: Test safe APK and OPKG package operations
run: lua5.1 tests/package-operations.lua
- name: Test installed and loaded kernel module inventory
run: lua5.1 tests/kernel-modules.lua
- name: Test GPIO inventory and guarded LED controls
run: lua5.1 tests/hardware-io.lua
- name: Test office VLAN and network segmentation inventory
run: lua5.1 tests/office-networks.lua
- name: Test firewall NAT redirect projection and redaction
run: lua5.1 tests/firewall-inventory.lua
- name: Test live fw4 chain inventory and redaction
run: lua5.1 tests/firewall-runtime.lua
- name: Test administrator HTTPS and SSH management-plane posture
run: lua5.1 tests/management-transport.lua
- name: Test runtime hardware profile identity
run: lua5.1 tests/device-profile.lua
- name: Test persistent device identity and provisioning
run: |
lua5.1 tests/device-identity.lua
bash tests/device-identity-provision.sh
- name: Test secure configuration backup validation
run: lua5.1 tests/config-backup.lua
- name: Test redacted and bounded office admin audit events
run: lua5.1 tests/audit-log.lua
- name: Test native remote syslog validation
run: lua5.1 tests/remote-syslog.lua
- name: Test read-only SNMPv3 authPriv validation and firewall scope
run: lua5.1 tests/snmpv3.lua
- name: Test Net-SNMP generated credential file umask
run: bash tests/snmpd-runtime-umask-smoke.sh
- name: Test NSS EDMA and PPE readiness states
run: lua5.1 tests/acceleration-status.lua
- name: Test optional AW1000 NSS build profile
run: bash tests/nss-build-profile-smoke.sh
- name: Test read-only AW1000 install-target inspection
run: bash tests/install-aw1000-target-inspector-smoke.sh
- name: Check AW1000 profile, RJ11 safety and UI telemetry
run: bash tests/firmware-smoke.sh