Skip to content

Commit a532083

Browse files
committed
ci: add security scan workflows and funding config
- Add CodeQL workflow for Go code analysis on push, PR, and weekly schedule - Add Trivy security scan for vulnerability, secret, and misconfig detection - Add GitHub funding configuration with PayPal link
1 parent 4673ff3 commit a532083

3 files changed

Lines changed: 117 additions & 0 deletions

File tree

.github/FUNDING.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13+
custom: ['https://www.paypal.me/appleboy46']

.github/workflows/codeql.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [main]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [main]
20+
schedule:
21+
- cron: "41 23 * * 6"
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: ["go"]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v6
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v4
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
- name: Perform CodeQL Analysis
54+
uses: github/codeql-action/analyze@v4

.github/workflows/security.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Trivy Security Scan
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: "0 0 * * *" # Daily scan at midnight UTC
10+
workflow_dispatch: # Allow manual trigger
11+
12+
jobs:
13+
trivy-scan:
14+
name: Trivy Security Scan
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
security-events: write
19+
actions: read
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v6
24+
25+
- name: Run Trivy vulnerability scanner in repo mode
26+
uses: aquasecurity/trivy-action@0.35.0
27+
with:
28+
scan-type: "fs"
29+
scan-ref: "."
30+
format: "sarif"
31+
output: "trivy-results.sarif"
32+
severity: "CRITICAL,HIGH,MEDIUM"
33+
scanners: "vuln,secret,misconfig"
34+
35+
- name: Upload Trivy results to GitHub Security tab
36+
uses: github/codeql-action/upload-sarif@v4
37+
if: always()
38+
with:
39+
sarif_file: "trivy-results.sarif"
40+
41+
- name: Run Trivy vulnerability scanner (table output)
42+
uses: aquasecurity/trivy-action@0.35.0
43+
if: always()
44+
with:
45+
scan-type: "fs"
46+
scan-ref: "."
47+
format: "table"
48+
severity: "CRITICAL,HIGH"
49+
scanners: "vuln,secret,misconfig"
50+
exit-code: "1"

0 commit comments

Comments
 (0)