concept datum in category security

appears as: data, data, The data
API Security in Action

This is an excerpt from Manning's book API Security in Action.

  • Data may be at risk from people with access to the disk storage that is used for persistence. Encrypting data at rest is used to protect against these threats.
  • TLS should be used to encrypt data in transit and is covered in chapter 3. Alternatives to TLS for constrained devices are discussed in chapter 12. Encrypting data at rest is a complex topic with many aspects to consider and is largely beyond the scope of this book. Some considerations for database encryption are discussed in chapter 5.

    In addition to protecting data in transit (on the way to and from our application), you should also consider protecting any sensitive data at rest, when it is stored in your application’s database. Many different people may have access to the database, as a legitimate part of their job, or due to gaining illegitimate access to it through some other vulnerability. For this reason, you should also consider encrypting private data in the database, as shown in figure 3.5. In this chapter, we will focus on protecting data in transit with HTTPS and discuss encrypting data in the database in chapter 5.

    Figure 3.5 Encryption is used to protect data in transit between a client and our API, and at rest when stored in the database.
    Listing 4.1 Calling the Natter API from JavaScript
    const apiUrl = 'https://localhost:4567';
     
    function createSpace(name, owner) {
        let data = {name: name, owner: owner};
     
        fetch(apiUrl + '/spaces', {    #A
            method: 'POST',
            credentials: 'include',
            body: JSON.stringify(data),    #B
            headers: {    #B
                'Content-Type': 'application/json'    #B
            }
        })
        .then(response => {
            if (response.ok) {    #C
                return response.json();    #C
            } else {    #C
                throw Error(response.statusText);    #C
            }
        })
        .then(json => console.log('Created space: ', json.name, json.uri))
        .catch(error => console.error('Error: ', error));}
    API Security Starter

    This is an excerpt from Manning's book API Security Starter.

  • Network security deals with both the protection of data flowing over a network, and prevention of unauthorized access to the network itself.
  • Figure 1.6 An example dataflow diagram, showing processes, data stores and the flow of data between them. Trust boundaries are marked with dashed lines. Internal processes are marked with rounded rectangles, while external entities use squared ends. Note that we include both the database management system (DBMS) process and its data files as separate entities.

    Data integrity involves the consistency of data during its entire life cycle; data availability ensures data is obtainable at the expected level of performance in a system.1  Both concepts are essential to understanding the root cause of the webshop problems. For example, failure to retrieve data is an availability problem that often boils down to code that prevents parallel or concurrent access. Similarly, identifying code that allows modification is the place to start when analyzing integrity issues. Table 4.2 shows the webshop problems categorized as availability and integrity issues.

    Secure by Design

    This is an excerpt from Manning's book Secure by Design.

    All three factors might be important for any piece of data, but most often there’s some kind of profile for the concern of how much you suffer from a breach. Take your health record, for example. If some data is revealed (breached confidentiality), you’ll be irritated and angry. If there are errors in the data (breached integrity), things might get confused and dangerous. If the data isn’t there when needed in the emergency room (breached availability), you might end up dead.

    Data integrity involves the consistency of data during its entire life cycle; data availability ensures data is obtainable at the expected level of performance in a system.1  Both concepts are essential to understanding the root cause of the webshop problems. For example, failure to retrieve data is an availability problem that often boils down to code that prevents parallel or concurrent access. Similarly, identifying code that allows modification is the place to start when analyzing integrity issues. Table 4.2 shows the webshop problems categorized as availability and integrity issues.

    Figure 5.6 Tainted data stopped; cleaned data let through

    figure05-06.eps
    Listing 13.4 Logging categorized data to the logging system
    import static org.apache.commons.lang3.Validate.notNull;
     
    private final Logger logger ...    #1  
     
    public void bookingCancellationFailed(final BookingId id,
                                          final Result result,
                                          final User user) {
        notNull(id);
        notNull(result);
        notNull(user);
     
        logger.log(auditData(id, result, user));    #2  
        logger.log(behaviorData(result));    #3  
     
        if (result.isError()) {
            logger.log(errorData(result));    #4  
        }
    }
    
    #1   Logger that interfaces with the logging system
    #2   Sends audit data to the logging system
    #3   Sends behavior data to the logging system
    #4   Sends error data to the logging system