AdministrationConfiguration 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:
secretSessionKey: session secret
encryptionKey: my-secret-keyProperty 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
secretSessionKey: session secret
encryptionKey: my-secret-keyProduction Configuration
secretSessionKey: 'a-very-long-random-secret-key-for-sessions'
encryptionKey: 'another-very-long-random-secret-key-for-encryption'Generating Secure Keys
For production environments, you should generate secure random keys:
Using OpenSSL
# Generate a 32-character random string
openssl rand -base64 32
# Generate a 64-character random string
openssl rand -hex 32Using Node.js
# Generate a random string using Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('hex'));"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:
echo $NODE_ENVTesting Configuration Changes
After modifying security configuration:
-
Restart the application:
./gig stop ./gig start -
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.