CHAPTER 1 ■ WELCOME TO ASP.NET WEB API
9
Confidentiality, which means preserving authorized restrictions on access and disclosure, •
including the means for protecting personal privacy and proprietary information.
Integrity, which means guarding against improper information modification or destruction, •
and includes ensuring information nonrepudiation and authenticity.
Availability, which means ensuring timely and reliable access to and use of information.•
Confidentiality is about preventing the disclosure of information to unauthorized entities. Encrypting sensitive
data and storing hashed passwords are examples of ensuring confidentiality. We look at encryption in Chapter 6 and
hashing in Chapter 15.
Integrity is about preventing modifications to the data by unauthorized entities (an entity is a user or an external
system that uses the application). This means, first and the foremost, that an entity must be identified. Identification
is the process of simply identifying the entity. It is different from authentication, which is about ensuring that the user
really has the identity that she claims to have.
As an example, consider an application where a user, John Q. Human, with a user ID of jqhuman and some
password is trying to log in to the application. As soon as the application gets the user-entered identifier of jqhuman,
it can identify the user. At that point, the user is an identified user, but not yet authenticated. Once John enters
the password, the application compares the user-entered password with the one in its records; if they match, the
identified user is considered an authentic user. It is important to note that identification must precede authentication,
because only after the user is identified can the application retrieve the password from the data store for comparison
against the user-entered password to complete the authentication process.
Authentication can be based on three factors: knowledge, ownership, and inherence. In the preceding example,
the user John uses his user ID and password. The password is something the user knows or remembers and hence the
password is a knowledge factor. Authentication can be based on things a user owns or possesses, such as a security
token or a client certificate, which are ownership factors. The third factor, the inherence factor, is something a user is,
such as a fingerprint or DNA sequence. It is also possible to combine one or more of these factors for authentication.
If two factors are involved, it is a two-factor authentication (TFA or 2FA). An example of TFA would be authentication
based on an X.509 client certificate and a user ID–password combination. We cover knowledge-factor-based security
in Chapter 8 and ownership-factor-based security in Chapters 9 and 10. Two-factor security is covered in Chapter 14.
Once an entity is authenticated, actions that the entity wishes to perform on the application can be access
controlled. Authorization is the process that ensures only those entities with permission to perform a task do perform
the task. We look at identity management in depth, mainly from the point of view of the .NET Framework and the
concepts of authentication and authorization, in Chapter 5.
Authorization ensures entities get to see and operate on what they are allowed to access, but there are cases
where an entity would like to open up its own data or information in one application to another application, mostly on
a temporary basis. There are standards available in this area, such as OAuth, which we look at in depth in Chapters 11,
12, and 13.
Authentication and authorization are important for ensuring integrity, but those two factors alone do not
constitute the exhaustive list of things needed to ensure integrity. There are other requirements, too. For example, let’s
say our application is a web application and a user posts an HTML form with data based on which application data
store will be updated. Of course, the application enforces authentication and authorization, but what if someone in
the middle tampers with the data in transit? Then, integrity is said to be compromised.
It is common to handle situations like this by securing the layer that transports the data; in the case of web
applications, this means using transport security through HTTPS/TLS. We look at HTTPS in depth in Chapter 4. An
alternative to transport security is message security, where the message is protected without protecting the transport
layer. Message security typically involves encryption and signing of messages or the data transmitted, which are
covered in depth in Chapter 6.
Similar to man-in-the-middle attacks, where an adversary in the middle attempts to tamper with data, there are
multiple other forms of attacks and associated security risks. The Open Web Application Security Project (OWASP)
is a worldwide, not-for-profit organization that publishes a list of the top ten current security risks. Risks from this list
that are relevant to ASP.NET Web API are covered in Chapter 15.