Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions scripts/check-secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ GITLEAKS_VERSION="8.30.0"
OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
ARCH="$(uname -m)"
case "$ARCH" in
x86_64) ARCH="amd64" ;;
x86_64) ARCH="x64" ;;
aarch64 | arm64) ARCH="arm64" ;;
*) echo -e "${RED}❌ Unsupported architecture: $ARCH${RESET}" >&2; exit 1 ;;
esac

TARBALL="gitleaks_${GITLEAKS_VERSION}_${OS}_${ARCH}.tar.gz"
CHECKSUMS_URL="https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/checksums.txt"
CHECKSUMS_FILE="gitleaks_${GITLEAKS_VERSION}_checksums.txt"
CHECKSUMS_URL="https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/${CHECKSUMS_FILE}"
TARBALL_URL="https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/${TARBALL}"

INSTALL_DIR="$HOME/.local/bin"
Expand All @@ -29,7 +30,7 @@ if ! command -v gitleaks >/dev/null 2>&1; then
echo -e "${YELLOW}🔍 gitleaks not found, installing to $INSTALL_DIR...${RESET}"
curl -sSL -O "$TARBALL_URL"
curl -sSL -O "$CHECKSUMS_URL"
grep "$TARBALL" checksums.txt > "${TARBALL}.sha256"
grep "$TARBALL" "$CHECKSUMS_FILE" > "${TARBALL}.sha256"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use grep -F for fixed-string matching.

The tarball name contains literal dots (e.g., gitleaks_8.30.0_linux_x64.tar.gz). Without -F, grep interprets those as regex wildcards matching any character. While unlikely to cause a false match in this checksums file, it's a correctness gap that's trivially fixed.

🐛 Proposed fix
-  grep "$TARBALL" "$CHECKSUMS_FILE" > "${TARBALL}.sha256"
+  grep -F "$TARBALL" "$CHECKSUMS_FILE" > "${TARBALL}.sha256"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
grep "$TARBALL" "$CHECKSUMS_FILE" > "${TARBALL}.sha256"
grep -F "$TARBALL" "$CHECKSUMS_FILE" > "${TARBALL}.sha256"
🤖 Prompt for AI Agents
In `@scripts/check-secrets.sh` at line 33, The grep invocation that extracts the
checksum uses pattern matching and should use fixed-string mode to avoid
interpreting dots or other metacharacters in $TARBALL as regex; update the
command that runs grep "$TARBALL" "$CHECKSUMS_FILE" > "${TARBALL}.sha256" to use
fixed-string matching (e.g., add -F or --fixed-strings) so the tarball name is
matched literally against $CHECKSUMS_FILE.

sha256sum -c "${TARBALL}.sha256"
tar -xzf "$TARBALL" gitleaks
mv gitleaks "$INSTALL_DIR/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ class SecurityConfiguration(
"/api/auth/refresh-token", "/api/auth/login", "/api/auth/logout",
"/api/auth/csrf",
"/api/auth/federated/**", "/oauth2/**", "/login/oauth2/**",
"actuator/info",
).permitAll()
.pathMatchers(
"/swagger-ui/**", "/webjars/**", "/api-docs/**", "/swagger-ui.html",
Expand All @@ -216,8 +215,6 @@ class SecurityConfiguration(
.pathMatchers("/actuator/**").authenticated()
.pathMatchers("/api/**").authenticated()
.pathMatchers("/management/health").permitAll()
.pathMatchers("/management/info").permitAll()
.pathMatchers("/management/prometheus").permitAll()
.pathMatchers("/management/**").hasAuthority(Role.ADMIN.key())
}

Expand Down
Loading