Statistics
14
Views
0
Downloads
0
Donations
Support
Share
Uploader

高宏飞

Shared on 2026-06-16

AuthorPeter A. Carter

Protect your data from attack by using SQL Server technologies to implement a defense-in-depth strategy for your database enterprise. This new edition covers threat analysis, common attacks and countermeasures, and provides an introduction to compliance that is useful for meeting regulatory requirements such as the GDPR. The multi-layered approach in this book helps ensure that a single breach does not lead to loss or compromise of confidential, or business sensitive data. Database professionals in today’s world deal increasingly with repeated data attacks against high-profile organizations and sensitive data. It is more important than ever to keep your company’s data secure. Securing SQL Server demonstrates how developers, administrators and architects can all play their part in the protection of their company’s SQL Server enterprise. This book not only provides a comprehensive guide to implementing the security model in SQL Server, including coverage of technologies such as Always Encrypted, Dynamic Data Masking, and Row Level Security, but also looks at common forms of attack against databases, such as SQL Injection and backup theft, with clear, concise examples of how to implement countermeasures against these specific scenarios. Most importantly, this book gives practical advice and engaging examples of how to defend your data, and ultimately your job, against attack and compromise. What You'll Learn • Perform threat analysis • Implement access level control and data encryption • Avoid non-reputability by implementing comprehensive auditing • Use security metadata to ensure your security policies are enforced • Mitigate the risk of credentials being stolen • Put countermeasures in place against common forms of attack Who This Book Is For Database administrators who need to understand and counteract the threat of attacks against their company’s data, and useful for SQL developers and architects

AI Reading Assistant

Summary and highlights from this book's index; jump to passages in the text

