Secure Software Design & Development - Lecture 15 & 16
Secure Software Design & Development - Lecture 15 & 16
Lecture 15 & 16
Threat
● Risk Reduction: By identifying and addressing potential threats early in the development lifecycle, the risk of security
breaches and vulnerabilities is significantly reduced.
● Cost-Efficiency: Addressing security issues during the design phase is more cost-effective than fixing them
post-deployment.
● Compliance: Helps organizations meet regulatory and compliance requirements by ensuring that security measures
are integrated into the software development process.
● Enhanced Security Awareness: Promotes a culture of security awareness among development teams, leading to
better security practices and behaviors.
Risk Assessment Process
● Ranking Threats: Prioritize threats based on organizational objectives, compliance, regulatory requirements, and
security exposures.
● Prioritization: Plan countermeasures for newly identified threats to mitigate risks effectively.
Identifying Threats:
● Iterative-Structured Technique: Break down software into physical and logical constructs to generate detailed
artifacts.
● Generated Artifacts:
a. Data Flow Diagrams: Visual representations of how data moves through the system, including inputs, outputs,
and processing components.
b. Deployment Scenarios: Descriptions of how the software is deployed in various environments, such as
development, testing, and production.
c. Entry/Exit Points: Identification of where data enters and exits the system, including user interfaces, APIs, and
network interfaces.
d. Protocols: Specification of communication protocols used within the system, such as HTTP, TCP/IP, or custom
protocols.
e. Components: Enumeration of software components, modules, and libraries used in the system, along with
their functionalities and dependencies.
f. Identities: Identification of users, roles, and permissions within the system, including authentication and
authorization mechanisms.
g. Services: Description of services provided by the system, including internal and external interfaces, endpoints,
and communication channels.
Risk Assessment Process
Attack Surface Analysis:
SPOOFING: TEMPERING:
▪Impact related to Authentication ▪Impact related to Integrity
▪Pretending to be someone or something other ▪Modifying something on disk, memory or
than yourself somewhere
(Damage Potential)
● 0 = Nothing
● 3 = Individual user data is compromised or affected or availability denied
● 5 = A subset of data is compromised or affected or availability denied
● 7 = All data is compromised or affected, or its availability denied
● 7 = Availability of a specific component/service is denied
● 8 = Availability of all components is denied
● 9 = Underlying infrastructure data is compromised or affected
● 10 = Complete system or data destruction, failure, or compromise
DREAD
(Reproducibility)
● 0 = Very hard or impossible, even for administrators. The vulnerability is unstable or statistically
unlikely to be reliably exploited.
● 5 = Some extra steps are required; tooling/scripting readily available.
● 10 = Unauthenticated users can trivially and reliably exploit using only a Web browser.
DREAD
(Exploitability)
● 0 = N/A (The assertion here is that every vulnerability is exploitable, given time and effort. All scores
should be 1–10.)
● 1 = Even with direct knowledge of the vulnerability, we do not see a viable path for exploitation.
● 2 = Advanced techniques are required, bespoke tooling. Only exploitable by authenticated users.
● 5 = Exploit is available/understood, usable with only moderate skill by authenticated users.
● 7 = Exploit is available/understood, usable by non-authenticated users.
● 10 = Trivial—just a web browser.
DREAD
(Affected Users)
● 0 = None
(Discoverability)
● 0 = Very hard to impossible to detect even given access to source code and privilege access to
running systems.
● 5 = Can figure it out by guessing or by monitoring network traces.
● 9 = Details of faults like this are already in the public domain and can be easily discovered
using a search engine.
● 10 = The information is visible in the web browser address bar or in a form.
Risk Assessment (General)
Steps to perform Risk Assessment:
● Damage:
○ WannaCry encrypted files on infected systems, rendering them inaccessible to users.
○ It caused significant disruption to businesses, hospitals, and other organizations, impacting their ability to
operate effectively.
○ Many victims lost access to critical data and systems, leading to financial losses and reputational
damage.
● Reproducibility:
○ The WannaCry attack was highly reproducible due to its use of a known vulnerability in the Windows
operating system (EternalBlue exploit).
○ Attackers could easily replicate the attack by scanning for vulnerable systems and deploying the
ransomware payload.
● Exploitability:
○ The exploit used by WannaCry (EternalBlue) was relatively easy to use and did not require advanced
technical skills.
○ Tools for exploiting the vulnerability were readily available online, making it accessible to a wide range of
attackers.
Example: DREAD - Wannacry
● Affected Users:
○ WannaCry affected hundreds of thousands of systems worldwide, including computers in hospitals,
businesses, and government organizations.
○ The widespread impact of the attack resulted in a large number of affected users, ranging from individual
users to large enterprises.
● Discoverability:
○ The vulnerability exploited by WannaCry (EternalBlue) was publicly disclosed months before the attack.
○ While security patches were available, many organizations failed to apply them promptly, leaving their
systems vulnerable to exploitation.
○ The attack was discovered relatively quickly after it began, but by then, it had already infected a significant
number of systems.
Example: DREAD - Wannacry
Based on this analysis, we can assign scores to each factor on a scale of 0 to 10:
Damage: 9
Reproducibility: 10
Exploitability: 8
Affected Users: 10
Discoverability: 7
Now, we can calculate the overall risk score using the formula:
Risk = (9 + 10 + 8 + 10 + 7) / 5 = 8.8
So, the overall risk score for the WannaCry attack is 8.8 out of 10, indicating a high level of risk associated with this threat.
Risk Assessment (Based on MITRE)
Steps to perform Risk Assessment:
Attack path phase Risk = (Damage + Reproducibility + Exploitability + Affected Users + Discoverability) / 5
Risk = Sum of expected Risk of each phase of an attack path / Total number of phases of an attack path
Example: DREAD - Wannacry - MITRE
WannaCry Adversary Tactics and Techniques in MITRE ATT&CK:
Impact Inhibit System Recovery WMIC.exe can be used to delete all volume shadow
copies on a system
Defense Evasion File and Directory WannaCry uses attrib +h to make some of its files
Permissions Modification hidden and uses icacls . /grant Everyone:F /T /C /Q to
grant all users full access controls.
Command and Control Proxy -> Multi-hop Proxy Use Tor nodes for command and control traffic
Impact Service Stop Stopping critical services can inhibit or stop response to
an incident or aid in the adversary's overall objectives to
cause damage to the environment.
Example: DREAD - Wannacry - MITRE
WannaCry uses attrib +h to make some of ● Damage Potential (7): Modifying file permissions hides critical
its files hidden and uses icacls . /grant files and grants full access to all users, potentially compromising
Everyone:F /T /C /Q to grant all users full system integrity and confidentiality.
access controls.
● Reproducibility (8): The use of attrib +h and icacls commands can
● Tech: File and Directory Permissions be easily replicated across multiple files and directories.
Modification ● Exploitability (8): Executing attrib and icacls commands requires
● Impact: basic command-line knowledge but can be carried out with
● Damage Potential: 7 moderate effort.
● Reproducibility: 8 ● Affected Users (8): All users with access to the affected files and
● Exploitability: 8 directories may be impacted by unauthorized access or system
● Affected Users: 8 compromise.
● Discoverability: 7 ● Discoverability (7): Changes to file permissions may be detected
● Risk: (7 + 8 + 8 + 8 + 7) / 5 = 7.6 during security audits or file integrity checks.
Example: DREAD - Wannacry - MITRE
Attack Path: Command & Control
Tor nodes are used for command and ● Damage Potential (8): Modifying file permissions hides critical
control traffic. files and grants full access to all users, potentially compromising
system integrity and confidentiality.
● Tech: Proxy ● Reproducibility (8): The use of attrib +h and icacls commands can
● Impact: be easily replicated across multiple files and directories.
● Damage Potential: 8 ● Exploitability (9): Executing attrib and icacls commands requires
● Reproducibility: 8 basic command-line knowledge but can be carried out with
● Exploitability: 9 moderate effort.
● Affected Users: 7 ● Affected Users (7): All users with access to the affected files and
● Discoverability: 7 directories may be impacted by unauthorized access or system
● Risk: (8 + 8 + 9 + 7 + 7) / 5 = 7.8 compromise.
● Discoverability (7): Changes to file permissions may be detected
during security audits or file integrity checks.
Example: DREAD - Wannacry - MITRE
Attack Path: Impact
● Damage Potential (9): Stopping critical services can lead to
significant disruption of operations, potentially causing financial
Critical services are stopped to inhibit loss or reputational damage.
incident response or cause damage. ● Reproducibility (7): Stopping critical services may require specific
knowledge of the system's architecture and dependencies,
● Tech: Stop Service
limiting its reproducibility.
● Impact:
● Exploitability (8): Exploiting vulnerabilities to stop critical services
● Damage Potential: 9
may require advanced technical skills but can be achieved with
● Reproducibility: 7
persistence.
● Exploitability: 8
● Affected Users (9): All users relying on the affected services may
● Affected Users: 9
experience downtime or loss of functionality, impacting
● Discoverability: 6
productivity and service delivery.
● Risk: (9 + 7 + 8 + 9 + 6) / 5 = 7.8
● Discoverability (6): Detection of service stoppage may vary
depending on monitoring and alerting capabilities in place, but
unusual service disruptions may trigger investigation.
Example: DREAD - Wannacry - MITRE
Attack Path: Impact -> Defense Evasion -> C&C -> Impact
Now, let's calculate the overall risk by averaging the risks for each attack path:
So, the overall risk for this attack, calculated using the DREAD model, is approximately 7.65.