Harden security, rewrite docs for public release#3
Open
blackaxgit wants to merge 1 commit intomainfrom
Open
Conversation
Security fixes in app/main.py: - Sanitize output_prefix to prevent path traversal - Fix AUTO streaming mode (was always buffering entire file) - Add FFmpeg subprocess timeouts (FFMPEG_TIMEOUT_SECONDS=300) - Add separate ffprobe timeout (FFPROBE_TIMEOUT_SECONDS=30) - Validate chunk_size_mb range (0.1-500) and output_format - Cap max chunks per request (MAX_CHUNKS=1000) - Sanitize error messages with correlation IDs (no stderr leak) - Consolidate temp dir cleanup into finally block - Fix realpath symlink mismatch on macOS Infrastructure hardening: - Dockerfile: add non-root user (appuser:1000) and HEALTHCHECK - Helm: automount:false, readOnlyRootFilesystem:true, /tmp emptyDir - Helm: add NetworkPolicy (ingress 8000/TCP, egress 53/UDP) - Remove dead STREAMING_THRESHOLD_MB from all files Documentation: - Rewrite README with API docs, error responses, config table, Helm values, and accurate n8n integration instructions - Add CONTRIBUTING.md and .env.example - Harden .gitignore with Helm/Docker override patterns - Sanitize n8n workflow UUIDs to placeholder zeros
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 Fixes
output_prefixapp/main.pyapp/main.pyapp/main.pychunk_size_mbapp/main.pyapp/main.pyoutput_formatnot validatedapp/main.pyDockerfilevalues.yamlTest plan
docker build -t audio-splitter:test .succeedsdocker run --rm audio-splitter:test idshowsuid=1000(appuser)curl POST /splitwith valid audio returns 200 with base64 chunkscurl POST /split -F output_prefix=../../etc/passwdsanitizes prefixcurl POST /split -F chunk_size_mb=0.01returns 400 (below minimum)curl POST /split -F output_format=exe -F same_as_input=falsereturns 400helm templaterenders NetworkPolicy, automount:false, readOnlyRootFilesystem:truehelm template --set networkPolicy.enabled=falseexcludes NetworkPolicyn8n-test-flow/audio-splitter-workflow.json🤖 Generated with Claude Code