Software Security and Privacy by Design Guidelines

This guideline provides practical, step-by-step guidance for embedding security and privacy principles into software development. It aims to ensure that government software systems are secure, resilient, and protect personal data throughout their entire lifecycle.

Introduction

This guideline provides practical, step-by-step guidance for embedding security and privacy principles into software development. It aims to ensure that government software systems are secure, resilient, and protect personal data throughout their entire lifecycle.

With increasing digitalization of government services, the Government of Rwanda (GoR) recognized the need for a standardized approach to software security and privacy. This guideline consolidates the principles of Privacy by Design (PbD) and Security by Design, aligning with Law No 058/2021 on Data Protection and national minimum cybersecurity standards. It was developed to promote proactive, consistent, and auditable practices across all government software projects.

Objectives

This guideline aims to provide clear, actionable instructions to embed security and privacy into software systems used by the Government of Rwanda. It seeks to:

Intended outcomes

Following this guideline, users should be able to:

Scope

What this guideline covers

This guideline applies to all software systems developed, acquired, deployed, or maintained by Government of Rwanda (GoR) institutions. It provides step-by-step instructions, controls, and best practices for embedding privacy and security throughout the software lifecycle, including:

What this guideline does not cover

Applicable departments and roles

Target Audience Roles and Responsibilities

Key roles include:

List of Abbreviations

Core Principles

Combine the foundational Privacy by Design (PbD) principles with Security-by-Design objectives into a unified set:

Minimum Security and Privacy Controls

Software development lifecycle step-by-step guidance

Below are phase-by-phase actions, mandatory deliverables and practical checklists to guide implementation.

Software development lifecycle step-by-step guidance

Initiation

Goal: Establish security and privacy expectations and identify risks before design work begins.

Actions:

  1. Appoint project sponsor, system owner and security lead.
  2. Perform initial Threat and Privacy Risk Assessment (documented).
  3. Define security and privacy objectives of CIA, non-repudiation and legal requirements.
  4. Draft a Security and Privacy Plan with milestones, roles and budget for security activities.
  5. Require security awareness briefing for project stakeholders.
Software development lifecycle step-by-step guidance

Requirements and acquisition

Goal: Ensure requirements include explicit privacy and security criteria.

  1. Define functional, privacy and security requirements. Include purpose limitation and data minimization requirements.
  2. Conduct Privacy Impact Assessment (PIA) and update risk register. 
  3. Translate risks into measurable security requirements like encryption, RBAC, logging and retention. 
  4. For procurement: include security clauses, acceptance criteria and tender security evaluation.
  5. For third parties: require evidence of prior security audits and contractual data protection obligations.
Software development lifecycle step-by-step guidance

Architecture and design

Goal: Design an architecture that enforces privacy and security by construction.

  1. Produce security architecture diagrams showing trust boundaries, data flows and classification.
  2. Apply Data Flow Mapping and Data Classification (sensitive vs non-sensitive).
  3. Embed privacy controls: data minimization, consent capture points, and user-facing 
  4. Specify encryption, key management, segmentation, and secure default configurations. 
  5. Plan for logging, monitoring, and auditability (what to log, how long, who has access).
  6. Document fallback modes and failure behaviors to avoid privacy leaks or insecure defaults.
Software development lifecycle step-by-step guidance

Development

Goal: Implement secure, privacy-aware code and configurations.

  1. Adopt secure coding standards (OWASP, CERT) and include them in the definition of done. 
  2. Use automated static analysis (SAST), dependency scanning and secret detection in CI/CD pipelines.
  3. Enforce strong access controls for development environments and use separate secrets management.
  4. Perform regular code reviews focused on security and privacy by identifying hard-coded secrets and data exposures.
  5. Implement privacy-enhancing techniques (pseudonymization, tokenization) where feasible. 
  6. Maintain secure build and deployment scripts; avoid embedding credentials in code.
Software development lifecycle step-by-step guidance

Testing

Goal: Verify security and privacy controls work as intended.

  1. Create a security test plan covering unit, integration, system, and acceptance tests.
  2. Include privacy test cases validating consent, data minimization, and access controls. 
  3. Conduct vulnerability scanning and dynamic application security testing (DAST).
  4. Arrange independent penetration testing for critical systems and production environments. 
  5. Perform usability testing to ensure privacy settings and notices are clear and actionable.
  6. Run regression tests after patches and new features to prevent reintroducing vulnerabilities.
Software development lifecycle step-by-step guidance

Deployment

Goal: Deploy securely with correct configurations, access controls and monitoring in place.

  1. Apply secure configuration baselines and hardening to servers, databases and network devices. 
  2. Enforce RBAC and configure least privilege for all accounts; set up MFA for admin accounts.
  3. Enable and protect audit logging; ensure log storage and retention meet policy requirements.
  4. Conduct a production penetration test and address critical findings before go-live. 
  5. Publish privacy notices and provide user controls for consent and data management. 
  6. Establish monitoring and alerting (IDS/IPS, SIEM) and define on-call incident responders.
Software development lifecycle step-by-step guidance

Operations and Maintenance

Goal: Sustain security and privacy posture throughout operations.

  1. Maintain a schedule for vulnerability scanning, patch management, and configuration reviews.
  2. Conduct periodic privacy and security control reviews and update PIAs as needed. 
  3. Ensure change management enforces security reviews and testing before changes are applied.
  4. Continue training for administrators and users; run phishing and awareness programs.
  5. Keep data retention schedules and securely sanitize or delete data when no longer required.
  6. Keep an incident response plan current and conduct tabletop exercises regularly.
Software development lifecycle step-by-step guidance

Upgrade / Decommission

Goal: Safely retire or replace systems while preserving required records and preventing data leakage.

  1. Plan archival or migration of records according to legal retention requirements.
  2. Sanitize media and verify secure deletion of sensitive data using approved methods. 
  3. Revoke access, disable accounts and remove credentials tied to decommissioned systems.
  4. Update documentation to reflect where data was moved and how it can be accessed or destroyed.
  5. Notify stakeholders and offer users guidance to export or delete their data where applicable. 

Security Incident Management

Key steps:

  1. Prepare: maintain an incident response plan with roles, communication trees, and escalation criteria.
  2. Detect and report: ensure monitoring, logging and clear internal reporting channels.
  3. Classify: use severity levels (critical, major, minor) and assign appropriate response teams. 
  4. Contain and eradicate: isolate affected systems and remove root causes.
  5. Recover: restore services from trusted backups and validate integrity.
  6. Post-incident: perform root-cause analysis, update risk registers, and publish lessons learned.

Awareness, Training and Best Practices

Provide role-specific training and general awareness sessions. 

Topics should include:

Compliance, Audit and Continuous Improvement

Schedule regular audits, internal and external assessments, and maintain documented evidence for compliance. Update controls and PIAs when legal/regulatory or threat landscapes change. Use KPIs (e.g: time-to-patch, vulnerabilities found vs remediated) to drive improvements.

References