Add bonus documentation for Rails encrypted secrets

This commit is contained in:
Shiva Chethan Reddy
2026-01-11 13:06:41 +05:30
parent 9fc406f860
commit 39bc3ed974
3 changed files with 142 additions and 0 deletions
+11
View File
@@ -1,4 +1,15 @@
# frozen_string_literal: true
# NOTE:
# RailsGoat intentionally uses an insecure approach for key management.
# This is done to demonstrate bad practices for educational purposes.
#
# In real-world Rails applications:
# - Rails 5.1 supports encrypted secrets via config/secrets.yml
# - Rails 5.2+ supports encrypted credentials via credentials.yml.enc
# - Secrets are commonly provided via environment variables (ENV)
#
# Hardcoding keys or omitting secure secret management must NEVER be done
# in production applications.
if Rails.env.production?
# Specify env variable/location/etc. to retrieve key from
else