Passage locations
Tags
No tags
ISBN: 1484241606
Publisher: Apress
Publish Year: 2018
Language: 英文
Pages: 354
File Format: PDF
File Size: 10.4 MB
Support Statistics
¥.00 · 0times
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Securing SQL Server DBAs Defending the Database — Second Edition — Peter A. Carter
Securing SQL Server DBAs Defending the Database Second Edition Peter A. Carter
Securing SQL Server: DBAs Defending the Database ISBN-13 (pbk): 978-1-4842-4160-8 ISBN-13 (electronic): 978-1-4842-4161-5 https://doi.org/10.1007/978-1-4842-4161-5 Library of Congress Control Number: 2018963673 Copyright © 2018 by Peter A. Carter This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein. Managing Director, Apress Media LLC: Welmoed Spahr Acquisitions Editor: Jonathan Gennick Development Editor: Laura Berendson Coordinating Editor: Jill Balzano Cover image designed by Freepik (www.freepik.com) Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer- sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc. is a Delaware corporation. For information on translations, please e-mail rights@apress.com, or visit http://www.apress.com/ rights-permissions. Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales. Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book’s product page, located at www.apress.com/9781484241608. For more detailed information, please visit http://www.apress.com/source-code. Printed on acid-free paper Peter A. Carter London, UK
This book is for Danielle Carter–my favorite Disney villain
v About the Author ����������������������������������������������������������������������������������������������������� xi About the Technical Reviewer ������������������������������������������������������������������������������� xiii Acknowledgments ���������������������������������������������������������������������������������������������������xv Introduction �����������������������������������������������������������������������������������������������������������xvii Table of Contents Part I: Database Security �������������������������������������������������������������������������������� 1 Chapter 1: Threat Analysis and Compliance ������������������������������������������������������������� 3 Threat Modeling ���������������������������������������������������������������������������������������������������������������������������� 4 Understanding Threat Modeling ���������������������������������������������������������������������������������������������� 4 Identifying Assets �������������������������������������������������������������������������������������������������������������������� 6 Creating an Architecture Overview ������������������������������������������������������������������������������������������ 6 Creating a Security Profile ������������������������������������������������������������������������������������������������������� 9 Identifying Threats ����������������������������������������������������������������������������������������������������������������� 11 Rating Threats ����������������������������������������������������������������������������������������������������������������������� 13 Creating Countermeasures ���������������������������������������������������������������������������������������������������� 17 Compliance Considerations �������������������������������������������������������������������������������������������������������� 18 Introducing SOX for SQL Server ��������������������������������������������������������������������������������������������� 19 Introducing GDPR For SQL Server ����������������������������������������������������������������������������������������� 20 Summary������������������������������������������������������������������������������������������������������������������������������������� 20 Chapter 2: SQL Server Security Model �������������������������������������������������������������������� 23 Security Principal Hierarchy �������������������������������������������������������������������������������������������������������� 24 Instance Level Security ��������������������������������������������������������������������������������������������������������������� 26 Logins ������������������������������������������������������������������������������������������������������������������������������������ 27 Server Roles �������������������������������������������������������������������������������������������������������������������������� 35 Credentials ���������������������������������������������������������������������������������������������������������������������������� 39
vi Database-Level Security ������������������������������������������������������������������������������������������������������������� 39 Users ������������������������������������������������������������������������������������������������������������������������������������� 39 Database Roles ���������������������������������������������������������������������������������������������������������������������� 47 Summary������������������������������������������������������������������������������������������������������������������������������������� 49 Chapter 3: SQL Server Audit ����������������������������������������������������������������������������������� 51 Understanding SQL Server Audit ������������������������������������������������������������������������������������������������� 51 SQL Server Audit Actions and Action Groups ������������������������������������������������������������������������� 52 Implementing SQL Server Audit �������������������������������������������������������������������������������������������������� 64 Creating a Server Audit���������������������������������������������������������������������������������������������������������� 64 Create a Server Audit Specification ��������������������������������������������������������������������������������������� 70 Create a Database Audit Specification ���������������������������������������������������������������������������������� 71 Creating Custom Audit Events ����������������������������������������������������������������������������������������������������� 74 Creating the Server Audit and Database Audit Specification ������������������������������������������������� 74 Raising the Event ������������������������������������������������������������������������������������������������������������������� 75 Summary������������������������������������������������������������������������������������������������������������������������������������� 76 Chapter 4: Data-Level Security ������������������������������������������������������������������������������� 77 Schemas ������������������������������������������������������������������������������������������������������������������������������������� 77 Ownership Chaining �������������������������������������������������������������������������������������������������������������������� 80 Impersonation ����������������������������������������������������������������������������������������������������������������������������� 83 Row-Level Security ��������������������������������������������������������������������������������������������������������������������� 85 Security Predicates ��������������������������������������������������������������������������������������������������������������� 86 Security Policies �������������������������������������������������������������������������������������������������������������������� 87 Implementing RLS ����������������������������������������������������������������������������������������������������������������� 87 Dynamic Data Masking ��������������������������������������������������������������������������������������������������������������� 91 Summary������������������������������������������������������������������������������������������������������������������������������������� 96 Chapter 5: Encryption in SQL Server ���������������������������������������������������������������������� 97 Generic Encryption Concepts ������������������������������������������������������������������������������������������������������ 97 Defense in Depth ������������������������������������������������������������������������������������������������������������������� 97 Symmetric Keys��������������������������������������������������������������������������������������������������������������������� 98 Table of ConTenTs
vii Asymmetric Keys ������������������������������������������������������������������������������������������������������������������� 98 Certificates ���������������������������������������������������������������������������������������������������������������������������� 98 Self-Signed Certificates ��������������������������������������������������������������������������������������������������������� 98 Windows Data Protection API ������������������������������������������������������������������������������������������������ 98 SQL Server Encryption Concepts ������������������������������������������������������������������������������������������������ 99 Master Keys ��������������������������������������������������������������������������������������������������������������������������� 99 EKM and Key Stores ������������������������������������������������������������������������������������������������������������ 102 SQL Server Encryption Hierarchy ���������������������������������������������������������������������������������������� 102 Encrypting Data ������������������������������������������������������������������������������������������������������������������������ 103 Encrypting Data With a Password or Passphrase ���������������������������������������������������������������� 103 Encrypting Data with Keys and Certificates ������������������������������������������������������������������������ 109 Transparent Data Encryption ����������������������������������������������������������������������������������������������������� 114 Considerations for TDE With Other Technologies ����������������������������������������������������������������� 115 Implementing TDE ��������������������������������������������������������������������������������������������������������������� 116 Administering TDE ��������������������������������������������������������������������������������������������������������������� 118 Always Encrypted ��������������������������������������������������������������������������������������������������������������������� 119 Implementing Always Encrypted ����������������������������������������������������������������������������������������� 121 Summary����������������������������������������������������������������������������������������������������������������������������������� 130 Chapter 6: Security Metadata ������������������������������������������������������������������������������� 133 Security Principal Metadata ������������������������������������������������������������������������������������������������������ 133 Finding a User’s Effective Permissions ������������������������������������������������������������������������������� 134 Securable Metadata ������������������������������������������������������������������������������������������������������������������ 137 Code Signing ����������������������������������������������������������������������������������������������������������������������� 138 Permissions Against a Specific Table ���������������������������������������������������������������������������������� 141 Audit Metadata �������������������������������������������������������������������������������������������������������������������������� 142 Encryption Metadata ����������������������������������������������������������������������������������������������������������������� 145 Always Encrypted Metadata ������������������������������������������������������������������������������������������������ 145 TDE Metadata ���������������������������������������������������������������������������������������������������������������������� 148 Credentials Metadata ���������������������������������������������������������������������������������������������������������������� 152 Table of ConTenTs
viii Securing Metadata �������������������������������������������������������������������������������������������������������������������� 154 Risks of Metadata Visibility ������������������������������������������������������������������������������������������������� 156 Summary����������������������������������������������������������������������������������������������������������������������������������� 157 Chapter 7: Implementing Service Accounts for Security �������������������������������������� 159 Service Account Types �������������������������������������������������������������������������������������������������������������� 159 Virtual Accounts ������������������������������������������������������������������������������������������������������������������� 160 Managed Service Accounts ������������������������������������������������������������������������������������������������� 161 SQL Server Services ����������������������������������������������������������������������������������������������������������������� 162 How Service Accounts Can Become Compromised ������������������������������������������������������������������ 171 Designing a Pragmatic Service Account Strategy ��������������������������������������������������������������������� 172 Summary����������������������������������������������������������������������������������������������������������������������������������� 174 Chapter 8: Protecting Credentials ������������������������������������������������������������������������ 175 Protecting the sa Account ��������������������������������������������������������������������������������������������������������� 175 DBA Steps to Mitigate the Risks ���������������������������������������������������������������������������������������� 176 Protecting User Accounts ���������������������������������������������������������������������������������������������������������� 188 Auditing Passwords Susceptible to Word List Attacks ��������������������������������������������������������� 189 Protecting Windows Accounts ��������������������������������������������������������������������������������������������������� 191 Summary����������������������������������������������������������������������������������������������������������������������������������� 192 Chapter 9: Reducing the Attack Surface �������������������������������������������������������������� 193 Network Configuration �������������������������������������������������������������������������������������������������������������� 193 Understanding Ports and Protocols ������������������������������������������������������������������������������������� 193 Firewall Requirements for SQL Server �������������������������������������������������������������������������������� 199 Miscellaneous Considerations �������������������������������������������������������������������������������������������������� 205 Ensuring that Unsafe Features Remain Disabled ���������������������������������������������������������������������� 206 Configuring the Surface Area Manually ������������������������������������������������������������������������������� 207 Managing Features With Policy-Based Management ���������������������������������������������������������� 208 Summary����������������������������������������������������������������������������������������������������������������������������������� 216 Table of ConTenTs
ix Part II: Threats and Countermeasures �������������������������������������������������������� 219 Chapter 10: SQL Injection ������������������������������������������������������������������������������������� 221 Preparing the Environment ������������������������������������������������������������������������������������������������������� 221 Performing SQL Injection Attacks ��������������������������������������������������������������������������������������������� 230 Spoofing a User Identity ������������������������������������������������������������������������������������������������������ 230 Using SQL Injection to Leak Information ����������������������������������������������������������������������������� 232 Destructive Attacks�������������������������������������������������������������������������������������������������������������� 236 Attacking the Network ��������������������������������������������������������������������������������������������������������� 238 Preventing SQL Injection Attacks ���������������������������������������������������������������������������������������������� 240 Using an Abstraction Layer �������������������������������������������������������������������������������������������������� 241 Access via Stored Procedures Only ������������������������������������������������������������������������������������� 242 Summary����������������������������������������������������������������������������������������������������������������������������������� 244 Chapter 11: Hijacking an Instance������������������������������������������������������������������������ 247 Hijacking an Instance ���������������������������������������������������������������������������������������������������������������� 247 Protecting Against Hijacking ����������������������������������������������������������������������������������������������������� 252 Understanding Logon Triggers ��������������������������������������������������������������������������������������������� 253 Using Logon Triggers to Prevent Instance Hijacking ����������������������������������������������������������� 254 Understanding Server Agent ������������������������������������������������������������������������������������������������ 260 Putting it all Together����������������������������������������������������������������������������������������������������������� 273 Summary����������������������������������������������������������������������������������������������������������������������������������� 274 Chapter 12: Database Backup Theft ��������������������������������������������������������������������� 275 Overview of Backups ���������������������������������������������������������������������������������������������������������������� 275 Recovery Modes ������������������������������������������������������������������������������������������������������������������ 275 Backup Types ����������������������������������������������������������������������������������������������������������������������� 279 Backup Media ���������������������������������������������������������������������������������������������������������������������� 280 Securing Backup Media ������������������������������������������������������������������������������������������������������������ 284 Physical Security ����������������������������������������������������������������������������������������������������������������� 284 Encrypting Backups ������������������������������������������������������������������������������������������������������������� 285 Table of ConTenTs
x Attempting to Steal an Encrypted Backup �������������������������������������������������������������������������������� 295 Administrative Considerations for Encrypted Backups ������������������������������������������������������������� 302 Key Management ����������������������������������������������������������������������������������������������������������������� 302 Backup Size ������������������������������������������������������������������������������������������������������������������������� 303 Summary����������������������������������������������������������������������������������������������������������������������������������� 306 Chapter 13: Code Injection ����������������������������������������������������������������������������������� 307 Understanding Code Injection ��������������������������������������������������������������������������������������������������� 307 Understanding EXECUTE AS ������������������������������������������������������������������������������������������������� 308 Using EXECUTE AS to Perform a Code Injection Attack ������������������������������������������������������� 310 Protecting Against Code Injection ��������������������������������������������������������������������������������������������� 312 DevOps �������������������������������������������������������������������������������������������������������������������������������� 313 Using Policy-Based Management to Protect Against Code Injection ����������������������������������� 313 Code Signing ����������������������������������������������������������������������������������������������������������������������������� 321 Summary����������������������������������������������������������������������������������������������������������������������������������� 324 Chapter 14: Whole Value Substitution Attacks ����������������������������������������������������� 325 Understanding Whole Value Substitution Attacks ��������������������������������������������������������������������� 325 Salary Manipulation Example ���������������������������������������������������������������������������������������������� 326 Credit Card Fraud Example �������������������������������������������������������������������������������������������������� 329 Protecting Against Whole Value Substitution Attacks���������������������������������������������������������������� 332 Performance Considerations ����������������������������������������������������������������������������������������������������� 335 Summary����������������������������������������������������������������������������������������������������������������������������������� 339 Index ��������������������������������������������������������������������������������������������������������������������� 341 Table of ConTenTs
xi About the Author Peter A. Carter is an SQL Server expert with over 15 years’ experience in database development, administration, and platform engineering. He is currently a consultant based in London. Peter has written several books across a variety of SQL Server topics, including security, high availability, automation, administration, and working with complex data types.
xiii About the Technical Reviewer Ian Stirk is a freelance SQL Server consultant based in London. In addition to his day job, he is an author, creator of software utilities, and technical reviewer who regularly writes book reviews for www.i-programmer.info. He covers every aspect of SQL Server and has a specialist interest in performance and scalability. If you require help with your SQL Server systems, feel free to contact him at ian_stirk@yahoo.com or www.linkedin.com/in/ian- stirk-bb9a31. Ian would like to thank Peter Carter, Jonathan Gennick, and Jill Balzano for making this book experience easier for him. None of us stands alone, and with this in mind, Ian would like to thank these special people: Kemi Amos, Malcolm Smith, John Lewis, Alan Crosby, Penny Newman, Tony Pugh, Stephen Cockburn, Jennifer Warner, John Woods, Tina Vick, Catherine Valentin, Stephen Johnson, Martin Fallon, Sizakele Phumzile Mtshali, Mark Hardman, Mark Northern, Ruhina Kabani, Peter Coombes, Lucy Mwangi, Silvia Alvarado, and Keila Fialho. Ian’s fee for his work on this book has been donated to the GiveWell charities (www.givewell.org/charities/top-charities/ ).
xv Acknowledgments I would like to thank Mark Burnett (xato.net) for allowing me to use his weak password list in this book. I would also like to thank Ian Stirk, for a really good technical review, which has had a positive impact on the quality of this book.
xvii Introduction With repeated, high-profile data security breaches hitting the headlines, security is moving increasingly to the forefront of the minds of data professionals. SQL Server provides a broad and deep set of security features that allow you to reduce the attack surface of your SQL Server instance, with defense-in-depth and principles of least privilege strategies. The attack surface of SQL Server refers to the set of features and windows services, which attackers can (and will) attempt to exploit to either steal data or reduce the availability of data and services. Defense-in-depth is a strategy used across the IT industry, where multiple layers of security are put in place. The idea is that if one layer of security is breached, then another layer will stop the attacker in their tracks. To fully protect data against attack, SQL Server DBAs, developers, and architects alike must all understand how and when to implement each of the security features that SQL Server offers. This book attempts to address these topics. The first section of this book begins by looking at how to holistically model threats before deep-diving into each of SQL Server’s main areas of security, providing examples of how to implement each technology. The second section of this book demonstrates some of the common threats that DBAs may face and how to guard against them. There is always an ethical question around revealing how attackers may try to penetrate your systems, but without knowledge and understanding of vulnerabilities that may be exploited, all too many DBAs do not implement the security measures that could easily avoid attacks from being successful. Every attack type discussed in this book is followed by a demonstration of how to use out-of-the-box SQL Server technologies to proactively stop the attacks occurring. Many of the code examples in this book use the WideWorldImporters database. This database can be downloaded from github.com/Microsoft/sql-server-samples/releases/ download/wide-world-importers-v1.0/WideWorldImporters-Full.bak Some chapters also refer to CarterSecureSafe. This is a fictional company and product, which is purely designed to illustrate points made within this book.
PART I Database Security
3 © Peter A. Carter 2018 P. A. Carter, Securing SQL Server, https://doi.org/10.1007/978-1-4842-4161-5_1 CHAPTER 1 Threat Analysis and Compliance We live in an age where high-profile attacks on data are almost commonplace. Attacks can come from a variety of sources, ranging from cyber-terrorism and modern warfare through to industrial espionage, the “geek” factor, organized crime, and even disgruntled employees, or former employees. In addition, DBAs (Database Administrators) must often consider security from regulatory perspective, with many companies required to comply with SOX (The Sarbanes–Oxley Act in the US) or GDPR (General Data Protection Regulation in the European Union). For these reasons, security is at the forefront of every good DBA’s minds. In this chapter, we will explore how to model threats, so that risks can be identified, understood, and prioritized. This will lead us into discussing some high-level countermeasures. We will also introduce compliance and discuss the potential impacts on your SQL Server security model. When considering security, we must also consider ethics. When we see the word “hacker” in the media, it instantly conjures a negative connotation. For those with knowledge of the security industry, however, hackers can be broken down into three categories: black hat, grey hat, and white hat. A black hat hacker is the typical hacker that you will hear about in the mainstream media. He will attempt to penetrate systems and use the attack for his self-gain. The activities of a grey-hat hacker are still illegal, but slightly less malicious. A grey- hat will attempt to crack a system and then inform the organization of the vulnerabilities found. Often, the grey-hat will demand financial compensation for his discoveries and publish the vulnerability on the internet if his demands are not met. In contrast, a white-hat hacker will be employed by an organization to attack the organization’s systems in an attempt to find vulnerabilities, so that appropriate countermeasures or risk mitigation strategies can be put in place. This activity is, of course, perfectly legal and ethical.
4 In the first section of this book, we will focus purely on how to secure SQL Server 2017 by implementing the security technologies provided by Microsoft. In the second section, however, we will examine how attackers will attempt to penetrate SQL Server’s security model for malicious purposes and how to overcome these attacks. There may be an ethical argument that exposing the methods used by attackers could assist black-hat and grey-hat attackers. The assumption needs to be made, however, that an experienced or determined attacker will either already know of the vulnerabilities or be able to discover them. The most benefit in discussing attack methodologies comes to the conscientious DBA who needs to understand how security can be circumvented in order to harden their applications and platform. Without any context as to how poor practice can lead to security holes, it is often hard for a DBA to understand how security technologies should be implemented in their own environment, which in turn can lead to security holes. Threat Modeling All RDBMS (Relational Database Management Systems) have the potential to be exploited with SQL Injection attacks (a full discussion of SQL Injection attacks can be found in Chapter 10), as well as vulnerabilities that are unique to each product. For example, attackers will often attempt to gain elevated access to Oracle by attempting to use default user passwords. While this risk can be mitigated with due diligence, with around 600 default user/passwords, it can be hard for Oracle DBAs to ensure that no stone is left unturned. In SQL Server, a common attack is to attempt to brute force attack the sa account, on Port 1433. While the sa account can be disabled, or have its name changed, the majority of SQL Server DBAs do not do this, and in many cases, there are poorly written client applications that require an sa account to be present. In the following sections, we will explore how to perform threat modeling so that the highest priority threats can be identified, and countermeasures taken. Understanding Threat Modeling Because every database management platform is vulnerable to many potential threats, it is important to undergo a process of threat modeling in order to mitigate the risks. Threat modeling is the process of identifying threats to a data-tier Chapter 1 threat analysis and ComplianCe
5 application (or, in some instances, the entire enterprise) and then classify and rate the threats that have been discovered, in order to determine the most critical to address. You will then be in a position to determine the correct countermeasures in order to mitigate the risks. In an ideal world, threat modeling should be carried out during the design phase of a project and at the very least at the testing stage. There will already be Enterprise standards and policies in place, for the Enterprise as a whole, and you can ensure that the platform you are constructing meets these standards. In the real world, however, this often does not happen, due to time or budgetary constraints. Often, there are also no Enterprise standards—specifically for database platforms—against which you can baseline your data-tier. Unfortunately, just like comprehensive backup strategies, many companies and individuals do not put an emphasis on security until it is too late. Even in companies that have rigorous security management policies, the focus tends to be avoiding external attacks (attacks from sources external to the company) whereas it is estimated that 70% of security breaches are internal (attacks originating from sources within the company network). This is due to employees with malicious intent, employees who unintentionally misuse systems, and also from the theft of employees’ laptops or other devices. Therefore, it is important that companies focus on identifying the risks of attacks from inside their network, as well as outside. Threat modeling consists of six sequential steps: 1. Identifying assets 2. Creating an architecture overview 3. Building a security profile 4. Identifying the threats 5. Documenting the threats 6. Rating and prioritizing the threats Tip threat modeling allows you to design and build countermeasures. Building the countermeasures, however, is not part of the threat modeling process. instead, the countermeasures will be implemented as a separate process. Chapter 1 threat analysis and ComplianCe
6 The following sections will discuss how to perform threat analysis using a fictional application called CarterSecureSafe, which belongs to the fictional company CarterSecurityTools.com and consists of a simple Web application, where customers can shop for security software. The back end of the Web application is a database hosted in a SQL Server instance. Identifying Assets The first step in the threat modeling process is to identify valuable assets. From the perspective of the DBA, identifying the valuable assets that must be protected consists of identifying the company confidential information that would have a commercial impact if it were lost (unavailable) or stolen. For example, a high-profile attack against an entertainment company reportedly saw the theft of roughly 76 million user accounts, leading to a cost of around $176 million. DBAs should look to ensure that customer data, financial data, and sales data are especially secure. Remember that financial repercussions could occur, not just in tangible ways, such as through fines from regulators, or in compensation to customers but also in intangible ways, such as the loss of business reputation, reduced staff morale, or customers moving their business to a rival. Creating an Architecture Overview Creating an architecture overview consists of defining the logical architecture of the application and expressing it in diagrammatic form, along with the technology stack that will be (or has already been) used to implement the application. This will help you identify areas of the end-to-end application that are potentially vulnerable, as well as identify any technology-specific vulnerabilities. Creating the Infrastructure Components In the case of CarterSecureSafe, the application consists of a Web Server, an Application Server, and a Database Server. We should also note how this architecture interacts with the underlying infrastructure. The diagram in Figure 1-1 shows how an architecture diagram for CarterSecureSafe application might look. Chapter 1 threat analysis and ComplianCe
7 Tip in a real architecture diagram, you will label servers with their name and ip address, as opposed to a description of their usage. The diagram shows that the application is accessed by both internal and external users. Internal users authenticate to the application server through Active Directory, while external users authenticate through a Web Server, which is located in the company’s DMZ (demilitarized zone). Note as well as indicating the servers that are directly used by the application (web server, application server, and database server), we have also included infrastructure touch points—namely, the corporate firewalls that traffic will pass through, the dC (domain controller) used to authenticate internal users and the isolated dmZ, within the domain. Figure 1-1. Architecture diagram Chapter 1 threat analysis and ComplianCe