Administration/Configuration Files
Security Configuration
Configure security-related settings for your Gigantics instance, including session keys and encryption.
Configuration Properties
The security configuration properties in your config/default.yaml file control session management and data encryption:
Property Details
secretSessionKey
- Type: String
- Default:
'session secret' - Description: Secret key used for signing session cookies. Should be a random, unique string in production.
encryptionKey
- Type: String
- Default:
'my-secret-key'(development) or randomly generated (production) - Description: Key used for encrypting sensitive data in the application.
Examples
Development Configuration
Production Configuration
Generating Secure Keys
For production environments, you should generate secure random keys:
Using OpenSSL
Using Node.js
Best Practices
- Unique Keys: Use different keys for
secretSessionKeyandencryptionKey - Key Length: Use at least 32 characters for each key
- Randomness: Generate keys using cryptographically secure random generators
- Storage: Store keys securely and never commit them to version control
- Environment: Use different keys for development, staging, and production environments
- Rotation: Regularly rotate encryption keys in production environments
Environment-Specific Configuration
The application automatically uses different default keys based on the environment:
- Development: Uses fixed default keys for convenience
- Production: Generates random keys for security
- Test: Uses test-specific keys
You can check your environment with:
Testing Configuration Changes
After modifying security configuration:
-
Restart the application:
-
Users may be logged out and need to re-authenticate
-
Test that sessions work properly
-
Verify that encrypted data can still be decrypted
Note that changing encryption keys may make previously encrypted data unreadable, so be careful when rotating keys in production.