Week 9 Secure Software Development
Week 9 Secure Software Development
Software
Development
What does Secure Design in Software Development
mean?
Separation of Duties
(SoD) is about dividing No user should have a
4. Separation of tasks and privileges to level of access that
Duties minimize the risk of allows them to misuse a
malicious activity or system on their own.
errors..
7 Principles of Secure Design in Software Development
Complete mediation
mandates that every access
request to any system
6. Complete Mediation resource is thoroughly
authenticated and authorized.
This should happen every
time, without exception.
7 Principles of Secure Design in Software Development
Why is Code
Review Improved
Quality of Code
Code
Ownership
Quality
Assurance
important?
Knowledge
Continuous
Consistency Sharing and
Improvement
Learning
Types of Code Review
Types of Code Review
Pull Request (PR) Reviews: In Git-based version control systems like GitHub, etc.,
developers often create pull or merge requests to propose changes to the codebase.
These pull requests are reviewed by the team members before the changes are merged.
Pair Programming: In pair programming, two developers work together on the same
computer, with one writing code while the other reviewing it in real time. This form of code
review is highly interactive.
Over-the-Shoulder Reviews: A developer may ask a team member to review their code by
physically sitting together and going through the code on the computer screen.
Tool-Assisted Reviews: Various tools and platforms are available to facilitate code reviews,
such as GitHub, GitLab, Bitbucket, and code review-specific tools like Crucible and Review
Board.
Types of Code Review
Email-Based Review: In email-based reviews, code changes are sent via email, and the
reviewers provide feedback and comments in response. The discussion occurs over email
threads.
Checklist Review: In a checklist review, a checklist is used to evaluate the code. Reviewers
go through the list and check off items as they are reviewed.
Ad Hoc Review: Ad hoc reviews are informal and spontaneous. Developers may
spontaneously ask team members to take a quick look at their code or discuss changes
without a formal process.
Formal Inspection: Formal inspections are a structured form of code review that follows a
predefined process. They often involve a dedicated inspection team and detailed
documentation.
Code Review Process
Code Review Process
7. Discussion: The author and reviewers 9. Revisions: The author makes necessary
engage in a discussion about the code changes based on the feedback received
changes. This dialogue can involve and continues to engage in discussions until
clarifications, explanations, and suggestions all concerns are addressed. This may involve
for improvement. multiple review iterations.
Code Review Process
10. Approval: Once reviewers are 11. Integration: The approved code
satisfied with the code changes and all changes are integrated into the main
concerns have been resolved, they codebase, typically using version
approve the code for integration. control systems.
Threat modeling also provides a clear ‘line of sight’ across a project that can be
used to justify other security efforts.
Purpose of Threat Modeling
Threat Here, we will deal with what we are going to build. We must
have a document overview of the application which helps in
Modeling making our process easier. Here we will build diagrams that
will help us in making our process easier.
Process
It can be done in two ways:
• Data Flow Diagram: It helps in showing how the flow of data occurs in the
system.
• Process Flow Diagram: It helps in finding the process of the system that from
where users interact in the system, and how the system works internally.
3. Threat Identification
Here we are going to deal with how we can identify threats or what
can go wrong in the process.
Threat
Modeling By analyzing the images of the previous section, you have found how
threats can be identified.
Process
4. Mitigation
Here, we are going to deal with what we will do about the Threats.
Here we will review the layers to identify the required vulnerabilities.
Threat
Modeling
Process This is the final step in the process of
Threat Modeling, here we are going to
deal with whether we have done a good
job or not.
1. STRIDE:
PASTA is a risk-centric methodology that aims to simulate potential attacks to assess the risk
posed by different threats. It’s designed to be a high-level approach to understanding the
attacker’s perspective.
PASTA consists of seven stages:
• Define the objectives of the analysis.
• Identify the attack surface.
• Identify threats and vulnerabilities.
• Perform risk analysis.
• Simulate attacks to assess the real-world impact.
• Define mitigation strategies.
• Reevaluate and improve the system.
Popular Threat Modeling Methodologies:
OCTAVE is a strategic threat modeling methodology that emphasizes the organizational risk
management perspective.
Unlike other methodologies that focus primarily on technology, OCTAVE takes into account the people,
processes, and assets involved in the system.
Phase 1: Build Asset-Based Threat Profiles: Identify assets, security requirements, and business
processes.
Phase 2: Identify and Analyze Threats: Identify threats and vulnerabilities to assets, including potential
adversaries and attack scenarios.
Phase 3: Develop Security Strategy: Develop a risk-based security plan and mitigation strategy to
protect critical assets.
Popular Threat Modeling Methodologies:
VAST was created to address the need for visual and agile threat modeling, especially
in environments where systems are constantly evolving. It focuses on simplifying the
process and integrating threat modeling into agile development practices.
• Visual Threat Modeling: Creates visual models to identify potential threats. These diagrams often show data
flows, components, and interactions in easy-to-understand formats.
• Agility: VAST integrates with agile software development practices, allowing for continuous assessment of
risks as the system evolves.
• Simplicity: Aims to avoid overwhelming teams with unnecessary complexity, making threat modeling more
accessible for developers, business stakeholders, and security teams.
Popular Threat Modeling Methodologies:
5. LINDDUN
It is tailored for assessing data privacy threats rather than just security threats.
Attack Tree Analysis is a hierarchical model used to represent attacks on a system as a tree,
with the goal of breaking down the attack into simpler sub-goals. Each node represents an
attack step, and the leaves of the tree are basic attack methods or techniques.
Key components:
• Root Node: Represents the high-level goal or objective of the attack (e.g., gaining unauthorized access to a system).
• Sub-Goals: Nodes representing steps to achieve the root goal (e.g., exploiting a vulnerability, bypassing
authentication).
• Leaf Nodes: Specific attack techniques or actions (e.g., using stolen credentials, exploiting a bug).
The choice of threat modeling methodology largely depends on the context of
your system and objectives:
PASTA is suited for
STRIDE is great for identifying
organizations that want to take
general threats and is widely
a risk-centric approach,
applicable to many kinds of
especially for large, complex
systems.
systems.