Practical Hadoop Security 1st ed. Edition Lakhe - The ebook with all chapters is available with just one click
Practical Hadoop Security 1st ed. Edition Lakhe - The ebook with all chapters is available with just one click
https://ebookultra.com/download/hadoop-security-protecting-your-big-
data-platform-1st-edition-ben-spivey/
https://ebookultra.com/download/hadoop-in-action-chuck-lam/
https://ebookultra.com/download/hadoop-for-dummies-1st-edition-dirk-
deroos/
https://ebookultra.com/download/cloud-storage-security-a-practical-
guide-1st-edition-wheeler/
Endpoint Security 1st ed Edition Mark Kadrich
https://ebookultra.com/download/endpoint-security-1st-ed-edition-mark-
kadrich/
https://ebookultra.com/download/thor-s-microsoft-security-bible-a-
collection-of-practical-security-techniques-1st-edition-timothy-thor-
mullen/
https://ebookultra.com/download/practical-opencv-1st-ed-edition-
brahmbhatt/
https://ebookultra.com/download/security-guide-to-network-security-
fundamentals-3rd-ed-edition-mark-d-ciampa/
https://ebookultra.com/download/information-security-governance-a-
practical-development-and-implementation-approach-1st-edition-krag-
brotby/
Practical Hadoop Security 1st ed. Edition Lakhe Digital
Instant Download
Author(s): Lakhe, Bhushan
ISBN(s): 9781430265443, 1430265442
Edition: 1st ed.
File Details: PDF, 5.33 MB
Year: 2014
Language: english
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Contents at a Glance
■■Part II: Authenticating and Authorizing Within Your Hadoop Cluster �������� 49
■■Chapter 4: Open Source Authentication in Hadoop���������������������������������������������������������51
■■Chapter 5: Implementing Granular Authorization�����������������������������������������������������������75
v
■ Contents at a Glance
Index���������������������������������������������������������������������������������������������������������������������������������191
vi
Introduction
Last year, I was designing security for a client who was looking for a reference book that talked about security
implementations in the Hadoop arena, simply so he could avoid known issues and pitfalls. To my chagrin, I couldn’t
locate a single book for him that covered the security aspect of Hadoop in detail or provided options for people who
were planning to secure their clusters holding sensitive data! I was disappointed and surprised. Everyone planning to
secure their Hadoop cluster must have been going through similar frustration. So I decided to put my security design
experience to broader use and write the book myself.
As Hadoop gains more corporate support and usage by the day, we all need to recognize and focus on the
security aspects of Hadoop. Corporate implementations also involve following regulations and laws for data
protection and confidentiality, and such security issues are a driving force for making Hadoop “corporation ready.”
Open-source software usually lacks organized documentation and consensus on performing a particular
functional task uniquely, and Hadoop is no different in that regard. The various distributions that mushroomed in last
few years vary in their implementation of various Hadoop functions, and some, such as authorization or encryption,
are not even provided by all the vendor distributions. So, in this way, Hadoop is like Unix of the ’80s or ’90s: Open
source development has led to a large number of variations and in some cases deviations from functionality. Because
of these variations, devising a common strategy to secure your Hadoop installation is difficult. In this book, I have
tried to provide a strategy and solution (an open source solution when possible) that will apply in most of the cases,
but exceptions may exist, especially if you use a Hadoop distribution that’s not well-known.
It’s been a great and exciting journey developing this book, and I deliberately say “developing,” because I believe
that authoring a technical book is very similar to working on a software project. There are challenges, rewards, exciting
developments, and of course, unforeseen obstacles—not to mention deadlines!
xix
■ Introduction
xx
■ Introduction
xxi
Part I
In today’s technology-driven world, computers have penetrated all walks of our life, and more of our personal and
corporate data is available electronically than ever. Unfortunately, the same technology that provides so many
benefits can also be used for destructive purposes. In recent years, individual hackers, who previously worked mostly
for personal gain, have organized into groups working for financial gain, making the threat of personal or corporate
data being stolen for unlawful purposes much more serious and real. Malware infests our computers and redirects
our browsers to specific advertising web sites depending on our browsing context. Phishing emails entice us to log
into web sites that appear real but are designed to steal our passwords. Viruses or direct attacks breach our networks
to steal passwords and data. As Big Data, analytics, and machine learning push into the modern enterprise, the
opportunities for critical data to be exposed and harm to be done rise exponentially.
If you want to counter these attacks on your personal property (yes, your data is your personal property) or your
corporate property, you have to understand thoroughly the threats as well as your own vulnerabilities. Only then can
you work toward devising a strategy to secure your data, be it personal or corporate.
Think about a scenario where your bank’s investment division uses Hadoop for analyzing terabytes of data and
your bank’s competitor has access to the results. Or how about a situation where your insurance company decides
to stop offering homeowner’s insurance based on Big Data analysis of millions of claims, and their competitor, who
has access (by stealth) to this data, finds out that most of the claims used as a basis for analysis were fraudulent? Can
you imagine how much these security breaches would cost the affected companies? Unfortunately, only the breaches
highlight the importance of security. To its users, a good security setup—be it personal or corporate—is always
transparent.
This chapter lays the foundation on which you can begin to build that security strategy. I first define a security
engineering framework. Then I discuss some psychological aspects of security (the human factor) and introduce
security protocols. Last, I present common potential threats to a program’s security and explain how to counter
those threats, offering a detailed example of a secure distributed system. So, to start with, let me introduce you to the
concept of security engineering.
3
Chapter 1 ■ Understanding Security Concepts
Security requirements vary from one system to another. Usually you need a balanced combination of user
authentication, authorization, policy definition, auditing, integral transactions, fault tolerance, encryption, and
isolation. A lot of systems fail because their designers focus on the wrong things, omit some of these factors, or
focus on the right things but do so inadequately. Securing Big Data systems with many components and interfaces
is particularly challenging. A traditional database has one catalog, and one interface: SQL connections. A Hadoop
system has many “catalogs” and many interfaces (Hadoop Distributed File System or HDFS, Hive, HBase). This
increased complexity, along with the varied and voluminous data in such a system, introduces many challenges for
security engineers.
Securing a system thus depends on several types of processes. To start with, you need to determine your security
requirements and then how to implement them. Also, you have to remember that secure systems have a very
important component in addition to their technical components: the human factor! That’s why you have to make sure
that people who are in charge of protecting the system and maintaining it are properly motivated. In the next section,
I define a framework for considering all these factors.
Strategy
Implementation Reliability
Relevance Motivation
4
Chapter 1 ■ Understanding Security Concepts
Notice the relationships, such as strategy for relevance, implementation of a strategy, implementation of
relevance, reliability of motivation, and so on.
Consider Figure 1-1’s framework through the lens of a real-world example. Suppose I am designing a system to
store the grades of high school students. How do these five key factors come into play?
With my objective in mind—create a student grading system—I first outline a strategy for the system. To begin,
I must define levels of authentication and authorization needed for students, staff, and school administrators (the
access policy). Clearly, students need to have only read permissions on their individual grades, staff needs to have
read and write permissions on their students’ grades, and school administrators need to have read permissions on
all student records. Any data update needs to be an integral transaction, meaning either it should complete all the
related changes or, if it aborts while in progress, then all the changes should be reverted. Because the data is sensitive,
it should be encrypted—students should be able to see only their own grades. The grading system should be isolated
within the school intranet using an internal firewall and should prompt for authentication when anyone tries to use it.
My strategy needs to be implemented by first procuring the necessary hardware (server, network cards) and
software components (SQL Server, C#, .NET components, Java). Next is design and development of a system to meet
the objectives by designing the process flow, data flow, logical data model, physical data model using SQL Server, and
graphical user interface using Java. I also need to define the access controls that determine who can access the system
and with what permissions (roles based on authorization needs). For example, I define the School_Admin role with
read permissions on all grades, the Staff role with read and write permissions, and so on. Last, I need to do a security
practices review of my hardware and software components before building the system.
While thoroughly testing the system, I can measure reliability by making sure that no one can access data they
are not supposed to, and also by making sure all users can access the data they are permitted to access. Any deviation
from this functionality makes the system unreliable. Also, the system needs to be available 24/7. If it’s not, then that
reduces the system’s reliability, too. This system’s relevance will depend on its impregnability. In other words, no
student (or outside hacker) should be able to hack through it using any of the latest techniques.
The system administrators in charge of managing this system (hardware, database, etc.) should be reliable and
motivated to have good professional integrity. Since they have access to all the sensitive data, they shouldn’t disclose
it to any unauthorized people (such as friends or relatives studying at the high school, any unscrupulous admissions
staff, or even the media). Laws against any such disclosures can be a good motivation in this case; but professional
integrity is just as important.
5
Chapter 1 ■ Understanding Security Concepts
• Client Certificates or Custom-Built Applications: Some banks provide their own laptops and
VPN access for using their custom applications to connect to their systems. They validate the
client’s use of their own hardware (e.g., through a media access control, or MAC address) and
also use VPN credentials to authenticate the user before letting him or her connect to their
systems. Some banks also provide client certificates to their users that are authenticated by
their servers; because they reside on client PCs, they can’t be accessed or used by hackers.
• Two-Phase Authentication: With this system, logon involves both a token password and
a saved password. Security tokens generate a password (either for one-time use or time
based) in response to a challenge sent by the system you want to access. For example, every
few seconds a security token can display a new eight-digit password that’s synchronized
with the central server. After you enter the token password, the system then prompts for
a saved password that you set up earlier. This makes it impossible for a hacker to use your
password, because the token password changes too quickly for a hacker to use it. Two-phase
authentication is still vulnerable to a real-time “man-in-the-middle” attack (see the
“Man-in-the-Middle Attack” sidebar for more detail).
MAN-IN-THE-MIDDLE ATTACK
A man-in-the-middle attack works by a hacker becoming an invisible relay (the “man in the middle”) between a
legitimate user and authenticator to capture information for illegal use. The hacker (or “phisherman”) captures the
user responses and relays them to the authenticator. He or she then relays any challenges from the authenticator
to the user, and any subsequent user responses to the authenticator. Because all responses pass through the
hacker, he is authenticated as a user instead of the real user, and hence is free to perform any illegal activities
while posing as a legitimate user!
For example, suppose a user wants to log in to his checking account and is enticed by a phishing scheme to
log into a phishing site instead. The phishing site simultaneously opens a logon session with the user’s bank.
When the bank sends a challenge; the phisherman relays this to the user, who uses his device to respond to it;
the phisherman relays this response to the bank, and is now authenticated to the bank as the user! After that,
of course, he can perform any illegal activities on that checking account, such as transferring all the money to his
own account.
Some banks counter this by using an authentication code based on last amount withdrawn, the payee account
number, or a transaction sequence number as a response, instead of a simple response.
• Trusted Computing: This approach involves installing a TPM (trusted platform module)
security chip on PC motherboards. TPM is a dedicated microprocessor that generates
cryptographic keys and uses them for encryption/decryption. Because localized hardware is
used for encryption, it is more secure than a software solution. To prevent any malicious code
from acquiring and using the keys, you need to ensure that the whole process of encryption/
decryption is done within TPM rather than TPM generating the keys and passing them to
external programs. Having such hardware transaction support integrated into the PC will
make it much more difficult for a hacker to break into the system. As an example, the recent
Heartbleed bug in OpenSSL would have been defeated by a TPM as the keys would not be
exposed in system memory and hence could not have been leaked.
6
Chapter 1 ■ Understanding Security Concepts
• Strong Password Protocols: Steve Bellovin and Michael Merritt came up with a series of
protocols for encrypted key exchange, whereby a key exchange is combined with a shared
password in such a way that a man in the middle (phisherman) can’t guess the password.
Various other researchers came up with similar protocols, and this technology was a precursor
to the “secure” (HTTPS) protocol we use today. Since use of HTTPS is more convenient, it was
implemented widely instead of strong pass word protocol, which none of today’s browsers
implement.
• Two-Channel Authentication: This involves sending one-time access codes to users via a
separate channel or a device (such as their mobile phone). This access code is used as an
additional password, along with the regular user password. This authentication is similar to
two-phase authentication and is also vulnerable to real-time man-in-the-middle attack.
7
Chapter 1 ■ Understanding Security Concepts
Authenticating
Server
m n
ste ee
Us pro
sy tw
er vi d
by
ile be
en er v ke
r ve te e s tw
re in
e f ey
/ S ared r)
qu g
r r d u si o e e
ur k
sh r ve
es he
e s si n n n s
ec red
Se
ts r "
po g ke ec
es a
th sh
a s no
nd sh y e ur
d ds
s w are nc e f
es ce
an en
si o "
ith d k ryp ile
elf r s
nk
n
its erve
ey
on (be us tem
S
ce tw in
",
se een
ss Us
ion e
ke r
g /
User forwards the encrypted session
y
key to secure file system
Secure file User
system
Kerberos
A derivative of the Needham–Schroeder protocol, Kerberos originated at MIT and is now used as a standard
authentication tool in Linux as well as Windows. Instead of a single trusted server, Kerberos uses two: an
authentication server that authenticates users to log in; and a ticket-granting server that provides tickets, allowing
access to various resources (e.g., files or secure processes). This provides more scalable access management.
What if a user needs to access a secure file system that uses Kerberos? First, the user logs on to the authentication
server using a password. The client software on the user’s PC fetches a ticket from this server that is encrypted
under the user’s password and that contains a session key (valid only for a predetermined duration like one hour or
one day). Assuming the user is authenticated, he now uses the session key to get access to secure file system that’s
controlled by the ticket-granting server.
Next, the user requests access to the secure file system from the ticket-granting server. If the access is permissible
(depending on user’s rights), a ticket is created containing a suitable key and provided to the user. The user also gets
a copy of the key encrypted under the session key. The user now verifies the ticket by sending a timestamp to the
secure file system, which confirms it’s alive by sending back the timestamp incremented by 1 (this shows it was able to
decrypt the ticket correctly and extract the key). After that, the user can communicate with the secure file system.
Kerberos fixes the vulnerability of Needham–Schroeder by replacing random nonces with timestamps.
Of course, there is now a new vulnerability based on timestamps, in which clocks on various clients and servers
might be desynchronized deliberately as part of a more complex attack.
Kerberos is widely used and is incorporated into the Windows Active Directory server as its authentication
mechanism. In practice, Kerberos is the most widely used security protocol, and other protocols only have a
historical importance. You will learn more about Kerberos in later chapters, as it is the primary authentication used
with Hadoop today.
8
Chapter 1 ■ Understanding Security Concepts
Burrows–Abadi–Needham Logic
Burrows–Abadi–Needham (BAN) logic provides framework for defining and analyzing sensitive information. The
underlying principle is that a message is authentic if it meets three criteria: it is encrypted with a relevant key, it’s from
a trusted source, and it is also fresh (that is, generated during the current run of the protocol). The verification steps
followed typically are to
1. Check if origin is trusted,
2. Check if encryption key is valid, and
3. Check timestamp to make sure it’s been generated recently.
Variants of BAN logic are used by some banks (e.g., the COPAC system used by Visa International). BAN logic is a
very extensive protocol due to its multistep verification process; but that’s also the precise reason it’s not very popular.
It is complex to implement and also vulnerable to timestamp manipulation (just like Kerberos).
Consider a practical implementation of BAN logic. Suppose Mindy buys an expensive purse from a web retailer
and authorizes a payment of $400 to the retailer through her credit card. Mindy’s credit card company must be able
to verify and prove that the request really came from Mindy, if she should later disavow sending it. The credit card
company also wants to know that the request is entirely Mindy's, that it has not been altered along the way.
In addition, the company must be able to verify the encryption key (the three-digit security code from the credit card)
Mindy entered. Last, the company wants to be sure that the message is new—not a reuse of a previous message.
So, looking at the requirements, you can conclude that the credit card company needs to implement BAN logic.
Now, having reviewed the protocols and ways they can be used to counter malicious attacks, do you think using a
strong security protocol (to secure a program) is enough to overcome any “flaws” in software (that can leave programs
open to security attacks)? Or is it like using an expensive lock to secure the front door of a house while leaving the
windows open? To answer that, you will first need to know what the flaws are or how they can cause security issues.
Securing a Program
Before you can secure a program, you need to understand what factors make a program insecure. To start with, using
security protocols only guards the door, or access to the program. Once the program starts executing, it needs to have
robust logic that will provide access to the necessary resources only, and not provide any way for malicious attacks
to modify system resources or gain control of the system. So, is this how a program can be free of flaws? Well, I will
discuss that briefly, but first let me define some important terms that will help you understand flaws and how to
counter them.
Let’s start with the term program. A program is any executable code. Even operating systems or database systems
are programs. I consider a program to be secure if it exactly (and only) does what it is supposed to do—nothing else!
An assessment of security may also be decided based on program’s conformity to specifications—the code is secure
if it meets security requirements. Why is this important? Because when a program is executing, it has capability to
modify your environment, and you have to make sure it only modifies what you want it to.
So, you need to consider the factors that will prevent a program from meeting the security requirements. These
factors can potentially be termed flaws in your program. A flaw can either be fault or a failure.
A fault is an anomaly introduced in a system due to human error. A fault can be introduced at the design stage
due to the designer misinterpreting an analyst’s requirements, or at the implementation stage by a programmer not
understanding the designer’s intent and coding incorrectly. A single error can generate many faults. To summarize, a
fault is a logical issue or contradiction noticed by the designers or developers of the system after it is developed.
A failure is a deviation from required functionality for a system. A failure can be discovered during any phase of
the software development life cycle (SDLC), such as testing or operation. A single fault may result in multiple failures
(e.g., a design fault that causes a program to exit if no input is entered). If the functional requirements document
contains faults, a failure would indicate that the system is not performing as required (even though it may be
performing as specified). Thus, a failure is an apparent effect of a fault: an issue visible to the user(s).
9
Chapter 1 ■ Understanding Security Concepts
Fortunately, not every fault results in a failure. For example, if the faulty part of the code is never executed or the
faulty part of logic is never entered, then the fault will never cause the code to fail—although you can never be sure
when a failure will expose that fault!
Broadly, the flaws can be categorized as:
• Non-malicious (buffer overruns, validation errors etc.) and
• Malicious (virus/worm attacks, malware etc.).
In the next sections, take a closer look at these flaws, the kinds of security breaches they may produce, and how to
devise a strategy to better secure your software to protect against such breaches.
Non-Malicious Flaws
Non-malicious flaws result from unintentional, inadvertent human errors. Most of these flaws only result in program
malfunctions. A few categories, however, have caused many security breaches in the recent past.
Buffer Overflows
A buffer (or array or string) is an allotted amount of memory (or RAM) where data is held temporarily for processing.
If the program data written to a buffer exceeds a buffer’s previously defined maximum size, that program data
essentially overflows the buffer area. Some compilers detect the buffer overrun and stop the program, while others
simply presume the overrun to be additional instructions and continue execution. If execution continues, the
program data may overwrite system data (because all program and data elements share the memory space with the
operating system and other code during execution). A hacker may spot the overrun and insert code in the system
space to gain control of the operating system with higher privileges.1
Several programming techniques are used to protect from buffer overruns, such as
• Forced checks for buffer overrun;
• Separation of system stack areas and user code areas;
• Making memory pages either writable or executable, but not both; and
• Monitors to alert if system stack is overwritten.
Incomplete Mediation
Incomplete mediation occurs when a program accepts user data without validation or verification. Programs are
expected to check if the user data is within a specified range or that it follows a predefined format. When that is not
done, then a hacker can manipulate the data for unlawful purposes. For example, if a web store doesn’t mediate user
data, a hacker may turn off any client JavaScript (used for validation) or just write a script to interact with the web
server (instead of using a web browser) and send arbitrary (unmediated) values to the server to manipulate a sale. In
some cases vulnerabilities of this nature are due to failure to check default configuration on components; a web server
that by default enables shell escape for XML data is a good example.
Another example of incomplete mediation is SQL Injection, where an attacker is able to insert (and submit)
a database SQL command (instead of or along with a parameter value) that is executed by a web application,
manipulating the back-end database. A SQL injection attack can occur when a web application accepts user-supplied
1
Please refer to the IEEE paper “Beyond Stack Smashing: Recent Advances in Exploiting Buffer Overruns” by Jonathan Pincus
and Brandon Baker for more details on these kind of attacks. A PDF of the article is available at http://classes.soe.ucsc.edu/
cmps223/Spring09/Pincus%2004.pdf.
10
Chapter 1 ■ Understanding Security Concepts
input data without thorough validation. The cleverly formatted user data tricks the application into executing
unintended commands or modifying permissions to sensitive data. A hacker can get access to sensitive information
such as Social Security numbers, credit card numbers, or other financial data.
An example of SQL injection would be a web application that accepts the login name as input data and displays
all the information for a user, but doesn’t validate the input. Suppose the web application uses the following query:
A malicious user can use a LoginName value of “' or '1'='1” which will result in the web application returning
login information for all the users (with passwords) to the malicious user.
If user input is validated against a set of defined rules for length, type, and syntax, SQL injection can be prevented.
Also, it is important to ensure that user permissions (for database access) should be limited to least possible privileges
(within the concerned database only), and system administrator accounts, like sa, should never be used for web
applications. Stored procedures that are not used should be removed, as they are easy targets for data manipulation.
Two key steps should be taken as a defense:
• Server-based mediation must be performed. All client input needs to be validated by the
program (located on the server) before it is processed.
• Client input needs to be checked for range validity (e.g., month is between January and
December) as well as allowed size (number of characters for text data or value for numbers for
numeric data, etc.).
Malicious Flaws
Malicious flaws produce unanticipated or undesired effects in programs and are the result of code deliberately
designed to cause damage (corruption of data, system crash, etc.). Malicious flaws are caused by viruses, worms,
rabbits, Trojan horses, trap doors, and malware:
• A virus is a self-replicating program that can modify uninfected programs by attaching a
copy of its malicious code to them. The infected programs turn into viruses themselves and
replicate further to infect the whole system. A transient virus depends on its host program
(the executable program of which it is part) and runs when its host executes, spreading itself
and performing the malicious activities for which it was designed. A resident virus resides in
a system’s memory and can execute as a stand-alone program, even after its host program
completes execution.
• A worm, unlike the virus that uses other programs as mediums to spread itself, is a stand-
alone program that replicates through a network.
11
Chapter 1 ■ Understanding Security Concepts
• A rabbit is a virus or worm that self-replicates without limit and exhausts a computing
resource. For example, a rabbit might replicate itself to a disk unlimited times and fill up the
disk.
• A Trojan horse is code with a hidden malicious purpose in addition to its primary purpose.
• A logic trigger is malicious code that executes when a particular condition occurs (e.g., when
a file is accessed). A time trigger is a logic trigger with a specific time or date as its activating
condition.
• A trap door is a secret entry point into a program that can allow someone to bypass normal
authentication and gain access. Trap doors have always been used by programmers for
legitimate purposes such as troubleshooting, debugging, or testing programs; but they
become threats when unscrupulous programmers use them to gain unauthorized access
or perform malicious activities. Malware can install malicious programs or trap doors on
Internet-connected computers. Once installed, trap doors can open an Internet port and
enable anonymous, malicious data collection, promote products (adware), or perform any
other destructive tasks as designed by their creator.
How do we prevent infections from malicious code?
• Install only commercial software acquired from reliable, well-known vendors.
• Track the versions and vulnerabilities of all installed open source components, and maintain
an open source component-security patching strategy.
• Carefully check all default configurations for any installed software; do not assume the
defaults are set for secure operation.
• Test any new software in isolation.
• Open only “safe” attachments from known sources. Also, avoid opening attachments from
known sources that contain a strange or peculiar message.
• Maintain a recoverable system image on a daily or weekly basis (as required).
• Make and retain backup copies of executable system files as well as important personal data
that might contain “infectable” code.
• Use antivirus programs and schedule daily or weekly scans as appropriate. Don’t forget to
update the virus definition files, as a lot of new viruses get created each day!
12
Chapter 1 ■ Understanding Security Concepts
For a secure distributed system, data is hidden behind multiple layers of defenses (Figure 1-3). There are levels
such as authentication (using login name/password), authorization (roles with set of permissions), encryption
(scrambling data using keys), and so on. For SQL Server, the first layer is a user authentication layer. Second is an
authorization check to ensure that the user has necessary authorization for accessing a database through database
role(s). Specifically, any connection to a SQL Server is authenticated by the server against the stored credentials.
If the authentication is successful, the server passes the connection through. When connected, the client inherits
authorization assigned to connected login by the system administrator. That authorization includes access to any of
the system or user databases with assigned roles (for each database). That is, a user can only access the databases
he is authorized to access—and is only assigned tables with assigned permissions. At the database level, security is
further compartmentalized into table- and column-level security. When necessary, views are designed to further
segregate data and provide a more detailed level of security. Database roles are used to group security settings for a
group of tables.
Figure 1-3. SQL Server secures data with multiple levels of security
In Figure 1-3, the user who was authenticated and allowed to connect has been authorized to view employee data
in database DB1, except for the salary data (since he doesn’t belong to role HR and only users from Human Resources
have the HR role allocated to them). Access to sensitive data can thus be easily limited using roles in SQL Server.
Although the figure doesn’t illustrate them, more layers of security are possible, as you’ll learn in the next few sections.
Authentication
The first layer of security is authentication. SQL Server uses a login/password pair for authentication against stored
credential metadata. You can also use integrated security with Windows, and you can use a Windows login to
connect to SQL Server (assuming the system administrator has provided access to that login). Last, a certificate or
pair of asymmetric keys can be used for authentication. Useful features such as password policy enforcement (strong
password), date validity for a login, ability to block a login, and so forth are provided for added convenience.
13
Chapter 1 ■ Understanding Security Concepts
Authorization
The second layer is authorization. It is implemented by creating users corresponding to logins in the first layer
within various databases (on a server) as required. If a user doesn’t exist within a database, he or she doesn’t have
access to it.
Within a database, there are various objects such as tables (which hold the data), views (definitions for filtered
database access that may spread over a number of tables), stored procedures (scripts using the database scripting
language), and triggers (scripts that execute when an event occurs, such as an update of a column for a table or
inserting of a row of data for a table), and a user may have either read, modify, or execute permissions for these
objects. Also, in case of tables or views, it is possible to give partial data access (to some columns only) to users. This
provides flexibility and a very high level of granularity while configuring access.
Encryption
The third security layer is encryption. SQL Server provides two ways to encrypt your data: symmetric keys/certificates
and Transparent Database Encryption (TDE). Both these methods encrypt data “at rest” while it’s stored within a
database. SQL Server also has the capability to encrypt data in transit from client to server, by configuring corresponding
public and private certificates on the server and client to use an encrypted connection. Take a closer look:
• Encryption using symmetric keys/certificate: A symmetric key is a sequence of binary or
hexadecimal characters that’s used along with an encryption algorithm to encrypt the data.
The server and client must use the same key for encryption as well as decryption. To enhance
the security further, a certificate containing a public and private key pair can be required. The
client application must have this pair available for decryption. The real advantage of using
certificates and symmetric keys for encryption is the granularity it provides. For example,
you can encrypt only a single column from a single table (Figure 1-4)—no need to encrypt
the whole table or database (as with TDE). Encryption and decryption are CPU-intensive
operations and take up valuable processing resources. That also makes retrieval of encrypted
data slower as compared to unencrypted data. Last, encrypted data needs more storage. Thus
it makes sense to use this option if only a small part of your database contains sensitive data.
Figure 1-4. Creating column-level encryption using symmetric keys and certificates
14
Other documents randomly have
different content
24. © 15Mar55; MP5841.
25. © 18Mar55; MP5842.
26. © 22Mar55; MP5843.
27. © 25Mar55; MP6011.
28. © 29Mar55; MP6012.
29. © 1Apr55; MP6013.
30. © 5Apr55; MP6014.
31. © 8Apr55; MP6015.
32. © 12Apr55; MP6016.
33. © 15Apr55; MP6017.
34. © 19Apr55; MP6018.
35. © 22Apr55; MP6019.
36. © 26Apr55; MP6020.
37. © 29Apr55; MP6021.
38. © 3May55; MP6022.
39. © 6May55; MP6027.
40. © 10May55; MP6028.
41. © 13May55; MP6134.
42. © 17May55; MP6135.
43. © 20May55; MP6136.
44. © 24May55; MP6137.
45. © 27May55; MP6138.
46. © 31May55; MP6139.
47. © 3Jun55; MP6140.
48. © 7Jun55; MP6141.
49. © 10Jun55; MP6142.
50. © 14Jun55; MP6143.
51. © 17Jun55; MP6144.
52. © 21Jun55; MP6174.
53. © 24Jun55; MP6304.
54. © 28Jun55; MP6305.
55. © 1Jul55; MP6306.
56. © 4Jul55; MP6307.
57. © 8Jul55; MP6308.
58. © 12Jul55; MP6309.
59. © 15Jul55; MP6310.
60. © 19Jul55; MP6311.
61. © 22Jul55; MP6312.
62. © 26Jul55; MP6313.
63. © 28Jul55; MP6434.
64. © 2Aug55; MP6435.
65. © 4Aug55; MP6436.
66. © 9Aug55; MP6437.
67. © 11Aug55; MP6438.
68. © 15Aug55; MP6439.
69. © 19Aug55; MP6440.
70. © 22Aug55; MP6441.
71. © 26Aug55; MP6442.
72. © 30Aug55; MP6502.
73. © 2Sep55; MP6503.
74. © 6Sep55; MP6504.
75. © 9Sep55; MP6505.
76. © 13Sep55; MP6506.
77. © 16Sep55; MP6507.
78. © 20Sep55; MP6508.
79. © 23Sep55; MP6570.
80. © 27Sep55; MP6603.
81. © 30Sep55; MP6604.
82. © 4Oct55; MP6605.
83. © 7Oct55; MP6606.
84. © 11Oct55; MP6607.
85. © 14Oct55; MP6608.
86. © 18Oct55; MP6609.
87. © 21Oct55; MP6610.
88. © 25Oct55; MP6613.
89. © 28Oct55; MP6614.
90. © 1Nov55; MP6615.
91. © 4Nov55; MP6616.
92. © 8Nov55; MP6704.
93. © 11Nov55; MP6705.
94. © 15Nov55; MP6706.
95. © 18Nov55; MP6707.
96. © 22Nov55; MP6708.
97. © 25Nov55; MP6709.
98. © 29Nov55; MP6710.
99. © 2Dec55; MP6711.
100. © 6Dec55; MP6815.
101. © 9Dec55; MP6905.
102. © 13Dec55; MP6816.
103. © 16Dec55; MP6817.
104. © 20Dec55; MP6818.
Volume 39.
1. © 23Dec55; MP6819.
2. © 27Dec55; MP6820.
3. © 30Dec55; MP6821.
4. © 3Jan56; MP6822.
5. © 6Jan56; MP6932.
6. © 10Jan56; MP6933.
7. © 13Jan56; MP6934.
8. © 16Jan56; MP6935.
9. © 20Jan56; MP6936.
10. © 24Jan56; MP6937.
11. © 27Jan56; MP6938.
12. © 31Jan56; MP6939.
13. © 2Feb56; MP6927.
14. © 7Feb56; MP6928.
15. © 10Feb56; MP6929.
16. © 14Feb56; MP6930.
17. © 17Feb56; MP6976.
18. © 21Feb56; MP6975.
19. © 23Feb56; MP6974.
20. © 28Feb56; MP6973.
21. © 2Mar56; MP7024.
22. © 6Mar56; MP7021.
23. © 9Mar56; MP7022.
24. © 13Mar56; MP7023.
25. © 16Mar56; MP7027.
26. © 20Mar56; MP7026.
27. © 23Mar56; MP7025.
28. © 26Mar56; MP7184.
29. © 30Mar56; MP7185.
30. © 2Apr56; MP7186.
31. © 5Apr56; MP7187.
32. © 9Apr56; MP7188.
33. © 13Apr56; MP7293.
34. © 17Apr56; MP7294.
35. © 20Apr56; MP7292.
36. © 24Apr56; MP7257.
1. MU5551.
2. MU5550.
3. MU5549.
4. MU5548.
5. MU5547.
6. MU5546.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com