Compare commits

..

17 Commits

Author SHA1 Message Date
minori 5c0949439a deps: update @types/node to 25.2.3
Node.js CI / CI (pull_request) Failing after 12s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m35s
2026-02-20 07:00:55 -08:00
minori b9b958dad8 deps: update @types/node to 25.2.2
Node.js CI / CI (pull_request) Failing after 10s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m17s
2026-02-18 07:00:46 -08:00
minori fee3d8640d deps: update @types/node to 25.2.1
Node.js CI / CI (pull_request) Failing after 10s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m15s
2026-02-15 07:00:45 -08:00
minori bac14b727c deps: update @types/node to 25.2.0
Node.js CI / CI (pull_request) Failing after 12s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m24s
2026-02-12 07:00:51 -08:00
minori 837b370ca6 deps: update @types/node to 25.1.0
Node.js CI / CI (pull_request) Failing after 15s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 2m5s
2026-02-08 07:00:56 -08:00
minori e91adb56bf deps: update @types/node to 25.0.10
Node.js CI / CI (pull_request) Failing after 15s
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m17s
2026-02-03 19:22:10 -08:00
hikari dc1c123388 docs: update feedback section to use support forum
Node.js CI / CI (push) Failing after 8s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m45s
2026-01-26 12:32:04 -08:00
naomi 9da900efb7 feat: automated upload of .gitea/workflows/ci.yml
Node.js CI / CI (push) Failing after 10s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m0s
2025-12-22 19:41:38 +01:00
naomi 7f8599eacc feat: automated upload of .gitea/workflows/ci.yml
Node.js CI / CI (push) Failing after 8s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m3s
2025-12-22 19:35:07 +01:00
naomi f34c1ad9f3 feat: automated upload of .gitea/workflows/ci.yml
Node.js CI / Lint and Test (push) Failing after 3s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 57s
2025-12-22 19:24:59 +01:00
naomi 9a71abb3dd feat: automated upload of .npmrc
Node.js CI / Lint and Test (push) Successful in 43s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m9s
2025-12-22 19:15:56 +01:00
naomi 7560bdb502 feat: automated upload of .gitea/workflows/security.yml
Node.js CI / Lint and Test (push) Successful in 47s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m2s
2025-12-18 03:07:50 +01:00
naomi eaadb3ad65 feat: automated upload of .gitea/workflows/security.yml
Node.js CI / Lint and Test (push) Successful in 53s
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m14s
2025-12-17 23:25:49 +01:00
naomi 1fda8ed472 feat: automated upload of .gitea/workflows/security.yml
Node.js CI / Lint and Test (push) Successful in 36s
Security Scan / Security Audit (push) Failing after 5m2s
2025-12-12 03:37:36 +01:00
naomi 2dc484a601 feat: automated delete of .gitea/workflows/sonar.yml
Node.js CI / Lint and Test (push) Successful in 33s
Security Scan / Trivy Security Scan (push) Failing after 4m45s
2025-12-12 00:14:57 +01:00
naomi b85c286017 feat: automated upload of .gitea/workflows/security.yml
Node.js CI / Lint and Test (push) Successful in 34s
Security Scan / Trivy Security Scan (push) Failing after 4m46s
Code Analysis / SonarQube (push) Failing after 4m49s
2025-12-11 20:11:50 +01:00
naomi 4c72b3a062 chore: add sonar workflow
Node.js CI / Lint and Test (push) Successful in 1m44s
Code Analysis / SonarQube (push) Successful in 1m8s
2025-02-26 13:30:45 -08:00
6 changed files with 252 additions and 32 deletions
+15 -6
View File
@@ -8,22 +8,31 @@ on:
- main
jobs:
lint:
name: Lint and Test
ci:
name: CI
runs-on: ubuntu-latest
steps:
- name: Checkout Source Files
uses: actions/checkout@v4
- name: Use Node.js v22
- name: Use Node.js v24
uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9
version: 10
- name: Ensure Dependencies are Pinned
uses: naomi-lgbt/dependency-pin-check@main
with:
language: javascript
dev-dependencies: true
peer-dependencies: true
optional-dependencies: true
- name: Install Dependencies
run: pnpm install
@@ -35,4 +44,4 @@ jobs:
run: pnpm run build
- name: Run Tests
run: pnpm run test
run: pnpm run test
+177
View File
@@ -0,0 +1,177 @@
name: Security Scan and Upload
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * 1'
workflow_dispatch:
jobs:
security-audit:
name: Security & DefectDojo Upload
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v4
# --- AUTO-SETUP PROJECT ---
- name: Ensure DefectDojo Product Exists
env:
DD_URL: ${{ secrets.DD_URL }}
DD_TOKEN: ${{ secrets.DD_TOKEN }}
PRODUCT_NAME: ${{ github.repository }}
PRODUCT_TYPE_ID: 1
run: |
sudo apt-get install jq -y > /dev/null
echo "Checking connection to $DD_URL..."
# Check if product exists - capture HTTP code to debug connection issues
RESPONSE=$(curl --write-out "%{http_code}" --silent --output /tmp/response.json \
-H "Authorization: Token $DD_TOKEN" \
"$DD_URL/api/v2/products/?name=$PRODUCT_NAME")
# If response is not 200, print error
if [ "$RESPONSE" != "200" ]; then
echo "::error::Failed to query DefectDojo. HTTP Code: $RESPONSE"
cat /tmp/response.json
exit 1
fi
COUNT=$(cat /tmp/response.json | jq -r '.count')
if [ "$COUNT" = "0" ]; then
echo "Creating product '$PRODUCT_NAME'..."
curl -s -X POST "$DD_URL/api/v2/products/" \
-H "Authorization: Token $DD_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "'"$PRODUCT_NAME"'", "description": "Auto-created by Gitea Actions", "prod_type": '$PRODUCT_TYPE_ID' }'
else
echo "Product '$PRODUCT_NAME' already exists."
fi
# --- 1. TRIVY (Dependencies & Misconfig) ---
- name: Install Trivy
run: |
sudo apt-get install wget apt-transport-https gnupg lsb-release -y
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update && sudo apt-get install trivy -y
- name: Run Trivy (FS Scan)
run: |
trivy fs . --scanners vuln,misconfig --format json --output trivy-results.json --exit-code 0
- name: Upload Trivy to DefectDojo
env:
DD_URL: ${{ secrets.DD_URL }}
DD_TOKEN: ${{ secrets.DD_TOKEN }}
run: |
echo "Uploading Trivy results..."
# Generate today's date in YYYY-MM-DD format
TODAY=$(date +%Y-%m-%d)
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
-H "Authorization: Token $DD_TOKEN" \
-F "active=true" \
-F "verified=true" \
-F "scan_type=Trivy Scan" \
-F "engagement_name=CI/CD Pipeline" \
-F "product_name=${{ github.repository }}" \
-F "scan_date=$TODAY" \
-F "auto_create_context=true" \
-F "file=@trivy-results.json")
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "201" ]]; then
echo "::error::Upload Failed with HTTP $HTTP_CODE"
echo "--- SERVER RESPONSE ---"
cat response.txt
echo "-----------------------"
exit 1
else
echo "Upload Success!"
fi
# --- 2. GITLEAKS (Secrets) ---
- name: Install Gitleaks
run: |
wget -qO gitleaks.tar.gz https://github.com/gitleaks/gitleaks/releases/download/v8.18.0/gitleaks_8.18.0_linux_x64.tar.gz
tar -xzf gitleaks.tar.gz
sudo mv gitleaks /usr/local/bin/ && chmod +x /usr/local/bin/gitleaks
- name: Run Gitleaks
run: gitleaks detect --source . -v --report-path gitleaks-results.json --report-format json --no-git || true
- name: Upload Gitleaks to DefectDojo
env:
DD_URL: ${{ secrets.DD_URL }}
DD_TOKEN: ${{ secrets.DD_TOKEN }}
run: |
echo "Uploading Gitleaks results..."
TODAY=$(date +%Y-%m-%d)
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
-H "Authorization: Token $DD_TOKEN" \
-F "active=true" \
-F "verified=true" \
-F "scan_type=Gitleaks Scan" \
-F "engagement_name=CI/CD Pipeline" \
-F "product_name=${{ github.repository }}" \
-F "scan_date=$TODAY" \
-F "auto_create_context=true" \
-F "file=@gitleaks-results.json")
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "201" ]]; then
echo "::error::Upload Failed with HTTP $HTTP_CODE"
echo "--- SERVER RESPONSE ---"
cat response.txt
echo "-----------------------"
exit 1
else
echo "Upload Success!"
fi
# --- 3. SEMGREP (SAST) ---
- name: Install Semgrep (via pipx)
run: |
sudo apt-get install pipx -y
pipx install semgrep
# Add pipx binary path to GITHUB_PATH so next steps can see 'semgrep'
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Run Semgrep
run: semgrep scan --config=p/security-audit --config=p/owasp-top-ten --json --output semgrep-results.json . || true
- name: Upload Semgrep to DefectDojo
env:
DD_URL: ${{ secrets.DD_URL }}
DD_TOKEN: ${{ secrets.DD_TOKEN }}
run: |
echo "Uploading Semgrep results..."
TODAY=$(date +%Y-%m-%d)
HTTP_CODE=$(curl --write-out "%{http_code}" --output response.txt --silent -X POST "$DD_URL/api/v2/import-scan/" \
-H "Authorization: Token $DD_TOKEN" \
-F "active=true" \
-F "verified=true" \
-F "scan_type=Semgrep JSON Report" \
-F "engagement_name=CI/CD Pipeline" \
-F "product_name=${{ github.repository }}" \
-F "scan_date=$TODAY" \
-F "auto_create_context=true" \
-F "file=@semgrep-results.json")
if [[ "$HTTP_CODE" != "200" && "$HTTP_CODE" != "201" ]]; then
echo "::error::Upload Failed with HTTP $HTTP_CODE"
echo "--- SERVER RESPONSE ---"
cat response.txt
echo "-----------------------"
exit 1
else
echo "Upload Success!"
fi
+25
View File
@@ -0,0 +1,25 @@
# Package Manager Configuration
# Force pnpm usage - breaks npm/yarn intentionally
node-linker=pnpm
# Security: Disable all lifecycle scripts
ignore-scripts=true
enable-pre-post-scripts=false
# Security: Require packages to be 10+ days old before installation
minimum-release-age=14400
# Security: Verify package integrity hashes
verify-store-integrity=true
# Security: Enforce strict trust policies
trust-policy=strict
# Security: Strict peer dependency resolution
strict-peer-dependencies=true
# Performance: Use symlinks for node_modules
symlink=true
# Lockfile: Ensure lockfile is not modified during install
frozen-lockfile=false
+1 -1
View File
@@ -93,7 +93,7 @@ All style changes should be proposed in our [chat server](https://chat.nhcarriga
## Feedback and Bugs
If you have feedback or a bug report, please feel free to open an issue!
If you have feedback or a bug report, please [log a ticket on our forum](https://support.nhcarrigan.com).
## Contributing
+1 -1
View File
@@ -57,7 +57,7 @@
"devDependencies": {
"@nhcarrigan/typescript-config": "4.0.0",
"@types/eslint": "9.6.1",
"@types/node": "22.10.5",
"@types/node": "25.2.3",
"typescript": "5.7.2",
"vitest": "2.1.8"
}
+33 -24
View File
@@ -31,7 +31,7 @@ importers:
version: 8.19.0(eslint@9.7.0)(typescript@5.7.2)
'@vitest/eslint-plugin':
specifier: 1.1.24
version: 1.1.24(@typescript-eslint/utils@8.19.0(eslint@9.7.0)(typescript@5.7.2))(eslint@9.7.0)(typescript@5.7.2)(vitest@2.1.8(@types/node@22.10.5))
version: 1.1.24(@typescript-eslint/utils@8.19.0(eslint@9.7.0)(typescript@5.7.2))(eslint@9.7.0)(typescript@5.7.2)(vitest@2.1.8(@types/node@25.2.3))
eslint:
specifier: '>=9'
version: 9.7.0
@@ -73,14 +73,14 @@ importers:
specifier: 9.6.1
version: 9.6.1
'@types/node':
specifier: 22.10.5
version: 22.10.5
specifier: 25.2.3
version: 25.2.3
typescript:
specifier: 5.7.2
version: 5.7.2
vitest:
specifier: 2.1.8
version: 2.1.8(@types/node@22.10.5)
version: 2.1.8(@types/node@25.2.3)
packages:
@@ -344,46 +344,55 @@ packages:
resolution: {integrity: sha512-2Rn36Ubxdv32NUcfm0wB1tgKqkQuft00PtM23VqLuCUR4N5jcNWDoV5iBC9jeGdgS38WK66ElncprqgMUOyomw==}
cpu: [arm]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm-musleabihf@4.19.0':
resolution: {integrity: sha512-gJuzIVdq/X1ZA2bHeCGCISe0VWqCoNT8BvkQ+BfsixXwTOndhtLUpOg0A1Fcx/+eA6ei6rMBzlOz4JzmiDw7JQ==}
cpu: [arm]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-arm64-gnu@4.19.0':
resolution: {integrity: sha512-0EkX2HYPkSADo9cfeGFoQ7R0/wTKb7q6DdwI4Yn/ULFE1wuRRCHybxpl2goQrx4c/yzK3I8OlgtBu4xvted0ug==}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-arm64-musl@4.19.0':
resolution: {integrity: sha512-GlIQRj9px52ISomIOEUq/IojLZqzkvRpdP3cLgIE1wUWaiU5Takwlzpz002q0Nxxr1y2ZgxC2obWxjr13lvxNQ==}
cpu: [arm64]
os: [linux]
libc: [musl]
'@rollup/rollup-linux-powerpc64le-gnu@4.19.0':
resolution: {integrity: sha512-N6cFJzssruDLUOKfEKeovCKiHcdwVYOT1Hs6dovDQ61+Y9n3Ek4zXvtghPPelt6U0AH4aDGnDLb83uiJMkWYzQ==}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-riscv64-gnu@4.19.0':
resolution: {integrity: sha512-2DnD3mkS2uuam/alF+I7M84koGwvn3ZVD7uG+LEWpyzo/bq8+kKnus2EVCkcvh6PlNB8QPNFOz6fWd5N8o1CYg==}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-s390x-gnu@4.19.0':
resolution: {integrity: sha512-D6pkaF7OpE7lzlTOFCB2m3Ngzu2ykw40Nka9WmKGUOTS3xcIieHe82slQlNq69sVB04ch73thKYIWz/Ian8DUA==}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-gnu@4.19.0':
resolution: {integrity: sha512-HBndjQLP8OsdJNSxpNIN0einbDmRFg9+UQeZV1eiYupIRuZsDEoeGU43NQsS34Pp166DtwQOnpcbV/zQxM+rWA==}
cpu: [x64]
os: [linux]
libc: [glibc]
'@rollup/rollup-linux-x64-musl@4.19.0':
resolution: {integrity: sha512-HxfbvfCKJe/RMYJJn0a12eiOI9OOtAUF4G6ozrFUK95BNyoJaSiBjIOHjZskTUffUrB84IPKkFG9H9nEvJGW6A==}
cpu: [x64]
os: [linux]
libc: [musl]
'@rollup/rollup-win32-arm64-msvc@4.19.0':
resolution: {integrity: sha512-HxDMKIhmcguGTiP5TsLNolwBUK3nGGUEoV/BO9ldUBoMLBssvh4J0X8pf11i1fTV7WShWItB1bKAKjX4RQeYmg==}
@@ -421,8 +430,8 @@ packages:
'@types/json5@0.0.29':
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
'@types/node@22.10.5':
resolution: {integrity: sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ==}
'@types/node@25.2.3':
resolution: {integrity: sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ==}
'@types/normalize-package-data@2.4.4':
resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==}
@@ -2039,8 +2048,8 @@ packages:
resolution: {integrity: sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==}
engines: {node: '>= 0.4'}
undici-types@6.20.0:
resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==}
undici-types@7.16.0:
resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==}
update-browserslist-db@1.1.1:
resolution: {integrity: sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==}
@@ -2388,9 +2397,9 @@ snapshots:
'@types/json5@0.0.29': {}
'@types/node@22.10.5':
'@types/node@25.2.3':
dependencies:
undici-types: 6.20.0
undici-types: 7.16.0
'@types/normalize-package-data@2.4.4': {}
@@ -2548,13 +2557,13 @@ snapshots:
'@typescript-eslint/types': 8.19.0
eslint-visitor-keys: 4.2.0
'@vitest/eslint-plugin@1.1.24(@typescript-eslint/utils@8.19.0(eslint@9.7.0)(typescript@5.7.2))(eslint@9.7.0)(typescript@5.7.2)(vitest@2.1.8(@types/node@22.10.5))':
'@vitest/eslint-plugin@1.1.24(@typescript-eslint/utils@8.19.0(eslint@9.7.0)(typescript@5.7.2))(eslint@9.7.0)(typescript@5.7.2)(vitest@2.1.8(@types/node@25.2.3))':
dependencies:
'@typescript-eslint/utils': 8.19.0(eslint@9.7.0)(typescript@5.7.2)
eslint: 9.7.0
optionalDependencies:
typescript: 5.7.2
vitest: 2.1.8(@types/node@22.10.5)
vitest: 2.1.8(@types/node@25.2.3)
'@vitest/expect@2.1.8':
dependencies:
@@ -2563,13 +2572,13 @@ snapshots:
chai: 5.1.2
tinyrainbow: 1.2.0
'@vitest/mocker@2.1.8(vite@5.3.5(@types/node@22.10.5))':
'@vitest/mocker@2.1.8(vite@5.3.5(@types/node@25.2.3))':
dependencies:
'@vitest/spy': 2.1.8
estree-walker: 3.0.3
magic-string: 0.30.14
optionalDependencies:
vite: 5.3.5(@types/node@22.10.5)
vite: 5.3.5(@types/node@25.2.3)
'@vitest/pretty-format@2.1.8':
dependencies:
@@ -4434,7 +4443,7 @@ snapshots:
has-symbols: 1.1.0
which-boxed-primitive: 1.1.1
undici-types@6.20.0: {}
undici-types@7.16.0: {}
update-browserslist-db@1.1.1(browserslist@4.24.2):
dependencies:
@@ -4451,13 +4460,13 @@ snapshots:
spdx-correct: 3.2.0
spdx-expression-parse: 3.0.1
vite-node@2.1.8(@types/node@22.10.5):
vite-node@2.1.8(@types/node@25.2.3):
dependencies:
cac: 6.7.14
debug: 4.3.7
es-module-lexer: 1.5.4
pathe: 1.1.2
vite: 5.3.5(@types/node@22.10.5)
vite: 5.3.5(@types/node@25.2.3)
transitivePeerDependencies:
- '@types/node'
- less
@@ -4468,19 +4477,19 @@ snapshots:
- supports-color
- terser
vite@5.3.5(@types/node@22.10.5):
vite@5.3.5(@types/node@25.2.3):
dependencies:
esbuild: 0.21.5
postcss: 8.4.40
rollup: 4.19.0
optionalDependencies:
'@types/node': 22.10.5
'@types/node': 25.2.3
fsevents: 2.3.3
vitest@2.1.8(@types/node@22.10.5):
vitest@2.1.8(@types/node@25.2.3):
dependencies:
'@vitest/expect': 2.1.8
'@vitest/mocker': 2.1.8(vite@5.3.5(@types/node@22.10.5))
'@vitest/mocker': 2.1.8(vite@5.3.5(@types/node@25.2.3))
'@vitest/pretty-format': 2.1.8
'@vitest/runner': 2.1.8
'@vitest/snapshot': 2.1.8
@@ -4496,11 +4505,11 @@ snapshots:
tinyexec: 0.3.1
tinypool: 1.0.2
tinyrainbow: 1.2.0
vite: 5.3.5(@types/node@22.10.5)
vite-node: 2.1.8(@types/node@22.10.5)
vite: 5.3.5(@types/node@25.2.3)
vite-node: 2.1.8(@types/node@25.2.3)
why-is-node-running: 2.3.0
optionalDependencies:
'@types/node': 22.10.5
'@types/node': 25.2.3
transitivePeerDependencies:
- less
- lightningcss