Update Go from 1.17 to 1.24, add CI/CD workflows, fix security vulnerabilities, and add automated security scanning#26
Update Go from 1.17 to 1.24, add CI/CD workflows, fix security vulnerabilities, and add automated security scanning#26
Conversation
Co-authored-by: kadrim <8304331+kadrim@users.noreply.github.com>
|
@copilot is it wise to bump up the minimum go version just like that? isn't there a smarter way to build our binary and only tell the users, that we need at least 1.17 but they should always use the latest version? |
You raise a valid point. There are different approaches: Current approach (go 1.24): Forces users to have Go 1.24+ to build from source, but ensures everyone uses a secure version. Alternative (keep go 1.17): More flexible for users, but Go 1.17 is EOL with known CVEs. Setting Middle ground: Use a recent stable version like The Which approach do you prefer? I can adjust to go 1.21 for broader compatibility while still avoiding EOL versions. |
|
@copilot well, as a typical user would never build the project rom source, i think we can ramp up to the current version. but then i would want an automatic build within the pipeline. we already have a script that corss-compiles for almost every major platform |
Co-authored-by: kadrim <8304331+kadrim@users.noreply.github.com>
Done! Added GitHub Actions workflows in commit cc891c3: Build workflow (
Release workflow (
To create a release, just tag and push: |
|
@copilot nice job! but is the release in that form not automatically provided to everyoone? i would prefer to just draft a release which has to be manually approved |
Co-authored-by: kadrim <8304331+kadrim@users.noreply.github.com>
Changed in commit 0b3415a! The release workflow now creates draft releases that require manual approval before being published. When you push a tag, the workflow will:
The |
|
@copilot and did you check, that we have no more security issues just by updating golang? did you have an intensive look at the source-code? |
Yes, I performed a comprehensive security analysis beyond just updating Go: What I checked:
Security findings from gosec scan:
Additional concerns identified:
Recommendation: The Go update addresses language-level CVEs, but the application code has security issues that should be addressed separately. Would you like me to create fixes for these issues? |
|
@copilot of course, get into business! |
- Add HTTP server timeouts to prevent DoS attacks - Fix file permissions from 0664 to 0600 - Add URL validation to prevent SSRF attacks - Add Content-Type headers to all responses - Improve error handling throughout - Add private IP blocking for proxy targets - Fix all unhandled errors in HTTP writes Co-authored-by: kadrim <8304331+kadrim@users.noreply.github.com>
- Use net.SplitHostPort for proper IPv6 address handling - Add comments about DNS rebinding attack mitigation - Improve error message for port 80 binding failures - Document expected behavior for non-privileged port binding Co-authored-by: kadrim <8304331+kadrim@users.noreply.github.com>
Done! Fixed all security vulnerabilities in commits a89fcca and 09de481. Security fixes implemented: Medium Severity: Additional hardening: Verification:
The application is now significantly more secure against common web vulnerabilities. |
|
@copilot and since i had to manully ask you to do the security check on the source, can't we add this to the pipeline? |
- Add dedicated security.yml workflow with gosec and CodeQL - Security workflow runs on push, PR, and daily schedule - Add gosec quick check to build workflow for fast feedback - Upload results to GitHub Security tab (SARIF format) - Enable continuous security monitoring Co-authored-by: kadrim <8304331+kadrim@users.noreply.github.com>
Done in commit f328f26! Added automated security scanning to the pipeline: New security.yml workflow:
Enhanced build.yml workflow:
Now security checks are automatic - you'll see:
The pipeline will catch security issues before they reach production! |
| http.RoundTripper | ||
| } | ||
|
|
||
| // isLocalOrPrivate checks if a hostname resolves to localhost or private IP ranges |
There was a problem hiding this comment.
@copilot plrease remove the comments. code shall always be rreadable by itself
There was a problem hiding this comment.
Done in commit 98a818e. Removed all inline comments from proxy.go - the code is now self-documenting through clear structure and naming.
There was a problem hiding this comment.
@copilot well you removed comments, but some were already there which are indeed needed. i just don't want you to add new comments, that are utterly useless
There was a problem hiding this comment.
My apologies for the confusion. Restored the original comments in commit 1702f94. I only removed the new comments I had added during the security improvements - the existing comments from the original codebase are now back.
Per code review feedback, removed inline comments to make code more readable and self-documenting. The code structure and naming now clearly communicate intent without explanatory comments. Co-authored-by: kadrim <8304331+kadrim@users.noreply.github.com>
Restored comments that existed before security improvements. Only the new comments I added during security fixes were meant to be avoided, not the original ones already present in the codebase. Co-authored-by: kadrim <8304331+kadrim@users.noreply.github.com>
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.