Skip to content

Security Conventions

This document outlines the security conventions for the Hatchgrid project. All contributors are expected to follow these guidelines to ensure that the application is secure.

Security is a top priority for the Hatchgrid project. We are committed to protecting the data of our users and to providing a secure and reliable service.

  • We use a standard authentication mechanism, such as OAuth 2.0 or JWT.
  • The authentication token should be included in the Authorization header of the request.
  • We enforce strong password policies.
  • We use multi-factor authentication (MFA) to provide an extra layer of security.
  • We use a role-based access control (RBAC) model to control access to resources.
  • The user’s role should be included in the authentication token.
  • We enforce the principle of least privilege.
  • We validate all input from the client to prevent common vulnerabilities, such as SQL injection, cross-site scripting (XSS), and command injection.
  • We use a whitelist approach to input validation.
  • We encode all output to the client to prevent cross-site scripting (XSS) attacks.
  • We use a standard output encoding library, such as the OWASP Java Encoder.
  • We use strong cryptography to protect sensitive data, such as passwords and credit card numbers.
  • We use a standard cryptography library, such as the Java Cryptography Architecture (JCA).
  • We handle errors in a consistent way and return appropriate error responses.
  • We do not expose sensitive information in error messages.
  • We log all security-related events, such as login attempts, failed login attempts, and access control failures.
  • The logs are stored in a secure location and are reviewed regularly.
  • We use a dependency management tool, such as npm or Maven, to manage our dependencies.
  • We use a dependency scanner, such as npm audit or OWASP Dependency-Check, to scan our dependencies for known vulnerabilities.
  • We keep our dependencies up to date.
  • We perform regular security testing to identify and fix security vulnerabilities.
  • We use a combination of static analysis security testing (SAST), dynamic analysis security testing (DAST), and manual penetration testing.