Full Transcript

Secure Programming Review â–ª Risk Control Strategies â–ª Mitigation Techniques â–ª Incident Response plan â–ª Disaster Recovery plan â–ª Business Continuity plan â–ª Introduction to C/C++ Secure Programming 2 Threats â–ª A threat is an object, person, or o...

Secure Programming Review â–ª Risk Control Strategies â–ª Mitigation Techniques â–ª Incident Response plan â–ª Disaster Recovery plan â–ª Business Continuity plan â–ª Introduction to C/C++ Secure Programming 2 Threats â–ª A threat is an object, person, or other entity that represents a constant danger to an asset â–ª Management must be informed of the various kinds of threats facing the organization â–ª By examining each threat category in turn, management effectively protects its information through policy, education and training, and technology controls Threat Modeling Secure Programming 3 Threat Modeling â–ª Theoretical use cases considered to identify potential threats. attack â–ª Microsoft STRIDE â–ª S: Spoofing of identity â–ª T: Tampering with data â–ª R: Repudiation â–ª I: Information disclosure â–ª D: Denial of service â–ª E: Elevation of privilege â–ª Requires realization of Assets and Vulnerabilities Secure Programming 4 Threat Modeling â–ª Spoofing of Identity: A user pretends to be someone else by stealing login credentials (e.g., phishing attacks). â–ª Mitigation: Use multi-factor authentication (MFA) to ensure the real user is logging in. â–ª Tampering with Data: An attacker intercepts and modifies data in transit (e.g., changing a bank transaction amount). â–ª Mitigation: Use encryption (like HTTPS) to secure data in transit. â–ª Repudiation: A user denies performing an action without a way for the system to prove it (e.g., denying that they transferred money). â–ª Mitigation: Implement secure logging that cannot be altered to provide evidence of actions. â–ª Information Disclosure: Sensitive information (e.g., personal data) is exposed to unauthorized individuals (e.g., a data breach). â–ª Mitigation: Encrypt sensitive data and apply access controls. Secure Programming 5 Threat Modeling â–ª Denial of Service (DoS): The system becomes unavailable due to an overload of requests (e.g., a DDoS attack). â–ª Mitigation: Use rate limiting and deploy web application firewalls to prevent overwhelming traffic. â–ª Elevation of Privilege: A user gains higher privileges than allowed (e.g., a normal user becomes an admin). â–ª Mitigation: Ensure proper role-based access control (RBAC) and limit privilege escalation paths. Secure Programming 6 Attack Surface Mapping â–ª Attack surfaces are different points that an unauthorized user can employ to compromise a system/ network/ solution. â–ª Each attack surface has its associated risk, likelihood and impact. â–ª Source of input maybe HW, SW/FW, Communication â–ª Mapping out all entry points an attacker can abuse in IoT device. â–ª Involves creating an architecture diagram â–ª Tests performed based on priority â–ª Priority = ease of exploitation * impact of exploitation Secure Programming 7 Attack Surface Mapping Process Labelling Preparing Listing all components & architecture components communication diagram b/w them Identify attack vectors Rating attack vectors Secure Programming 8 Attack Surface Mapping Process â–ª Listing all components: Identify components such as: â–ª Web server , Application server, Database server, Front-end user interface (UI), Third-party APIs â–ª Preparing an architecture diagram: Draw a diagram showing: â–ª The web server communicating with the application server â–ª The application server connecting to the database â–ª External third-party APIs that interact with the application â–ª Labeling components & communication: Label each interaction, such as: â–ª HTTP requests between the web server and users â–ª SQL queries between the application server and database â–ª API requests between the application and third-party services Secure Programming 9 Attack Surface Mapping Process â–ª Identifying attack vectors: Identify possible attack points, such as: â–ª SQL Injection through user input â–ª Cross-Site Scripting (XSS) through the user interface â–ª Man-in-the-middle attack during API communication â–ª Rating attack vectors: Assign a priority to each attack vector: â–ª SQL Injection (high impact, easy to exploit) = High priority â–ª Cross-Site Scripting (medium impact, moderate difficulty) = Medium priority â–ª Man-in-the-middle attack (high impact, harder to exploit) = Medium priority Secure Programming 10 Attack Surface Mapping â–ª E.g. Samsung smart things kit Courtesy: IoT hackers Secure Programming cookbook by Aditya Gupta 11 Threats to Information Security Secure Programming 12