Secrets and Attacks

Secrets and Attacks: Keeping Secrets Out of Your Code, The Attacks to Expect: Injection and Mass Assignment.

Updated

  1. Keeping Secrets Out of Your Code (Journeyman): A secret typed into the code goes wherever the code goes, GitHub included, so an API reads its secrets from environment variables, keeps them in a .env file that .gitignore leaves out, commits a .env.example instead, stops at startup when one is missing, and rotates any secret that was ever pushed.
  2. The Attacks to Expect: Injection and Mass Assignment (Journeyman): An API online gets requests no app of yours would send, so it keeps typed text out of its SQL with placeholders, takes only the fields a person may change with a model that forbids extras, answers errors without their inner details, and checks its packages for known holes with pip-audit.