Skip to content

chore: implement security best practices (Docker hardening, configurable CORS, sanitized logs)#948

Open
RinZ27 wants to merge 1 commit intocrestalnetwork:mainfrom
RinZ27:chore/security-best-practices
Open

chore: implement security best practices (Docker hardening, configurable CORS, sanitized logs)#948
RinZ27 wants to merge 1 commit intocrestalnetwork:mainfrom
RinZ27:chore/security-best-practices

Conversation

@RinZ27
Copy link

@RinZ27 RinZ27 commented Feb 27, 2026

Description

Implemented several security best practices to harden the application:

  • Docker Hardening: Switched to a non-root user (appuser) in the runtime stage. This minimizes the risk of container escape and follows the principle of least privilege.
  • Configurable CORS: Replaced the hardcoded allow_origins=["*"] with a configurable config.cors_allow_origins. Users can now specify allowed domains via the CORS_ALLOW_ORIGINS environment variable (comma-separated). It still defaults to * to maintain current behavior.
  • Log Sanitization: Removed raw response.text from Privy RPC error logs. These bodies can contain sensitive metadata or tokens which should not be stored in logs.

Type of Change

  • Improvement

Checklist

  • I have read the contributing guidelines.
  • I have added tests to cover my changes. (N/A)
  • All new and existing tests passed. (Verified with ruff)

@RinZ27 RinZ27 force-pushed the chore/security-best-practices branch from 37f7d08 to 311b8ba Compare February 27, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant