Skip to content
This repository was archived by the owner on Dec 30, 2025. It is now read-only.

Commit 5dada02

Browse files
authored
Merge branch 'main' into renovate/reviewdog-action-gitleaks-1.x
2 parents 00f58b0 + 5f231a6 commit 5dada02

File tree

3 files changed

+104
-56
lines changed

3 files changed

+104
-56
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
- name: Checkout
118118
uses: actions/checkout@v4
119119
- name: Validate
120-
uses: reviewdog/action-actionlint@v1.66.1
120+
uses: reviewdog/action-actionlint@v1.67.0
121121
with:
122122
github_token: ${{ secrets.GITHUB_TOKEN }}
123123
level: ${{ env.REVIEWDOG_LEVEL }}
@@ -144,6 +144,7 @@ jobs:
144144
filter_mode: ${{ env.REVIEWDOG_FILTER_MODE }}
145145
fail_level: ${{ env.REVIEWDOG_FAIL_LEVEL }}
146146
hadolint_ignore: DL3008 DL3009 DL3007
147+
hadolint_flags: '--format json'
147148
yaml:
148149
name: YAML
149150
runs-on: ubuntu-latest

.github/workflows/docker.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,17 @@ jobs:
9898
echo "✅ Docker build validation for ${{ matrix.service }} completed successfully"
9999
echo "🔍 Build cache updated for faster future builds"
100100
- name: Scan Containerfile ${{ matrix.service }}
101-
uses: reviewdog/action-trivy@v1
101+
uses: reviewdog/action-trivy@v1.13.10
102102
continue-on-error: true
103103
with:
104104
github_token: ${{ github.token }}
105105
trivy_command: config
106106
trivy_target: ./${{ matrix.service == 'unrealircd-webpanel' && 'web/webpanel/Containerfile' || format('{0}/Containerfile', matrix.service) }}
107-
trivy_version: v0.63.0
108107
level: warning
109108
reporter: github-pr-review
110109
tool_name: trivy-dockerfile-${{ matrix.service }}
111110
filter_mode: added
111+
fail_level: none
112112
trivy_flags: --severity HIGH,CRITICAL
113113
build:
114114
name: Build & Push
@@ -174,17 +174,17 @@ jobs:
174174
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
175175
- name: Scan Final Image ${{ matrix.service }}
176176
if: always()
177-
uses: reviewdog/action-trivy@v1
177+
uses: reviewdog/action-trivy@v1.13.10
178178
continue-on-error: true
179179
with:
180180
github_token: ${{ github.token }}
181181
trivy_command: image
182182
trivy_target: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
183-
trivy_version: v0.63.0
184183
level: warning
185184
reporter: github-pr-review
186185
tool_name: trivy-final-${{ matrix.service }}
187186
filter_mode: nofilter
187+
fail_level: none
188188
trivy_flags: --severity HIGH,CRITICAL --exit-code 0
189189
cleanup:
190190
name: Cleanup

.github/workflows/security.yml

