Security Guidelines

Field Details
Status Active
Last Updated 05-11-2026

Purpose

To protect sensitive data and maintain secure coding practices across all applications


Scope

Applies to: All developers, all codebases, all environments from 2026

Does not apply to: Public documentation


Environment Variables & Secrets

Never Commit Secrets

  • Never push .env files to version control
  • Add .env to .gitignore immediately
  • Use .env.example with dummy values for reference
# .gitignore
.env
.env.local
.env.production

Secure Storage

  • Use different credentials for development and production
  • Rotate credentials regularly

Incident Response

If a Secret is Exposed

  1. Immediately notify your team lead
  2. Revoke the exposed credential
  3. Generate new credentials
  4. Update all services using the credential
  5. Document the incident

Time is critical - act within minutes, not hours.


Coding Practices

Follow Industry Standards

  • Keep dependencies updated
  • Use parameterized queries to prevent SQL injection
  • Validate and sanitize all user inputs
  • Never trust client-side validation alone
  • Implement proper authentication and authorization

Common Vulnerabilities to Avoid

// Never do this
const query = `SELECT * FROM users WHERE id = ${userId}`;

// Do this instead
const query = 'SELECT * FROM users WHERE id = ?';
db.query(query, [userId]);

Password Handling

  • Never store passwords in plain text
  • Use bcrypt or related packages for hashing
  • Enforce minimum password complexity
  • Never log passwords
// Good practice
const hashedPassword = await bcrypt.hash(password, 10);

API Security

  • Always authenticate API requests
  • Use rate limiting to prevent abuse
  • Never expose sensitive data in API responses
  • Log security events for audit trails

Exceptions

Security practices have no exceptions - they apply everywhere



Changelog

Version Date Author Change
1.0.0 05-11-2026 Tibin Sunny Initial version