Skip to main content

Security

Purpose

This page documents the security requirements and operational controls for the Maqsafy platform.

Security controls should cover authentication, authorization, data protection, audit logging, tenant isolation, network security, secure configuration, and monitoring.

Security References

The Maqsafy dashboard SRS requires TLS 1.2+, encryption at rest, secured credential identifiers, RBAC, tenant isolation, audit logs, rate limiting, and brute-force protection.

Recommended security references:

  • OWASP ASVS for application security verification requirements.
  • OWASP Top 10 for common web application security risks.
  • NIST SP 800-53 Rev. 5 for security and privacy control catalog.

Authentication Security

ControlRequirement
Secure loginAll dashboard users must authenticate securely
Password resetPassword reset must follow a controlled workflow
MFAMFA should be available for Admin and sensitive financial actions
Failed login protectionRepeated failed attempts should be rate-limited
Session protectionSession tokens must not be exposed in logs or URLs

Authorization and RBAC

The system must enforce role-based access control across all dashboard actions and API endpoints.

RoleSecurity Scope
AdminPlatform-wide control with audit requirements
School ManagerAssigned school scope only
SupplierSupplier-specific scope only
OperatorAssigned cafeteria/operator scope only

Tenant Isolation

Tenant isolation is mandatory.

Rules:

  • Schools must not access other schools' data.
  • Suppliers must not access other suppliers' records.
  • Operators must only access assigned cafeteria/operator records.
  • Backend queries must enforce scope-based filtering.
  • Reports and exports must respect user permissions.

Data Protection

Data TypeProtection Rule
PasswordsMust be hashed, never stored in plain text
Access tokensMust not be logged or exposed
OTP valuesMust not be logged or documented
Student dataMust be minimized and access-controlled
Financial recordsMust be auditable and protected
Credential identifiersShould be secured, tokenized, or hashed where feasible

Network Security

ControlRequirement
TLSProduction traffic must use TLS 1.2 or higher
HTTPSPublic endpoints must use HTTPS
Internal servicesDatabase and Redis must not be publicly exposed
Reverse proxyNginx or equivalent proxy should enforce secure routing
FirewallOnly required ports should be exposed

API Security

API endpoints must enforce:

  • Authentication
  • Authorization
  • Input validation
  • Rate limiting
  • Tenant isolation
  • Secure error handling
  • Audit logging for sensitive actions

Sensitive Actions

The following actions should be audited:

  • Login failures
  • User role changes
  • Financial approvals
  • Refund actions
  • Withdrawal approvals
  • Credential assignment
  • Credential deactivation
  • Credential replacement
  • Exporting sensitive reports
  • Integration configuration changes

Audit Logging

Audit logs should include:

FieldDescription
ActorUser or system performing the action
ActionWhat was changed or executed
TimestampWhen the action occurred
ScopeSchool, supplier, operator, or platform scope
Before / AfterPrevious and new values, where applicable
Reference IDTraceable identifier for support and investigation

Logging Rules

  • Do not log passwords.
  • Do not log access tokens.
  • Do not log OTP values.
  • Do not log private keys.
  • Do not log full card, bracelet, or credential secrets.
  • Do not log unnecessary student personal data.
  • Logs must support troubleshooting without exposing sensitive data.

Secure Configuration

Production configuration rules:

  • APP_DEBUG=false
  • Secrets must be stored outside source code.
  • Production .env files must not be committed to Git.
  • Default passwords must not be used.
  • Unused services and ports must be disabled.
  • Error messages must not expose stack traces to end users.

Dependency Security

Rules:

  • Review package vulnerabilities.
  • Update dependencies based on risk and compatibility.
  • Avoid unsupported packages.
  • Test updates before production deployment.
  • Do not apply breaking dependency upgrades directly to production.

File Upload Security

For uploads such as support attachments, invoices, or images:

  • Restrict allowed file types.
  • Enforce file size limits.
  • Store files securely.
  • Do not execute uploaded files.
  • Scan files where applicable.
  • Restrict access based on role and scope.

Backup Security

  • Backups must be access-controlled.
  • Backup files should be encrypted where applicable.
  • Restore access must be limited to authorized personnel.
  • Backup download links must not be public.
  • Backup retention rules must be documented.

Incident Response Notes

For security incidents:

  1. Identify the affected system.
  2. Preserve relevant logs.
  3. Restrict access if needed.
  4. Rotate affected credentials.
  5. Patch the root cause.
  6. Verify the fix.
  7. Document the incident and corrective actions.

Security Rules

  • Do not include real secrets in documentation.
  • Do not include production credentials.
  • Do not include real tokens.
  • Do not include private keys.
  • Do not include customer personal data.
  • Use placeholders for all sensitive examples.