Lines changed: 98 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ jobs:
6464
include:
6565
- language: actions
6666
build-mode: none
67-
- language: yaml
68-
build-mode: none
6967
steps:
7068
- name: Checkout
7169
uses: actions/checkout@v4
@@ -119,62 +117,111 @@ jobs:
119117
load: true
120118
tags: irc-atl-chat-${{ matrix.service }}:security-scan
121119
- name: Scan Container Image
122-
uses: aquasecurity/trivy-action@master
123-
with:
124-
image-ref: 'irc-atl-chat-${{ matrix.service }}:security-scan'
125-
format: 'sarif'
126-
output: 'trivy-results-${{ matrix.service }}.sarif'
127-
severity: 'HIGH,CRITICAL'
128-
- name: Upload Trivy scan results to GitHub Security tab
129-
uses: github/codeql-action/upload-sarif@v3
130-
with:
131-
sarif_file: 'trivy-results-${{ matrix.service }}.sarif'
132-
category: trivy-${{ matrix.service }}
133-
- name: Upload Results
134-
if: always()
135-
uses: actions/upload-artifact@v4
120+
uses: reviewdog/[email protected]
136121
with:
137-
name: trivy-results-${{ matrix.service }}
138-
path: trivy-results-${{ matrix.service }}.sarif
139-
retention-days: 30
140-
secrets:
141-
name: Secret Detection
122+
github_token: ${{ secrets.GITHUB_TOKEN }}
123+
trivy_command: image
124+
trivy_target: 'irc-atl-chat-${{ matrix.service }}:security-scan'
125+
level: warning
126+
reporter: github-pr-review
127+
tool_name: trivy-${{ matrix.service }}
128+
filter_mode: nofilter
129+
fail_level: none
130+
trivy_flags: --severity HIGH,CRITICAL --exit-code 0
131+
shell:
132+
name: Shell Script Security
142133
runs-on: ubuntu-latest
143134
needs: [changes]
144-
if: always()
135+
if: (needs.changes.outputs.shell == 'true' || github.event_name == 'workflow_dispatch')
145136
permissions:
146137
contents: read
147138
security-events: write
148139
steps:
149140
- name: Checkout
150141
uses: actions/checkout@v4
151-
- name: Scan for Secrets
152-
uses: trufflesecurity/trufflehog@main
153-
with:
154-
path: ./
155-
base: main
156-
head: HEAD
157-
extra_args: --debug --only-verified
158-
- name: Upload Results
159-
if: always()
160-
uses: actions/upload-artifact@v4
161-
with:
162-
name: trufflehog-results
163-
path: trufflehog-results.json
164-
retention-days: 30
165-
dependabot:
166-
name: Dependabot
167-
runs-on: ubuntu-latest
168-
if: github.actor == 'dependabot[bot]'
169-
permissions:
170-
contents: write
171-
pull-requests: write
172-
steps:
173-
- name: Checkout
174-
uses: actions/checkout@v4
175-
- name: Auto-merge
142+
- name: Shell Script Security Analysis
176143
run: |
177-
gh pr merge --auto --merge "$PR_URL" || echo "Auto-merge failed, manual review required"
178-
env:
179-
PR_URL: ${{ github.event.pull_request.html_url }}
180-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144+
echo "## 🔍 Shell Script Security Analysis"
145+
echo ""
146+
147+
# Find all shell scripts
148+
SHELL_SCRIPTS=$(find . -name "*.sh" -o -name "*.bash" -o -name "*.zsh" | grep -v ".git" || echo "")
149+
150+
if [ -z "$SHELL_SCRIPTS" ]; then
151+
echo "No shell scripts found for analysis"
152+
exit 0
153+
fi
154+
155+
echo "Found shell scripts:"
156+
echo "$SHELL_SCRIPTS"
157+
echo ""
158+
159+
# Security checks for shell scripts
160+
for script in $SHELL_SCRIPTS; do
161+
echo "### Analyzing: $script"
162+
163+
# Check for common security issues
164+
echo "**Security Checks:**"
165+
166+
# Check for hardcoded passwords/secrets
167+
if grep -n -i "password\|secret\|key\|token" "$script" | grep -v "#.*password\|#.*secret" | grep -v "echo.*password\|echo.*secret"; then
168+
echo "⚠️ Potential hardcoded credentials found"
169+
else
170+
echo "✅ No obvious hardcoded credentials"
171+
fi
172+
173+
# Check for eval usage (dangerous)
174+
if grep -n "eval " "$script"; then
175+
echo "⚠️ Use of 'eval' detected (security risk)"
176+
else
177+
echo "✅ No 'eval' usage found"
178+
fi
179+
180+
# Check for unquoted variables
181+
if grep -n "\$[a-zA-Z_][a-zA-Z0-9_]*[^\"' ]" "$script" | grep -v "echo\|printf\|test"; then
182+
echo "⚠️ Potentially unquoted variables found"
183+
else
184+
echo "✅ Variables appear properly quoted"
185+
fi
186+
187+
# Check for rm -rf patterns
188+
if grep -n "rm.*-rf" "$script"; then
189+
echo "⚠️ 'rm -rf' usage detected (verify paths are safe)"
190+
else
191+
echo "✅ No dangerous rm patterns"
192+
fi
193+
194+
# Check for curl/wget without SSL verification
195+
if grep -n "curl.*-k\|wget.*--no-check-certificate" "$script"; then
196+
echo "⚠️ SSL verification disabled in network requests"
197+
else
198+
echo "✅ SSL verification appears enabled"
199+
fi
200+
201+
echo ""
202+
done
203+
{
204+
echo "## 🛡️ Additional Security Analysis"
205+
echo ""
206+
207+
# Check for dangerous file permissions
208+
echo "**File Permission Analysis:**"
209+
DANGEROUS_PERMS=$(find . -type f -perm /o+w -not -path "./.git/*" 2>/dev/null || echo "")
210+
if [ -n "$DANGEROUS_PERMS" ]; then
211+
echo "⚠️ World-writable files found:"
212+
echo "$DANGEROUS_PERMS"
213+
else
214+
echo "✅ No world-writable files found"
215+
fi
216+
217+
# Check for suid/sgid files
218+
SUID_FILES=$(find . -type f \( -perm -4000 -o -perm -2000 \) -not -path "./.git/*" 2>/dev/null || echo "")
219+
if [ -n "$SUID_FILES" ]; then
220+
echo "⚠️ SUID/SGID files found:"
221+
echo "$SUID_FILES"
222+
else
223+
echo "✅ No SUID/SGID files found"
224+
fi
225+
226+
echo ""
227+
} >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)