-
Notifications
You must be signed in to change notification settings - Fork 51
chore: ip check #1810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: ip check #1810
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,5 +2,8 @@ | |
|
|
||
| SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
|
||
| echo "MY IP" | ||
| curl ifconfig.me | ||
|
Comment on lines
+5
to
+6
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Based on the gathered information, I can now provide the final response: Remove IP address exposure from build info script The IP address check is not being used in the generated build info (generatedNetlifyInfo.json) or anywhere else in the application. It appears to be a standalone debug statement that:
Remove lines 5-6 from 🔗 Analysis chainSecurity: Reconsider exposing public IP in build logs Exposing the public IP address in build logs could pose security risks:
Consider:
Let's check if the build logs are publicly accessible: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check for public build log configurations in common CI files
rg -l '(public_builds|public_logs|artifacts.*public)' .github/ .gitlab-ci.yml netlify.toml
Length of output: 147 Script: #!/bin/bash
# Let's check for CI configuration files and deployment scripts
fd -e yml -e yaml -e json -e toml "^(\.gitlab-ci|\.travis|netlify|vercel|azure-pipelines|build|deploy)"
# Check for any GitHub Actions workflow files
fd . .github/workflows/ -e yml -e yaml
# Look for build script references in package.json if it exists
fd "package.json" -x jq -r '.scripts | select(. != null)'
# Search for build log related configurations
rg -i "(build.*log|log.*build|artifact.*public|public.*artifact)"
Length of output: 14699 Script: #!/bin/bash
# Let's check if the build info is used in any public contexts or CI
rg -i "generateBuildInfo|build.*info" .github/workflows/
# Check where the build info is consumed
rg -l "buildInfo"
# Check for environment variables that might control logging
rg -i "(log.*level|debug.*mode|verbose|build.*env)"
Length of output: 65667 Script: #!/bin/bash
# Let's check if the IP is used in any sensitive context or stored
rg -i "ifconfig\.me|MY IP" -A 2 -B 2
# Check if the build info is used in any public URLs or endpoints
rg -i "buildinfo|build.*info" web/
# Check for environment variables that might control this behavior
fd -H "\.env" -x cat {} \;
Length of output: 8212 Script: #!/bin/bash
# Check how the build info is used in the application
rg -p "generatedNetlifyInfo.json" web/
# Check the build script's usage context
rg -p "generateBuildInfo.sh" web/
# Look for any public endpoints or routes that might expose build info
fd -e ts -e tsx -e js -e jsx -x rg -l "buildInfo|netlifyInfo"
Length of output: 482 |
||
|
|
||
| jq -n --arg primeUri "$DEPLOY_PRIME_URL" --arg uri "$URL" --arg deployUri "$DEPLOY_URL" '{ netlifyDeployPrimeUri: $primeUri, netlifyUri: $uri, netlifyDeployUri: $deployUri }' > src/generatedNetlifyInfo.json | ||
| node $SCRIPT_DIR/gitInfo.js | ||
| node $SCRIPT_DIR/gitInfo.js | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add error handling and timeout for curl command
The current implementation lacks error handling and timeout controls, which could:
Consider this more robust implementation:
Additionally, consider using multiple IP services for redundancy: