| About the Author |
|
xi | |
| About the Technical Reviewer |
|
xiii | |
| Acknowledgments |
|
xv | |
| Introduction |
|
xvii | |
|
|
|
1 | (218) |
|
Chapter 1 Threat Analysis and Compliance |
|
|
3 | (20) |
|
|
|
4 | (14) |
|
Understanding Threat Modeling |
|
|
4 | (2) |
|
|
|
6 | (1) |
|
Creating an Architecture Overview |
|
|
6 | (3) |
|
Creating a Security Profile |
|
|
9 | (2) |
|
|
|
11 | (2) |
|
|
|
13 | (4) |
|
|
|
17 | (1) |
|
Compliance Considerations |
|
|
18 | (2) |
|
Introducing SOX for SQL Server |
|
|
19 | (1) |
|
Introducing GDPR For SQL Server |
|
|
20 | (1) |
|
|
|
20 | (3) |
|
Chapter 2 SQL Server Security Model |
|
|
23 | (28) |
|
Security Principal Hierarchy |
|
|
24 | (2) |
|
|
|
26 | (13) |
|
|
|
27 | (8) |
|
|
|
35 | (4) |
|
|
|
39 | (1) |
|
|
|
39 | (10) |
|
|
|
39 | (8) |
|
|
|
47 | (2) |
|
|
|
49 | (2) |
|
Chapter 3 SQL Server Audit |
|
|
51 | (26) |
|
Understanding SQL Server Audit |
|
|
51 | (13) |
|
SQL Server Audit Actions and Action Groups |
|
|
52 | (12) |
|
Implementing SQL Server Audit |
|
|
64 | (10) |
|
|
|
64 | (6) |
|
Create a Server Audit Specification |
|
|
70 | (1) |
|
Create a Database Audit Specification |
|
|
71 | (3) |
|
Creating Custom Audit Events |
|
|
74 | (2) |
|
Creating the Server Audit and Database Audit Specification |
|
|
74 | (1) |
|
|
|
75 | (1) |
|
|
|
76 | (1) |
|
Chapter 4 Data-Level Security |
|
|
77 | (20) |
|
|
|
77 | (3) |
|
|
|
80 | (3) |
|
|
|
83 | (2) |
|
|
|
85 | (6) |
|
|
|
86 | (1) |
|
|
|
87 | (1) |
|
|
|
87 | (4) |
|
|
|
91 | (5) |
|
|
|
96 | (1) |
|
Chapter 5 Encryption in SQL Server |
|
|
97 | (36) |
|
Generic Encryption Concepts |
|
|
97 | (2) |
|
|
|
97 | (1) |
|
|
|
98 | (1) |
|
|
|
98 | (1) |
|
|
|
98 | (1) |
|
|
|
98 | (1) |
|
Windows Data Protection API |
|
|
98 | (1) |
|
SQL Server Encryption Concepts |
|
|
99 | (4) |
|
|
|
99 | (3) |
|
|
|
102 | (1) |
|
SQL Server Encryption Hierarchy |
|
|
102 | (1) |
|
|
|
103 | (11) |
|
Encrypting Data With a Password or Passphrase |
|
|
103 | (6) |
|
Encrypting Data with Keys and Certificates |
|
|
109 | (5) |
|
Transparent Data Encryption |
|
|
114 | (5) |
|
Considerations for TDE With Other Technologies |
|
|
115 | (1) |
|
|
|
116 | (2) |
|
|
|
118 | (1) |
|
|
|
119 | (11) |
|
Implementing Always Encrypted |
|
|
121 | (9) |
|
|
|
130 | (3) |
|
Chapter 6 Security Metadata |
|
|
133 | (26) |
|
Security Principal Metadata |
|
|
133 | (4) |
|
Finding a User's Effective Permissions |
|
|
134 | (3) |
|
|
|
137 | (5) |
|
|
|
138 | (3) |
|
Permissions Against a Specific Table |
|
|
141 | (1) |
|
|
|
142 | (3) |
|
|
|
145 | (7) |
|
Always Encrypted Metadata |
|
|
145 | (3) |
|
|
|
148 | (4) |
|
|
|
152 | (2) |
|
|
|
154 | (3) |
|
Risks of Metadata Visibility |
|
|
156 | (1) |
|
|
|
157 | (2) |
|
Chapter 7 Implementing Service Accounts for Security |
|
|
159 | (16) |
|
|
|
159 | (3) |
|
|
|
160 | (1) |
|
|
|
161 | (1) |
|
|
|
162 | (9) |
|
How Service Accounts Can Become Compromised |
|
|
171 | (1) |
|
Designing a Pragmatic Service Account Strategy |
|
|
172 | (2) |
|
|
|
174 | (1) |
|
Chapter 8 Protecting Credentials |
|
|
175 | (18) |
|
Protecting the sa Account |
|
|
175 | (13) |
|
DBA Steps to Mitigate the Risks |
|
|
176 | (12) |
|
|
|
188 | (3) |
|
Auditing Passwords Susceptible to Word List Attacks |
|
|
189 | (2) |
|
Protecting Windows Accounts |
|
|
191 | (1) |
|
|
|
192 | (1) |
|
Chapter 9 Reducing the Attack Surface |
|
|
193 | (26) |
|
|
|
193 | (12) |
|
Understanding Ports and Protocols |
|
|
193 | (6) |
|
Firewall Requirements for SQL Server |
|
|
199 | (6) |
|
Miscellaneous Considerations |
|
|
205 | (1) |
|
Ensuring that Unsafe Features Remain Disabled |
|
|
206 | (10) |
|
Configuring the Surface Area Manually |
|
|
207 | (1) |
|
Managing Features With Policy-Based Management |
|
|
208 | (8) |
|
|
|
216 | (3) |
|
Part II Threats and Countermeasures |
|
|
219 | (122) |
|
|
|
221 | (26) |
|
Preparing the Environment |
|
|
221 | (9) |
|
Performing SQL Injection Attacks |
|
|
230 | (10) |
|
|
|
230 | (2) |
|
Using SQL Injection to Leak Information |
|
|
232 | (4) |
|
|
|
236 | (2) |
|
|
|
238 | (2) |
|
Preventing SQL Injection Attacks |
|
|
240 | (4) |
|
Using an Abstraction Layer |
|
|
241 | (1) |
|
Access via Stored Procedures Only |
|
|
242 | (2) |
|
|
|
244 | (3) |
|
Chapter 11 Hijacking an Instance |
|
|
247 | (28) |
|
|
|
247 | (5) |
|
Protecting Against Hijacking |
|
|
252 | (22) |
|
Understanding Logon Triggers |
|
|
253 | (1) |
|
Using Logon Triggers to Prevent Instance Hijacking |
|
|
254 | (6) |
|
Understanding Server Agent |
|
|
260 | (13) |
|
|
|
273 | (1) |
|
|
|
274 | (1) |
|
Chapter 12 Database Backup Theft |
|
|
275 | (32) |
|
|
|
275 | (9) |
|
|
|
275 | (4) |
|
|
|
279 | (1) |
|
|
|
280 | (4) |
|
|
|
284 | (11) |
|
|
|
284 | (1) |
|
|
|
285 | (10) |
|
Attempting to Steal an Encrypted Backup |
|
|
295 | (7) |
|
Administrative Considerations for Encrypted Backups |
|
|
302 | (4) |
|
|
|
302 | (1) |
|
|
|
303 | (3) |
|
|
|
306 | (1) |
|
Chapter 13 Code Injection |
|
|
307 | (18) |
|
Understanding Code Injection |
|
|
307 | (5) |
|
|
|
308 | (2) |
|
Using EXECUTE AS to Perform a Code Injection Attack |
|
|
310 | (2) |
|
Protecting Against Code Injection |
|
|
312 | (9) |
|
|
|
313 | (1) |
|
Using Policy-Based Management to Protect Against Code Injection |
|
|
313 | (8) |
|
|
|
321 | (3) |
|
|
|
324 | (1) |
|
Chapter 14 Whole Value Substitution Attacks |
|
|
325 | (16) |
|
Understanding Whole Value Substitution Attacks |
|
|
325 | (7) |
|
Salary Manipulation Example |
|
|
326 | (3) |
|
Credit Card Fraud Example |
|
|
329 | (3) |
|
Protecting Against Whole Value Substitution Attacks |
|
|
332 | (3) |
|
Performance Considerations |
|
|
335 | (4) |
|
|
|
339 | (2) |
| Index |
|
341 | |