ATVM & Infra Training Content Day - 3
ATVM & Infra Training Content Day - 3
Day 3
LTI 22-09-2023
Introduction to Threat Modeling and
Risk Assessment
. 2
Introduction to Threat Modeling and Risk Assessment
3
Best Practices for Mobile App Security Testing
Importance in Cybersecurity:
Threat modeling and risk assessment are fundamental components of cybersecurity because they help organizations
anticipate and prepare for security threats. The importance of these processes can be summarized as follows
• Proactive Security: Threat modeling and risk assessment enable organizations to take proactive measures to protect their
systems and data. By identifying vulnerabilities and potential threats in advance, they can address these issues before they
are exploited.
• Resource Allocation: These processes help organizations allocate their resources efficiently. By assessing the risks
associated with various assets and vulnerabilities, organizations can prioritize security efforts and investments based on the
most significant threats.
• Compliance and Regulations: Many industries and sectors have regulatory requirements for cybersecurity. Threat modeling
and risk assessment help organizations comply with these regulations by demonstrating due diligence in identifying and
mitigating risks.
• Incident Response: Understanding potential threats and their impact is crucial for developing effective incident response
plans. Organizations can plan how to react to specific threats based on their assessed risks.
• Continuous Improvement: Threat modeling and risk assessment are not one-time activities; they are ongoing processes.
Regular reviews and updates ensure that organizations adapt to evolving threats and maintain strong security postures.
4
Best Practices for Mobile App Security Testing
5
Benefits of Threat Modelling
• Proactive Security: Threat modeling helps organizations identify security risks before they can be exploited, enabling proactive
security measures.
• Cost-Efficiency: By focusing resources on addressing the most critical threats, organizations can allocate their security budgets
more effectively.
• Enhanced Decision-Making: It provides valuable insights that support informed decision-making about security investments and
risk management.
• Improved Security Posture: Organizations can strengthen their security controls and policies based on the findings of threat
modeling, reducing the likelihood of security breaches.
• Compliance: Threat modeling helps organizations meet regulatory requirements by demonstrating due diligence in identifying and
addressing security risks.
6
Introduction to Secure Code Review
• Why Secure Code Review Matters: In this section, you should elaborate on the significance of secure code review. Discuss the
prevalence of cyber threats, data breaches, and the potential consequences for organizations and users. Emphasize how secure
code review plays a pivotal role in identifying and mitigating vulnerabilities early in the development process.
• Secure Code Review Process: Outline the key stages and steps involved in a secure code review. This section should give readers
an overview of the process they can expect to follow when conducting a secure code review.
• Preparing for Code Review: Explain what should be done before diving into the code review process. This may include setting up the
necessary tools and environments, assembling the review team, and establishing review guidelines and objectives.
• Code Review Execution: Detail the actual execution of the code review. This section should cover how the review team assesses the
code, identifies vulnerabilities, and communicates findings. It might also touch on the collaborative aspect of the review process.
• Post-Review Actions: Discuss the actions that should be taken after completing the code review. This could involve documenting
findings, prioritizing and categorizing vulnerabilities, and communicating feedback to the development team for remediation.
7
Common Vulnerabilities to Look For
1. Injection Attacks:
Injection attacks occur when untrusted data is sent to an interpreter as part of a command or query. The attacker's input is
treated as code, allowing them to manipulate the application's behavior. Common types of injection attacks include SQL
injection and command injection. Secure code reviews should identify and address instances where user inputs are not
properly validated or sanitized before being used in code execution.
8
Common Vulnerabilities to Look For
5. Insecure Dependencies:
Insecure dependencies refer to vulnerabilities in third-party libraries or components used in the application. These
vulnerabilities can be exploited to compromise the security of the entire application. Secure code reviews should include an
assessment of the dependencies used in the codebase, checking for known security vulnerabilities and ensuring that
libraries are kept up to date with security patches.
9
Secure Coding Practices
Secure coding practices are a set of guidelines and principles that developers follow to write software code that is robust,
resilient to security threats, and less prone to vulnerabilities and exploits. These practices are essential for building software
that can withstand the constant barrage of cyber threats in today's digital landscape. Here's an explanation of some key
secure coding practices:
• Input Validation and Sanitization: Validate and sanitize all user inputs to ensure they conform to expected formats and do
not contain malicious data. This helps prevent common vulnerabilities like SQL injection and Cross-Site Scripting (XSS).
• Authentication and Authorization: Implement strong authentication mechanisms, such as multi-factor authentication (MFA),
to verify the identity of users. Ensure that users have the appropriate authorization to access specific resources or perform
certain actions within the application.
• Session Management: Securely manage user sessions by using secure tokens, expiring sessions after a period of inactivity,
and protecting session data from tampering or hijacking.
• Error Handling and Logging: Implement proper error handling to provide minimal information to users in case of errors. Log
errors and events securely, avoiding the exposure of sensitive information that could be exploited by attackers.
• Data Encryption: Encrypt sensitive data at rest (e.g., in databases) and in transit (e.g., using HTTPS). Use strong encryption
algorithms and key management practices to protect data confidentiality.
10
Secure Coding Practices
• Secure Password Storage: Hash and salt passwords before storing them in databases. Implement password policies that
encourage strong passwords and protect against brute-force attacks.
• Security Updates and Patch Management: Keep all software components, including libraries and frameworks, up to date
with security patches. Vulnerabilities in outdated software can be exploited by attackers.
• Secure File Handling: Implement strict file upload and download controls. Validate file types and scan uploaded files for
malware. Store uploaded files in a secure location with restricted access.
• Avoid Hardcoding Secrets: Avoid hardcoding sensitive information like API keys, passwords, or cryptographic keys directly
in the code. Use secure storage mechanisms or environment variables to manage such secrets.
• Security Testing: Regularly conduct security testing, including vulnerability scanning, penetration testing, and code reviews.
This helps identify and address security weaknesses before they can be exploited.
11
Tools and Techniques for Secure Code Review
Static analysis tools, also known as Static Application Security Testing (SAST) tools, are automated tools that analyze source
code, bytecode, or binary code without executing the program. They scan the codebase for patterns, vulnerabilities, and
potential issues. Key points to note:
• How They Work: Static analysis tools perform a deep analysis of the codebase, looking for known security vulnerabilities,
code smells, and adherence to coding standards.
• Advantages: They can identify issues early in the development process, are helpful for large codebases, and provide a
consistent analysis without requiring code execution.
• Common Findings: SAST tools can detect issues like SQL injection, Cross-Site Scripting (XSS), insecure authentication, and
more.
12
Tools and Techniques for Secure Code Review
Dynamic analysis tools, also known as Dynamic Application Security Testing (DAST) tools, operate by executing the software
and interacting with it to identify vulnerabilities while it's running. Key points:
• How They Work: DAST tools interact with the application, simulating various attack scenarios to discover vulnerabilities that
can be exploited during runtime.
• Advantages: They provide insights into vulnerabilities that may only become apparent in a live environment and can identify
issues related to the configuration of web servers, databases, and other components.
• Common Findings: DAST tools can discover issues like input validation problems, misconfigurations, and session
management flaws.
13
Tools and Techniques for Secure Code Review
Manual code review involves human code examiners who carefully inspect the source code line by line, looking for security
issues, design flaws, and adherence to secure coding practices. Key points:
• How It Works: Experienced reviewers analyze the code, assess coding patterns, and search for vulnerabilities that
automated tools might miss. They also evaluate code against coding standards.
• Advantages: Manual code reviews are highly effective for uncovering complex vulnerabilities, logic flaws, and security
architecture issues. They can provide context-specific insights.
• Common Findings: Manual code reviewers can identify a wide range of vulnerabilities, including those specific to the
application's business logic.
14
Example of Secure Code Review
Imagine you are reviewing the source code of a web application that allows users to post comments on articles. Users can
submit comments, and these comments are displayed to other users on the article pages. The application uses a database to
store comments and retrieve them for display.
15
Step-by-Step Code Review Process
1. Review Input Validation: Check how user input (comments) is validated before being stored in the database. Ensure that
input is properly sanitized to prevent SQL injection attacks. Verify that user input is also validated for content and length to
prevent potential issues like excessively long comments.
2. Check Database Queries: Examine the database queries used to retrieve and display comments. Ensure that queries are
parameterized or use prepared statements to prevent SQL injection. Look for any direct concatenation of user input into SQL
queries.
3. Validate Authentication and Authorization: Review the code to confirm that only authenticated users can post comments.
Ensure that users can only edit or delete their own comments. Check for proper access controls to prevent unauthorized
access to comment-related functionality.
4. Address Cross-Site Scripting (XSS): Examine how comments are displayed on the web pages. Confirm that user-generated
content is properly escaped to prevent XSS attacks. Look for any instances where user-generated JavaScript code may
execute within the page.
5. Identify Sensitive Data Handling: Review how sensitive data, such as user session information, is stored and managed.
Ensure that sensitive data is encrypted or hashed when stored in the database.
16
Vulnerability Discovery
During the code review, you discover the following security vulnerability:
Vulnerability: Cross-Site Scripting (XSS)
Description: The application does not properly escape user-generated content when displaying comments, allowing malicious
users to inject malicious scripts that can execute within the context of other users' browsers.
Vulnerability Remediation:
To remediate the discovered XSS vulnerability, you propose the following fixes
• Implement proper input validation and content sanitization to ensure that user-generated content is free from malicious
scripts.
• Utilize a security library or framework to automatically escape user-generated content when rendering it in HTML,
preventing XSS attacks.
• Educate the development team about secure coding practices and the importance of input validation and output encoding to
prevent XSS vulnerabilities.
• Conduct a security training session to increase awareness among developers about the risks associated with XSS and other
common vulnerabilities.
17
Introduction to Software Composition
Analysis and Free and Open Source
Software
18
Software Composition Analysis (SCA)
Definition:
Software Composition Analysis (SCA) is a process and a set of tools used in software development to identify, assess, and manage
third-party and open-source software components (dependencies) integrated into a software application. SCA helps organizations
gain visibility into the components used, their licenses, vulnerabilities, and overall health, ensuring that software projects are
secure, compliant, and high-quality.
19
Software Composition Analysis (SCA)
3. Vulnerability Management:
Explanation: SCA tools scan components for known security vulnerabilities and provide insights into potential risks.
Importance: Proactive vulnerability assessment helps identify and address security issues early, reducing the likelihood of security
breaches.
4. Quality Assurance:
Explanation: SCA assesses the overall quality of components, identifying outdated, deprecated, or problematic elements.
Importance: By removing or updating problematic components, SCA contributes to a more stable and reliable software application.
5. Risk Mitigation:
Explanation: SCA addresses licensing and security concerns, reducing the risk of legal disputes, security breaches, and project
delays.
Importance: It minimizes exposure to potential threats, safeguards the integrity of the software, and preserves the organization's
reputation.
6. Efficient Development:
Explanation: SCA assists developers in making informed decisions about which components to use, keeping components up to date
with the latest features and security patches.
20
Software Composition Analysis (SCA)
Importance: This ensures that the software remains competitive, secure, and well-maintained throughout its lifecycle.
Emphasis on Managing Third-Party Components:
• Explanation: SCA places a significant emphasis on managing third-party components because modern software
development increasingly relies on these components. Leveraging third-party code accelerates development, but it also
introduces potential risks and challenges related to licensing, security, and quality. Managing these components is crucial to:
• Transparency: Providing transparency into the software's composition, ensuring developers and organizations understand
what they are using.
• License Compliance: Ensuring that organizations are aware of and compliant with open-source licenses to avoid legal
complications.
• Security Assurance: Identifying and addressing security vulnerabilities in third-party components proactively.
• Risk Reduction: Mitigating the risk of legal disputes, security incidents, and project delays.
• Quality Improvement: Enhancing the overall quality and reliability of the software by identifying and addressing subpar
components.
21
Free and Open Source Software (FOSS)
Free and Open Source Software (FOSS), often referred to as Open Source Software (OSS), is a category of software that is
defined by its accessibility, licensing, and collaborative development model. Here are its key characteristics:
Source Code Accessibility: FOSS provides open access to its source code, allowing anyone to view, study, modify, and
distribute it. This transparency fosters collaboration and innovation.
Free Distribution: FOSS can be freely obtained, used, copied, and shared. Users are not required to pay licensing fees, making
FOSS accessible to a wide range of users and organizations.
Modifiability and Adaptation: Users have the freedom to modify and customize FOSS to suit their specific needs. This
adaptability empowers users to tailor the software to their requirements.
22
Free and Open Source Software (FOSS)
No Discrimination: FOSS licenses typically prohibit discrimination against persons or groups. This ensures that FOSS is
accessible to all without any restrictions based on factors like nationality, race, gender, or field of endeavor.
No Restrictive Licensing: FOSS licenses often do not impose restrictions on the use of the software. Users can employ FOSS
for various purposes, including commercial and non-commercial projects.
Community Collaboration: FOSS projects are often developed and maintained by a community of volunteers and contributors.
This collective effort results in ongoing development, support, and improvement of the software.
23
Introduction to Infrastructure Vulnerability
Assessment Testing-Tools and Technique
24
Definition and Importance
Infrastructure vulnerability assessment is a systematic process of identifying, quantifying, and prioritizing vulnerabilities in
an organization's IT infrastructure, networks, systems, applications, and physical assets. The primary goal is to proactively
identify weaknesses that could be exploited by malicious actors and to take appropriate measures to mitigate these
vulnerabilities before they can be leveraged for attacks.
Importance:
Infrastructure vulnerability assessment is crucial for several reasons:
Security Enhancement: By identifying vulnerabilities, organizations can take corrective actions to strengthen their security
posture, reducing the risk of security breaches and data compromises.
Compliance: Many regulatory standards and industry best practices require regular vulnerability assessments as part of a
comprehensive security program. Compliance with these standards is essential for avoiding penalties and maintaining
customer trust.
25
Definition and Importance
Risk Management: Understanding vulnerabilities allows organizations to assess the level of risk associated with their
infrastructure. This risk assessment guides decision-making about resource allocation for security improvements.
Cost Savings: Addressing vulnerabilities proactively is often more cost-effective than dealing with the aftermath of a security
breach, which can result in financial losses, legal liabilities, and reputation damage.
26
Objectives of Vulnerability Assessment
27
Vulnerability Assessment Techniques
Vulnerability assessment techniques are essential tools and methods used to identify and evaluate vulnerabilities in an
organization's infrastructure. These techniques help security professionals pinpoint weaknesses and prioritize remediation
efforts. Here, we'll explore three primary vulnerability assessment techniques:
Network Scanning
Definition: Network scanning is the process of identifying active devices, open ports, and services running on a network. It
involves sending requests to networked devices and analysing their responses to create an inventory of assets and their
associated vulnerabilities.
Key Characteristics:
• Non-Intrusive: Network scanning is typically non-intrusive, meaning it doesn't actively exploit vulnerabilities but rather
collects information about the network's configuration and services.
• Automation: Scanning tools automate the process, making it efficient for large-scale network assessments.
• Asset Discovery: It helps discover devices that may not be documented in an organization's inventory, reducing the risk of
shadow IT.
• Port and Service Identification: Network scanning identifies open ports and services, allowing security teams to assess their
security posture.
28
Benefits
• Comprehensive Network Visibility: Network scanning provides a comprehensive view of the network, helping organizations
understand their attack surface.
• Early Warning: It can detect new devices or changes in the network, offering early warnings of potential security issues.
• Asset Management: Network scanning aids in asset management by maintaining an up-to-date inventory of networked
devices.
29
Vulnerability Scanning
Definition: Vulnerability scanning is a systematic process of identifying security vulnerabilities in software, systems, and networks.
Unlike network scanning, it focuses on the assessment of vulnerabilities rather than the discovery of devices and services.
Key Characteristics:
• Database of Vulnerabilities: Vulnerability scanning tools use extensive databases of known vulnerabilities to compare against the
target systems and applications.
• Scheduled Scans: Vulnerability scans can be scheduled regularly to ensure ongoing vulnerability assessment.
• Patch Management: They often integrate with patch management systems to facilitate vulnerability remediation.
• Severity Rating: Vulnerability scanners provide severity ratings to help organizations prioritize remediation efforts.
Benefits:
• Thorough Assessment: Vulnerability scanning evaluates systems and applications for known vulnerabilities, providing detailed
reports on the findings.
• Automated Remediation: Some vulnerability scanners offer automated remediation steps, streamlining the patching process.
• Risk Reduction: By identifying and addressing vulnerabilities, organizations reduce the risk of exploitation and security breaches.
30
Manual Testing
Definition: Manual testing involves a hands-on, human-led approach to identifying vulnerabilities. Security professionals use their
expertise and creativity to explore potential weaknesses in systems, applications, and network configurations.
Key Characteristics:
• In-Depth Analysis: Manual testing allows for in-depth analysis, going beyond what automated tools can identify.
• Custom Tests: Testers can develop custom test scenarios to simulate real-world attack scenarios.
• Exploratory: Manual testing often involves exploratory techniques, trying different attack vectors and scenarios to uncover
vulnerabilities.
Benefits:
• Uncover Zero-Day Vulnerabilities: Manual testing may identify vulnerabilities that are not in the databases of automated scanners,
including zero-day vulnerabilities.
• Real-World Simulation: Testers can simulate real-world attack scenarios, providing a more accurate assessment of the
organization's security posture.
• Customized Approach: Manual testing can be customized to the specific needs and risks of the organization.
• Considerations: Manual testing can be time-consuming, resource-intensive, and may not cover as much ground as automated
techniques. It is often used in conjunction with automated scanning to provide a comprehensive assessment.
31
Vulnerability Assessment Tools
Vulnerability assessment tools play a critical role in identifying and mitigating vulnerabilities within an organization's
infrastructure. These tools vary in terms of capabilities, cost, and ease of use. Here, we'll explore two categories of
vulnerability assessment tools: commercial tools and open-source tools.
Commercial Tools
Commercial vulnerability assessment tools are developed and sold by cybersecurity companies. These tools often come with
comprehensive feature sets, technical support, and enhanced capabilities. Some well-known commercial vulnerability
assessment tools include:
1. Qualys Vulnerability Management
Key Features:
Cloud-based solution for scanning and managing vulnerabilities.
Comprehensive vulnerability assessment, including web application scanning and network scanning.
Continuous monitoring and tracking of assets.
Integration with other security solutions.
Reporting and compliance features.
32
Vulnerability Assessment Tools
2. Tenable Nessus
Key Features:
Extensive vulnerability database.
Network and web application scanning.
Agent-based and agentless scanning options.
Compliance checks and reporting.
Integration with SIEM and other security tools.
3. Rapid7 Nexpose
Key Features:
Asset discovery and classification.
Vulnerability scanning for networks, databases, and web applications.
Risk prioritization based on severity.
Remediation workflows.
Integration with vulnerability management processes.
33
Vulnerability Assessment Tools
34
Open Source Tools
Open-source vulnerability assessment tools are freely available for use and can be modified and customized by the user
community. They are a cost-effective option for organizations with limited budgets. Here are some popular open-source
vulnerability assessment tools:
35
Open Source Tools
2. Nikto
Key Features:
Web server and web application scanner.
Detects various web vulnerabilities, including outdated software, misconfigurations, and common issues.
Command-line interface for automation.
Suitable for web application security testing.
36
Open Source Tools
4. Wireshark
Key Features:
Network protocol analyzer.
Captures and analyzes network traffic to identify security issues and vulnerabilities.
Offers deep packet inspection capabilities.
Useful for network troubleshooting and security analysis.
37
Case Study
38
Case Study: Infrastructure Vulnerability
Assessment in a Healthcare Organization
Organization Profile:
• Name: HealthGuard Medical Center
• Type: Healthcare organization
• Scope: Hospital with multiple departments, patient data management systems, and medical equipment.
• Objective: To perform a comprehensive infrastructure vulnerability assessment to ensure the security and integrity of
patient data, maintain compliance with healthcare regulations, and safeguard critical medical equipment.
Challenges:
HealthGuard Medical Center faced several challenges related to the security and integrity of its infrastructure:
• Data Security: Protecting sensitive patient data, including electronic health records (EHRs), was paramount to comply with
Health Insurance Portability and Accountability Act (HIPAA) regulations.
• Medical Device Vulnerabilities: The hospital had a wide range of medical equipment connected to the network, and
vulnerabilities in these devices posed a significant risk.
• Compliance: Ensuring compliance with HIPAA regulations and industry-specific security standards was essential for
avoiding legal and financial penalties.
39
Vulnerability Assessment Process
40
Vulnerability Assessment Process
3. Vulnerability Assessment
• Risk Prioritization: Vulnerabilities were prioritized based on their severity, potential impact, and relevance to healthcare
operations.
• Remediation Planning: A detailed remediation plan was developed, specifying actions for addressing each vulnerability.
• Patch Management: Immediate patching was performed for critical vulnerabilities without disrupting patient care.
• configuration Changes: Misconfigurations were rectified to enhance security.
41
Vulnerability Assessment Process
Results:
HealthGuard Medical Center successfully identified and remediated critical vulnerabilities, reducing the risk of data breaches
and ensuring patient data security.
The hospital achieved and maintained compliance with HIPAA regulations and industry-specific security standards.
Ongoing vulnerability assessments and continuous monitoring were established to sustain the security posture.
42
Thank You
43