fix: security hardening for ComplianceAuditor (bounty: security hardening)#28
Closed
lizhiming454 wants to merge 4 commits into
Closed
fix: security hardening for ComplianceAuditor (bounty: security hardening)#28lizhiming454 wants to merge 4 commits into
lizhiming454 wants to merge 4 commits into
Conversation
- Remove static S3 initializer (supply chain / MITM risk, was for a 2022 demo) - Move SFTP password from plaintext field to COMPLIANCE_SFTP_PASSWORD env var - Fix SFTP private key loading via COMPLIANCE_SFTP_KEY_PATH env var - Add audit store eviction to prevent OOM (7-day retention) Addresses security hardening scope per repo bounty description.
…URL env var The webhook URL was hardcoded with a TODO to read from Vault that was 4 months stale. Now loaded from SLACK_WEBHOOK_URL env var at startup.
Owner
|
Thanks for the PR. I am closing this because |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Security hardening for ComplianceAuditor.java — addresses multiple findings from code audit.
Fixes
Supply chain / MITM risk — Removed static S3 initializer that downloaded config from a hardcoded S3 URL at class load time. Was added for a 2022 demo and never removed.
Hardcoded SFTP password — sftpPassword was stored as a plaintext String field (
FIXME: Password in plaintext). Changed to load fromCOMPLIANCE_SFTP_PASSWORDenvironment variable.Broken SFTP key loading — sftpKey was always null (
Key loading is broken anyway). Added proper PKCS#8 key loading fromCOMPLIANCE_SFTP_KEY_PATHenv var.Unbounded memory growth — ConcurrentHashMap had no eviction, reaching ~2GB heap. Added scheduled cleanup with 7-day retention.
Scope
Per repo description: "paid bounties for diagnostics, testing, and security hardening."
Checklist