Chapter 9. Logging Events and Monitoring the Cardholder Data Environment
When most people think about information security, the idea of blocking, deflecting, denying, or otherwise stopping a malicious hacker attack comes to mind. Secure network architecture, secure server operating systems, data encryption, and other security technologies are deployed to actually shield your assets from that evil influence that can steal your information, commit fraud, or disrupt the operation of systems and networks.
Indeed, the visions of tall castle walls, deep moats, or more modern armor and battleships pervade most people's view of warfare as well as information security. However, there is more to warfare (and more to security!) than armor and shields. No, we are not talking about attacks and counter-attacks because we don't really do that in the field of information security. We are talking about the other keystone of ancient as well as modern (and, likely, future!) warfare: intelligence. Those archers who glance from the top of the castle walls and modern spy satellites that glance down to Earth are no less mandatory to winning (or “not losing,” as we have it in the field of information security) the war than fortifications and armored divisions.
In fact, security professionals often organize what they do in security into the following:
■ Prevention
■ Detection
■ Response
“Prevention” is what covers all the blocking, deflecting, denying, or stopping attacks. Notice that it includes the actual blocking of a live attack (such as running a network intrusion prevention system [IPS]) as well as making sure that such an attack cannot take place (such as deploying a patch management system). However, what happens if such prevention measures actually fail to prevent or block an attack? Wouldn't it be nice to know that when it happens?
This is exactly where “detection” comes in. All the logging and monitoring technologies, whether relevant for Payment Card Industry Data Security Standard (PCI DSS) or not, are things that allow you to know. Specifically, know that you are attacked, know that prevention measure gave way, and know that an attacker has penetrated the network and is about to make it out with the loot.
As any self-respecting security guidance, PCI DSS guidance mandates not just prevention but detection in the form of logging, alerting, and monitoring. Let's discuss all these in detail.

PCI Requirements Covered

Contrary to popular belief, logging and monitoring are not constrained to Requirement 10 but, in fact, pervade all 12 of the PCI DSS requirements; the key areas where logging and monitoring are mandated in PCI DSS are Requirement 10 and sections of Requirement 11.

Why Logging and Monitoring In PCI DSS?

As we mentioned previously, for those who are used to thinking of security as prevention or blocking, the benefits of monitoring might need to be spelled out explicitly, Before we go into describing what security monitoring measures are prescribed by PCI, we will do exactly that.
So, why monitor?
First comes situational awareness. It simply means knowing what is going on in your network and on your systems and applications. Examples here are Who is doing what on that server?, Who is accessing my network?, or What is that application doing with card data? In addition, system logging helps you know not only what is going on but also what was going on; a vital component needed for investigations and later incident response.
Next comes new threat discovery, which is simply knowing the bad stuff that is happening. This presents one of the major reasons to collect and review logs as well as to deploy intrusion detection systems (IDSs).
Third, logging helps you to get more value out of the network and security infrastructure, deployed for blocking and prevention. For example, using firewall logs for intrusion detection – often explained and justified, but not as commonly used – is an example of that.
What is even more interesting is that logging and monitoring controls (notice that these are considered security “controls” even though they don't really “control” anything) allow one to measure security and compliance by building metrics and trends. This means that one can use such data for a range of applications, from a simple “Top users by bandwidth” report obtained from firewall logs, all the way to sophisticated tracking of card data movements and use.
That is exactly why most regulations, industry mandates, and even “best practices” frameworks (International Organization for Standardization [ISO], COBIT, ITIL) call for logging and monitoring. Of course, PCI DSS is not an exception!
Last, but not least, if the worst does happen, then you would need to have as much data as possible during your incident response process: you might not use it all, but having a reliable log, assessment trail, and network capture data from all affected systems is indispensable for a hectic postincident environment.
Requirements 10 and 11 are easily capable of inflating PCI compliance costs to the point of consuming the small margins of card transactions. No one wants to lose money to be PCI compliant. Therefore, the ability to meet the requirements above all must make business sense. Nowhere else in PCI compliance does the middle ground of design philosophy come into play more than in the discipline of monitoring, but this is also where minimizing the risk can hurt most.
Finally, assuming that you've designed your PCI environment to have appropriate physical and logical boundaries through the use of segregated networks and dedicated application space as we described in Chapter 4, “Building and Maintaining a Secure Network,” you should be able to identify the boundaries of your monitoring scope. If you haven't done this part, go back to Requirement 1 and start over!

Logging and Monitoring in Depth

System and network logs, one of the key sources of monitoring data, are often called the “untapped riches.” The now-famous humorous security calendar proclaims “Logfiles: The Data Center Equivalent of Compost: Let'em Rot.”[1] Others are not as loud about it and quietly choose to follow this maxim and ignore logs – at their own peril – altogether. Many organizations, whether under PCI DSS or not, still think of security as blocking and denying and leave monitoring and logging aside, despite their importance.
On the other hand, as computer and Internet technology continues to spread and computers start playing an even more important role in our lives, the records that they produce, such as logs and other traces, start to play a bigger role. From firewalls and routers to databases and enterprise applications, to wireless access points and Voice over Internet Protocol (VoIP) gateways, logs are being spewed forth at an ever-increasing pace. Both security and other information technology (IT) components not only increase in numbers but also often come with more logging enabled out of the box. An example of this trend includes Linux operating system as well as Web servers, both commercial and open-source, that now ship with increased levels of logging out of the box. All those systems, both legacy and modern, are known to generate copious amounts of logs, assessment trails, records, and alerts. In addition, such additional monitoring methods as network packet capture, database activity monitoring (DAM), and special-purpose application monitoring are becoming common as well. And all this data begs for constant attention!

Warning
A log management problem is to a large extent a data management problem. Thus, if you deal with logs (and deal with them you must – and not only due to PCI DSS mandate), you'll deal with plenty of data.
With logs, it is much better to err on the side of keeping more – in case you'd need to look at it later. This is not the same as saying that you have to keep every log message, but retaining more log data is safer.
But this is easier said than done. Immense volumes of monitoring data are being generated on payment card processing networks. In turn, it results in a need to manage, store, and search all this data. Moreover, such review of data needs to happen both reactively – after a suspected incident – and proactively – in search of potential risks and future problems. For example, a typical large retailer generates hundreds of thousands of log messages per day amounting to many terabytes per year. An online merchant can generate millions of various log messages every day. One of America's largest retailers has more than 60 TB of log data on their systems at any given time. Unlike other companies, retailers do not have the option of not using logging due to PCI DSS.

Note
Even though we refer to “retailers,” PCI is not only about retailers but also about anyone who “stores, processes, or transmits” credit- or debit-card numbers in the course of his or her business.
To start our discussion of PCI logging and monitoring requirements, Table 9.1 shows a sample list of technologies that produce logs of relevance to PCI. Though this list is not comprehensive, it is likely that the readers find at least one system that they have in their cardholder data environment and for which logs are not being collected, much less looked at, and that is not being monitored at all.
Table 9.1 Log-Producing Technologies, Monitored Using Their Logs
TypeExample Logs
Operating SystemsLinux, Solaris syslog, Windows Event Log
DatabasesOracle, Structured Query Language Server assessment trails
Network infrastructureCisco routers and switches syslog
Remote accessVirtual private network logs
Network securityCisco PIX firewalls syslog
Intrusion detection and preventionsSnort network intrusion detection system syslog and packet capture
Enterprise applicationsSAP, PeopleSoft logs
Web serversApache logs, Internet Information Server logs
Proxy serversBlueCoat, Squid logs
E-mail serversSendmail syslog, various Exchange logs
Domain Name System (DNS) serversBind DNS logs, MS DNS
Antivirus and antispywareSymantec AV event logs, TrendMicro AV logs
Physical access controlIDenticard, CoreStreet
Wireless networkingCisco Aironet AP logs
In addition, Table 9.2 shows a few of the technologies not commonly monitored using logs.
Table 9.2 Technologies Commonly Monitored Not Using Logs
TypeHow to Monitor?
DatabasesOracle, Structured Query Language Server database activity monitoring
Enterprise applicationsSAP, PeopleSoft application monitoring

Note
Table 9.2 is not a full list; everybody has some esoteric and not so esoteric applications and devices that produce logs that are not covered in this table. In any case, if these devices are included in a payment card environment, it is likely that these device logs need to be collected, stored, and analyzed to satisfy PCI Requirement 10 as well as others.

Note
An astute reader notices that databases are present in Table 9.1 and Table 9.2. How can that be? The reality of database security monitoring is such that even though logs (namely, assessment tables) are available in all major commercial and free, open-source databases, they are rarely used for monitoring. The most common reason for such neglect of logs in the database realm is due to a measurable performance impact that logging incurs on a high-performance production database. As a result, other mechanisms, such as dedicated security agents or IDS-like network sniffing appliances, are used to monitor database activity.
Many companies and government agencies are trying to set up repeatable log collection, centralization, and analysis processes and tools.
Despite the multitude of log sources and types, people typically start from network and firewall logs and then progress upward on the protocol stack as well as sideways toward other nonnetwork applications. For example, just about any firewall or network administrator will look at a simple summary of connections that his or her Cisco ASA (or older PIX) or Checkpoint firewall is logging. Many firewalls log in standard syslog format, and such logs are easy to collect and review.
For example, here is a Juniper firewall log message in syslog format:
NOC-FWa: NetScreen device_id=NOC-FWa system-notification-00257(traffic): start_time=“2007-05-01 19:17:37” duration=60 policy_id=9 service=snmp proto=17 src zone=noc-services dst zone=access-ethernet action=Permit sent=547 rcvd=432 src=10.0.12.10 dst=10.2.16.10 src_port=1184 dst_port=161 src-xlated ip=10.0.12.10 port=1184
And, here is the one from Cisco ASA firewall device:
%ASA-6-106100: access-list outside_access_in denied icmp outside/10.88.81.77(0) -> inside/192.10.10.246(11) hit-cnt 1 (first hit)
Reviewing network intrusion detection system (NIDS) or IPS logs, although “interesting” in case of an incident, is often a very frustrating task since NIDS would sometimes produce “false alarms” and dutifully log them. Still, NIDS log analysis, at least the postmortem kind for investigative purposes, often happens right after firewall logs are looked at.
As a result, organizations deploy their log management infrastructure for compliance, security, or operational uses; the value of such information for security is undeniable, and logs can, in most cases, be easily centralized for analysis.
Even though system administrators always knew to look at logs in case of problems, massive server operating system (both Windows and Unix/Linux variants) log analysis didn't materialize until more recently. Collecting logs from Windows servers, for example, was hindered by the lack of agentless log collection tools, such as Lasso, that only emerged in the last year or two. On the other hand, Unix server log analysis was severely undercut by a total lack of unified format for log content in syslog records.
Web server logs were long analyzed by marketing departments to check on their online campaign successes. Most Web server administrators would also not ignore those logs. However, because Web servers don't have native log forwarding capabilities (most log to files stored on the server itself), consistent centralized Web log analysis for both security and other IT purposes is still ramping up.
For example, the open-source Apache Web server has several types of logs. The most typical among them are access_log that contains all page requests made to the server (with their response codes) and error_log that contains various errors and problems. Other Apache logs relate to Secure Sockets Layer (SSL) (ssl_error_log) as well as optional granular assessment logs that can be configured using tools such as ModSecurity (which produces an additional highly-detailed audit_log).
Similarly, e-mail tracking through e-mail server logs languishes in a somewhat similar manner: people only turn to e-mail logs when something goes wrong (e-mail failures) or horribly wrong (external party subpoenas your logs). Lack of native centralization and, to some extent, complicated log formats slowed down the e-mail log analysis initiatives.
Even more than e-mail, database logging wasn't on the radar of most IT folks until last year. In fact, IT folks were perfectly happy with the fact that even though Relational Database Management Systems (RDBMSs) had extensive logging and data access assessment capabilities, most of them were never turned on – many times citing performance issues. Oracle, Microsoft Structured Query Language (SQL) Server, IBM DB2, and MySQL all provide excellent logging, if you know how to enable it, configure it for your specific needs, and analyze and leverage the resulting onslaught of data. In the context of PCI DSS, database monitoring is often performed not using logs but instead using a separate software called DAM.
What's next? Web applications and large enterprise application frameworks largely lived in a world of their own, but now people are starting to realize that their log data provides unique insight into insider attacks, insider data theft, and other trusted access abuse. Additionally, desktop operating system log analysis from large numbers of deployed desktops will also follow.

PCI Relevance of Logs

Before we begin with covering additional details on logging and monitoring in PCI, one question needs to be addressed. It often happens that PCI Qualified Security Assessors (QSAs) or security consultants are approached by the merchants: what exactly must they log and monitor for PCI DSS compliance? The honest answer to the above question is that there is no list of what exactly you must be logging due to PCI or, pretty much, any other recent compliance mandate. That is true despite the fact that PCI rules are more specific than most other recent regulations, affecting information security. However, the above does not mean that you can log nothing.
The only thing that can be explained is what you should be logging. There is no easy “MUST-log-this” list; it is pretty much up to individual assessor, consultant, vendor, engineer, and so forth to interpret – not simply “read,” but interpret! – PCI DSS guidance in your own environment. In addition, when planning what to log and monitor, it makes sense to start from compliance requirement as opposed to end with what PCI DSS suggests. After all, organization can derive value from using it, even without regulatory or industry compliance.
So, which logs are relevant to your PCI project? In some circumstances, the answer is “all of them,” but it is more likely that logs from systems that handle credit-card information, as well as systems they connect to, will be in-scope. Please refer to the data flow diagram that was described in Chapter 4, “Building and Maintaining a Secure Network,” to determine which systems actually PCI DSS requirements apply to all members, merchants, and service providers that store, process, or transmit cardholder data. Additionally, these requirements apply to all “system components,” which are defined as “any network component, server, or application included in, or connected to, the cardholder data environment.” Network components include, but are not limited to, firewalls, switches, routers, wireless access points, network appliances, and other security appliances. Servers include, but are not limited to, Web, database, authentication, Domain Name System (DNS), e-mail, proxy, and Network Time Protocol (NTP). Applications include all off-the-shelf and custom-built applications, including internally facing and externally facing Web applications.
By the way, it is important to remind you that approaching logging and monitoring with the sole purpose of becoming PCI compliant is not only wasteful but can actually undermine the intent of PCI DSS compliance. Staring from its intent – cardholder data security – is the way to go, which we advocate.
The following are a few common uses for log information, besides PCI DSS compliance:
■ Threat detection: Even before PCI times in the 1990s, host intrusion detection system (HIDS) looked at assessment trails and logs in search of patterns and strings in logs and raised alerts upon seeing them. Today, hunting for signs of hacking attempts (as well as successes in the form of “compromise detection”) in logs is just as useful.
■ Incident response and troubleshooting: When a system is hacked, logs are the most informative, accessible, and relatively easy to analyze (compared to full disk images) form of incident evidence.
■ Audit: IT auditors as well as PCI assessors commonly ask for logs from in-scope systems.
■ E-discovery: Although some say that a possibility of a subpoena or an e-discovery requests provides a compelling reason to not have logs, in reality, hiding one's head in the sand is unlikely to work in this case.
■ IT performance management and troubleshooting network is slow? Looking at logs will help find out why.
■ Network management: Although log pundits might argue on whether a Simple Network Management Protocol (SNMP) trap is a kind of log record, logs are useful for many bandwidth management and network performance measurement tasks that are common in IT.
■ Other compliance: Just about every recent regulatory compliance or “best practices” framework touches on assessment logs, now we are ready to dive into the specifics of PCI and logging.

Logging in PCI Requirement 10

Let's quickly go through Requirement 10, which directly addresses logging. We will go through it line by line and then go into details, examples, and implementation guidance.
The requirement itself is called “Track and monitor all access to network resources and cardholder data” and is organized under the “Regularly monitor and test networks” heading. The theme thus deals with both periodic (test) and ongoing (monitor) aspects of maintaining your security; we are focusing on logging and monitoring and have addressed periodic testing in Chapter 8, “Vulnerability Management.” More specifically, it requires a network operator to track and monitor all access to network resources and cardholder data. Thus, both network resources that handle the data and the data itself are subject to those protections.
Further, the requirement states that logging is critical, primarily when “something does go wrong” and one needs to “determine the cause of a compromise” or other problem. Indeed, logs are of immense importance for incident response. However, using logs for routine user tracking and system analysis cannot be underestimated. Next, the requirement is organized in several sections on process, events that need to be logged, suggested level of details, time synchronization, assessment log security, required log review, and log retention policy.
Specifically, Requirement 10.1 covers “establish[ing] a process for linking all access to system components (especially access done with administrative privileges such as root) to each individual user.” This is a very interesting requirement indeed; it doesn't just mandate for logs to be there or for a logging process to be set, but instead it mentions that logs must be tied to individual persons (not computers or “devices” where they are produced). It is this requirement that often creates problems for PCI implementers because many think of logs as “records of people actions,” while in reality they will only have the “records of computer actions.” Mapping the latter to actual flesh-and-blood users often presents an additional challenge. By the way, PCI DSS Requirement 8.1 mandates that an organization “assigns all users a unique ID before allowing them to access system components or cardholder data, which” helps to make the logs more useful here.

Note
Question: Do I have to manually read every single log record daily to satisfy PCI Requirement 10?
Answer: No, automated log analysis and review is acceptable and, in fact, recommended in PCI DSS.
Next, Section 10.2 defines a minimum list of system events to be logged (or, to allow “the events to be reconstructed”). Such requirements are motivated by the need to assess and monitor user actions as well as other events that can affect credit-card data (such as system failures).
Following is the list from the requirements (events that must be logged) from PCI DSS:
■ 10.2.1: All individual user accesses to cardholder data
■ 10.2.2: All actions taken by any individual with root or administrative privileges
■ 10.2.3: Access to all audit trails
■ 10.2.4: Invalid logical access attempts
■ 10.2 5: Use of identification and authentication mechanisms
■ 10.2.6: Initialization of the audit logs
■ 10.2.7: Creation and deletion of system-level objects
As can be seen, this covers data access, privileged user actions, log access and initialization, failed and invalid access attempts, authentication and authorization decisions, and system object changes. It is important to note that such a list has its roots in IT governance “best practices,” which prescribe monitoring access, authentication, authorization change management, system availability, and suspicious activity. Thus, other regulations, such as the Sarbanes–Oxley Act and IT governance frameworks such as COBIT, have very similar lists of events that need to be logged.

Note
We hope that in the future, such a list of system events will be determined by the overall log standards that go beyond PCI. There are ongoing log standard projects such as Common Event Expression (CEE) from MITRE [2] that have a chance to produce such a universally accepted (or at least, industry-accepted) list of events in the next 2 to 3 years.
Table 9.3 is a practical example of the list on the previous page.
Table 9.3 Logging Requirement and How to Address Them
Requirement NumberRequirementExample Type of a Log Message
10.2.1All individual user accesses to cardholder dataSuccessful logins to processing server (Unix, Windows)
10.2.2All actions taken by any individual with root or administrative privilegesSudo root actions on a processing server
10.2.3Access to all audit trailsExecution of Windows event viewer
10.2.4Invalid logical access attemptsFailed logins (Unix, Windows)
10.2.5Use of identification and authentication mechanismsAll successful, failed, and invalid login attempts
10.2.6Initialization of the audit logsWindows audit log cleaned alert
10.2.7Creation and deletion of system-level objectsUnix user added, Windows security policy updated, database created
Moreover, PCI DSS Requirement 10 goes into an even deeper level of detail and covers specific data fields or values that need to be logged for each event. They provide a healthy minimum requirement, which is commonly exceeded by logging mechanisms in various IT platforms.
Such fields are as follows:
■ 10.3.1: User identification
■ 10.3.2: Type of event
■ 10.3.3: Date and time
■ 10.3.4: Success or failure indication
■ 10.3.5: Origination of event
■ 10.3.6: Identity or name of affected data, system component, or resource
As shown, this minimum list contains all the basic attributes needed for incident analysis and for answering the questions: when, who, where, what, and where from. For example, if you are trying to discover who modified a credit-card database to copy all the transactions with all the details into a hidden file (a typical insider privilege abuse), you would need-to-know all the above. Table 9.4 summarizes the above fields in this case.
Table 9.4 PCI Event Details
PCI RequirementPurpose
10.3.1: User identificationWhich user account is associated with the event being logged? This might not necessarily mean “which person,” only which username
10.3.2: Type of eventWas it a system configuration change? File addition? Database configuration change? Explains what exactly happened
10.3.3: Date and timeWhen did it happen? This information helps in tying the event to an actual person
10.3.4: Success or failure indicationDid he or she try to do something else that failed before his or her success in changing the configuration?
10.3.5: Origination of eventWhere did he or she connect from? Was it a local access or network access? This also helps in tying the log event to a person. Note that this can also refer to the process or application that originated the event
10.3.6: Identity or name of affected data, system component, or resourceWhat is the name of the database, system object, and so forth which was affected? Which server did it happen on? This provides important additional information about the event
Requirement 10.4 addresses a commonly overlooked but critical requirement: a need to have accurate and consistent time in all of the logs. It seems fairly straightforward that time and security event monitoring would go hand in hand as well.
System time is frequently found to be arbitrary in a home or small office network. It's whatever time your server was set at, or if you designed your network for some level of reliance, your systems are configured to obtain time synchronization from a reliable source, like the NTP servers.
A need to “synchronize all critical system clocks and times” can make or break your incident response or lead to countless hours spent figuring out the actual times of events by correlating multiple sources of information together. In some cases, uncertainty about the log timestamps might even lead a court case to be dismissed because uncertainly about timestamps might lead to uncertainty in other claims as well. For example, from “so you are saying you are not sure when exactly it happened?” an expert attorney might jump to “so maybe you are not even sure what happened?” Fortunately, this requirement is relatively straightforward to address by configuring an NTP environment and then configuring all servers to synchronize time with it. The primary NTP servers can synchronize time with time.nist.gov or other official time sources, also called “Stratum 1” sources.
Stratum 1 time sources are those devices acquiring time data from direct sources like the atomic clocks run by various government entities or Global Positioning System (GPS) satellites. Local hardware, in fact, is considered Stratum 1; it gets time from its own CMOS. Stratum 2 gets its time from Stratum 1 and so on. For purposes of PCI compliance, Stratum 2 is sufficient to “prove” time, as long as all systems in the PCI environment synchronize their clocks with the Stratum 2 source via the network. Obviously, having reliable power and network is critical to this sort of approach.
Security of the logs themselves is of paramount importance for reasons similar to the above concerns about the log time synchronization. Requirement 10.5 states that one needs to “secure audit trails so they cannot be altered” and then clarifies various risks that need to be addressed.
Because it is a key issue, we will look at the security of monitoring data and logs in the next section.

Monitoring Data and Log Security Issues

Although PCI is more about being compliant than about being hacked (well, not directly!), logs certainly help to answer this question. However, if logs themselves are compromised by the attackers and the log server is broken into, they lose all values for either security or compliance purposes. Thus, having assured log confidentiality, integrity, and availability (CIA) is a requirement for PCI as well as a best practice for other log uses.
First, one needs to address all the CIA of logs. Section 10.5.1 of PCI DSS covers the confidentiality: “Limit viewing of audit trails to those with a job-related need.” This means that only those who need to see the logs to accomplish their jobs should be able to. What is so sensitive about logs? One of the obvious answers is that authentication-related logs will always contain usernames. Although not truly secret, username information provides 50 percent of the information needed for password guessing (password being the other 50 percent). Why give possible attackers (whether internal or external) this information? Moreover, because of users mistyping their credentials, it is not uncommon for passwords themselves to show up in logs. Poorly written Web applications might result in a password being logged together with the Web Uniform Resource Locator (URL) in Web server logs. Similarly, a Unix server log might contain a user password if the user accidentally presses “Enter” one extra time while logging in.
Next comes “integrity.” As per Section 10.5.2 of PCI DSS, one needs to “protect audit trail files from unauthorized modifications.” This one is blatantly obvious; because if logs can be modified by unauthorized parties (or by anybody), they stop being an objective assessment trail of system and user activities.
However, one needs to preserve the logs not only from malicious users but also from system failures and consequences of system configuration errors. This touches upon both the “availability” and “integrity” of log data. Specifically, Section 10.5.3 of PCI DSS covers that one needs to “promptly back-up audit trail files to a centralized log server or media that is difficult to alter.” Indeed, centralizing logs to a server or a set of servers that can be used for log analysis is essential for both log protection and increasing log usefulness. Backing up logs to CDs or DVDs (or tapes, for that matter) is another action one has to perform as a result of this requirement. One should always keep in mind that logs on tape are not easily accessible and not searchable in case of an incident.
Many pieces of network infrastructure such as routers and switches are designed to log to an external server and only preserve a minimum (or none) of logs on the device itself. Thus, for those systems, centralizing logs is most critical. Requirement 10.5.4 of PCI DSS states the need to “copy logs for wireless networks onto a log server on the internal LAN.”
To further decrease the risk of log alteration as well as to enable proof that such alteration didn't take place, Requirement 10.5.5 calls for the “use file integrity monitoring and change detection software on logs to ensure that existing log data cannot be changed without generating alerts.” At the same time, adding new log data to a log file should not generate an alert because log files tend to grow and not shrink on their own (unless logs are rotated or archived to external storage). File integrity monitoring systems use cryptographic hashing algorithms to compare files to a known good copy. The issue with logs is that log files tend to grow due to new record addition, thus undermining the utility of integrity checking. To resolve this difficulty one should note that integrity monitoring can only assure the integrity of logs that are not being actively written to by the logging components. However, there are solutions that can verify the integrity of growing logs.
The next requirement is one of the most important as well as one of the most overlooked. Many PCI implementers simply forget that PCI Requirement 10 does not just call for “having logs” but also for “having the logs and looking at them.” Specifically, Section 10.6 states that the PCI organization must, as per PCI DSS, “review logs for all system components at least daily. Log reviews must include those servers that perform security functions like IDSs and AAA servers (e.g., RADIUS).”
Thus, the requirement covers the scope of log sources that need to be “reviewed daily” and not just configured to log and have logs preserved or centralized. Given that a Fortune 1000 IT environment might produce gigabytes of logs per day, it is humanly impossible to read all of the logs. That is why a note is added to this requirement of PCI DSS that states that “Log harvesting, parsing, and alerting tools may be used to achieve compliance with Requirement 10.6.” Indeed, log management tools are the only way to go to satisfy this requirement.
The final Requirement 10.7 deals with another hugely important logging question – log retention. It says to “retain audit trail history for at least one year, with a minimum of three months online availability.” Unlike countless other requirements, this deals with the complicated log retention question directly. Thus, if you are not able to go back 1 year and look at the logs, you are in violation. Moreover, PCI DSS in its updated version v1.1 got more prescriptive when a 1-year requirement was added explicitly.
So, let us summarize what we have learned so far on logging in PCI:
■ PCI Requirement 10 calls for logging specific events with a predefined level of details from all in-scope systems.
■ PCI calls for tying the actual users to all logged actions.
■ All clocks and time on the in-scope systems should be synchronized.
■ The CIA of all collected logs should be protected.
■ Logs should be regularly reviewed; specific logs should be reviewed at least daily.
■ All in-scope logs should be retained for at least 1 year.
Now, we are ready to dig deeper to discover that logs and monitoring “live” not only within Requirement 10 but in all other PCI requirements.

Logging and Monitoring In PCI – All Other Requirements

Although many people think that logs in PCI are represented only by Requirement 10, the reality is more complicated: logs are in fact present, undercover, in all other sections. We will now reveal where they hide in other sections. Table 9.5 highlights some of the places where logging requirements are implied or mentioned. The overall theme here is that logging and log management assists with validation and verification of many other requirements.
Table 9.5 Logging and Monitoring across PCI DSS Requirements
DomainRequirementLogging Relevance and Recommendations
1Build and maintain a secure networkInstall and maintain a firewall configuration to protect cardholder dataEnable firewall logging, review logs for access violations, use of risky protocols, device configuration changes, accesses to critical network segments
2Build and maintain a secure networkDo not use vendor-supplied defaults for system passwords and other security parametersReview logs to look for insecure services, additional services starting on servers, as well as password changes upon server deployment
3Protect cardholder dataProtect stored cardholder dataReview the logs related to key management to verify that the requirements (such as key changes) are being followed
4Protect cardholder dataEncrypt transmission of cardholder data across open, public networksLook at firewall, virtual private network logs to verify that only secure network communication is used
5Maintain a vulnerability management programUse and regularly update antivirus softwareVerify that antivirus software is updated by looking at antivirus logs; also look for detection and mitigation failures that might indicate that malware is present on the network
6Maintain a vulnerability management programDevelop and maintain secure systems and applicationsMake sure that custom applications written or customized for your environment also provide logging. Watch logs of system update and software distribution servers to make sure that patches are being deployed when needed on all relevant servers
7Implement strong access control measuresRestrict access to cardholder data by business need-to-knowVerify that such access is indeed limited by reviewing the access logs
8Implement strong access control measuresAssign a unique ID to each person with computer accessPerform log correlation to detect ID sharing in violation of this requirement; review logs indicating changes to users' privileges; verify password changes based on authentication systems logs, and so forth. Look for administrator and root accounts that can sometimes be shared (and are rarely removed from systems)
9Implement strong access control measuresRestrict physical access to cardholder dataCollect, analyze, and review physical access control system logs
10Regularly monitor and test networksTrack and monitor all access to network resources and cardholder dataCovered above; this is the main logging and monitoring requirement
11Regularly monitor and test networksRegularly test security systems and processesMonitor intrusion detection/prevention systems and file integrity checking
12Maintain an information security policyMaintain a policy that addresses information securityMake sure that logging and monitoring are represented in your security policy as well as operational standards, procedures, and management reports
Now, let's dive deeper into the role of logs to further explain that logs are not only about the Requirement 10. Just about every claim that is made to satisfy the requirements, such as data encryption or antivirus updates, can make effective use of log files to actually substantiate it.
For example, Requirement 1, “Install and maintain a firewall configuration to protect cardholder data,” mentions that organizations must have “a formal process for approving and testing all external network connections and changes to the firewall configuration.” However, after such a process is established, one needs to validate that firewall configuration changes do happen with authorization and in accordance with documented change management procedures. That is where logging becomes extremely handy, because it shows you what actually happened and not just what was supposed to happen.
Specifically, seeing a message such as this Cisco ASA appliance record should indicate that someone is likely trying to modify the appliance configuration.
%ASA-5-502103: User priv level changed: Uname: jsmith From: privilege_level1 To: privilege_level2
Or this message indicates a failure to complete configuration update:
%ASA-5-111004: 10.1.1.1 end configuration: FAILED
Other log-related areas within Requirement 1 include Section 1.1.6.
“Justification and documentation for any available protocols besides Hypertext Transfer Protocol (HTTP), SSL, Secure Shell (SSH), and virtual private network (VPN) where logs should be used to watch for all events triggered due to such communication.”
Section 1.1.7: Justification and documentation for any risky protocols allowed (for example, File Transfer Protocol [FTP]), which includes the reason for use of protocol and security features implemented, where logs help to catalog the user of “risky” protocols and then monitor such use.
The entire Requirement 1.3 contains guidance to firewall configuration, with specific statements about inbound and outbound connectivity. One must use firewall logs to verify this; even a review of configuration would not be sufficient, because only logs show “how it really happened” and not just “how it was configured.”
Similarly, Requirement 2 talks about password management “best practices” as well as general security hardening, such as not running unneeded services. Logs can show when such previously disabled services are being started, either by misinformed system administrators or by attackers.
For example, if Apache Web server is disabled on an e-mail server system, a message such as the following should trigger an alert because the service should not be starting or restarting.
[Sun Jul 18 04:02:09 2004] [notice] Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_ssl/2.8.1 OpenSSL/0.9.6 DAV/1.0.2 PHP/4.0.4pl1 mod_perl/1.24_01 configured — resuming normal operations
Further, Requirement 3, which deals with data encryption, has direct and unambiguous links to logging. For example, the entire subsection 3.6, shown below in an abbreviated form, implies having logs to verify that such activity actually takes place.
“3.6: Fully document and implement all key management processes and procedures for keys used for encryption of cardholder data, including the following:
3.6.1: Generation of strong keys
3.6.2: Secure key distribution
3.6.3: Secure key storage
3.6.4: Periodic changing of keys
3.6.5: Destruction of old keys”
Specifically, key generation, distribution, and revocation are logged by most encryption systems, and such logs are critical for satisfying this requirement.
Requirement 4, which also deals with encryption, has logging implications for similar reasons.
Requirement 5 refers to antivirus defenses. Of course, to satisfy Section 5.2, which requires that you “Ensure that all antivirus mechanisms are current, actively running, and capable of generating audit logs,” one needs to see such mentioned logs.
For example, Symantec AntiVirus might produce the following log record that occurs when the antivirus software experiences problems and cannot continue scanning, thus putting you in violation of PCI DSS rules.
Product: Symantec AntiVirus – Error 1706. AntiVirus cannot continue.
Thus, unless you are monitoring for such event records, you cannot be in compliance.
So, even the requirement to “use and regularly update antivirus software” will likely generate requests for log data during the assessment, because the information is present in antivirus assessment logs. It is also well-known that failed antivirus updates, also reflected in logs, expose the company to malware risks because antivirus without the latest signature updates only creates a false sense of security and undermines the compliance effort.
Requirement 6 is in the same league: it calls for the organizations to “Develop and maintain secure systems and applications,” which is unthinkable without a strong assessment logging function and application security monitoring.
Requirement 7, which states that one needs to “Restrict access to cardholder data by business need-to-know,” requires logs to validate who actually had access to said data. If the users who should be prevented from seeing the data appear in the log files as accessing the data usefully, remediation is needed.
Assigning an unique ID to each user accessing the system fits with other security “best practices.” In PCI, it is not just a “best practice”; it is a requirement (Requirement 8 “Assign a unique ID to each person with computer access”).
Obviously, one needs to “Control addition, deletion, and modification of user IDs, credentials, and other identifier objects” (Section 8.5.1 of PCI DSS). Most systems log such activities.
For example, the message below indicates a new user being added to a PIX/ASA firewall.
%ASA-5-502101: New user added to local dbase: Uname: anilt Priv: 1 Encpass: 56Rt8U
In addition, Section 8.5.9, “Change user passwords at least every 90 days,” can also be verified by reviewing the logs files from the server to assure that all the accounts have their password changed at least every 90 days.
Requirement 9 presents a new realm of security – physical access control. Even Section 9.4 that covers maintaining a visitor log (likely in the form of a physical log book) is connected to log management if such a visitor log is electronic. There are separate data retention requirements for such logs: “Use a visitor log to maintain a physical assessment trail of visitor activity. Retain this log for a minimum of three months, unless otherwise restricted by law.”
Requirement 11 addresses the need to scan (or “test”) the in-scope systems for vulnerabilities. However, it also calls for the use of IDS or IPS in Section 11.4: “Use network intrusion detection systems, host-based intrusion detection systems, and intrusion prevention systems to monitor all network traffic and alert personnel to suspected compromises. Keep all intrusion detection and prevention engines up-to-date.” Intrusion detection is only useful if monitored.
Requirement 12 covers the issues on a higher level – security policy as well as security standards and daily operational procedures (e.g., a procedure for daily log review mandates by Requirement 10 should be reflected here). However, it also has logging implications because assessment logging should be a part of every security policy. In addition, incident response requirements are also tied to logging: “Establish, document, and distribute security incident response and escalation procedures to ensure timely and effective handling of all situations” is unthinkable to satisfy without effective collection and timely review of log data.
Thus, event logging and security monitoring in PCI DSS program goes much beyond Requirement 10. Only through careful data collection and analysis can companies meet the broad requirements of PCI.

Tools For Logging in PCI

At this stage, we went through all of the PCI guidelines and uncovered where logging and monitoring are referenced. We now have a mammoth task ahead – how to address all those requirements? Let's quickly go back and review what we learned, both in Requirement 10 and beyond.
■ We need to make sure that we log specific events with a predefined level of detail from all in-scope systems.
■ PCI calls for tying the actual users to all logged actions.
■ All time on the in-scope systems should be synchronized.
■ The CIA of all collected logs should be protected. In addition, auditing access to audit logs is also essential.
■ Logs – and other monitoring data – should be regularly reviewed; specific logs should be reviewed at least daily. Automation of such review is not only acceptable but desirable, because manual review is guaranteed to fail (on high-volume networks).
■ All in-scope logs should be retained for at least 1 year, with live availability for 3 months.
■ In-scope systems include at least all systems that directly process credit-card data (such as PAN and other private cardholder information), including underlying operating systems as well as data processing applications, systems that store such data, network infrastructure for networks where such data is transmitted, and systems that protect any of the above (such as firewalls, NIDS, and Internet Protocol Security [IPS]).This also includes systems not specifically segregated from these processing servers and applications.
Let's analyze the above requirements and needs to determine what kind of tools we might need to develop or procure.
First, let's note that if we are talking about a single server and a single piece of network gear such as a router, there might be no need for automation and tools. One can easily configure logging and then look at the logs (measuring a few pages of text a day or more, in case more comprehensive assessing is performed), as well as save a copy of said logs to make sure that one can go back a year and review the old logs if needed. However, this approach fails miserably and dramatically when the number of systems grows from 1 to, say, 10. In reality, a large e-commerce site or a whole chain of stores might easily have thousands of in-scope systems, starting from mainframes with customer databases down to servers to complex network architectures (including classic LANs, WANs, wireless networks, and remote access systems with hundreds of remote users) to point of sale (POS) systems and all the way down to wireless card scanners. A handheld wireless card scanner is “a credit-card processing system” and thus is in-scope for PCI compliance. Looking through recent media headlines, such as credit card compromises at BestBuy and other “brick and mortar” retailers, one learns that credit-card information has indeed been stolen this way.
Once it has been accepted that manual review of logs is not feasible or effective, the next attempt to satisfy the requirements usually comes in the form of scripts written by system administrators, to filter, review, and centralize the logs as well as makeshift remote logging collectors (usually limited to those log sources that support syslog, which is easy to forward to another system).
For example, one might configure all in-scope Unix servers to log a single “log server” and then write a Perl script that will scan the logs for specific strings (such as “fail*,” “attack,” “denied,” “modify,” and so forth) and then send an e-mail to the administrator upon finding one of those strings. Another script might be used to summarize the log records into a simple “report” that highlights, for example, “Top Users” or “Top IP Addresses.” A few creative tools were written to implement various advanced methods of log analysis, such as rule-based or stateful correlation.
Such “solutions” work well and do not require any initial investment. Other advantages of such “homegrown” approaches are as follows:
■ You are likely to get exactly what you want because you design and build the tool for your environment.
■ You can develop tools that have capabilities not offered by any commercial tool vendor.
■ The choice of platform, development tools, analysis methods, and everything else is yours alone.
■ You can later customize the solution to suit your future needs.
■ There is no up-front cost for buying software and even hardware (if you are reusing some old unused servers, which is frequently the case for such log analysis projects).
■ Many system administrators say that “it is fun to do.”
What makes it even easier is the availability of open source and freeware tools to address some of the pieces of log management for PCI. For example, Table 9.6 summarizes a few popular tools that can be (and in fact, have been) used in PCI log management projects.
Table 9.6 Logging Tools Useful for PCI DSS
OriginToolLicensePurposeSatisfied PCI Requirement
BalaBit ITsyslog-ngOpen sourceGeneral purpose syslog replacement, reliable, and secure log transferMultiple sections of Requirement 10 and others; enabling infrastructure
Project LASSOProject LASSOOpen sourceRemote Windows event collectionWindows logging centralization; enables analysis of Windows logs covered by Requirement 10
VariousStunnel, OpenSSH, FreeS/WANOpen sourceSecure data (including log) transferLog protection sections in Requirement 10
VariousMySQL, PostgreSQLOpen sourceData (including log) storageLog retention section of Requirement 10
VariousSwatch, logwatch, logsentryOpen sourceSmall scripts for log filtering, alerting, and simple monitoring automationAutomated log review in Requirement 10
Risto VaarandiSECOpen sourceLog correlation and rule-based analysisAutomated log review in Requirement 10 on a more advanced level
OSSEC teamOSSECOpen sourceLog analysisAutomated log review in Requirement 10 on a more advanced level
OSSIM teamOSSIMOpen sourceLog analysis and correlation across logs and other information sourcesAutomated security monitoring across various systems
However, if an author's extensive experience with logging and monitoring is any indication, most if not all projects of this type, no matter how well thought-out and no matter how well funded, will fail.
One reason for it is the scalability of such custom tool. It might work great in a laboratory but fall completely flat on its face in a production environment due to data volume, complexities of infrastructure, and so forth. Log analysis or security monitoring system needs to be capable to handle volume, not only live flow but also storage. A lot of log tools work well on 10 MB of logs, but then again, so does a human brain. When you move to terabyte volumes, a lot of simple things start to require engineering marvels. Is it as hard as getting the Linux kernel (the pinnacle of open-source engineering) to achieve high performance? Probably not as hard, but the logging tool developer needs to be both a log expert and a performance expert.
In addition, the question is also whether this tool will scale with your organization or will it require a complete redesign and then rewrite when your environment grows and/or your needs change? Such efforts are usually a big drain on IT teams because people who might be doing things critical to maintaining a well-oiled “IT machine,” all start writing code instead – and often not the most secure and efficient code at that.
Next, management often likes to point out that such an approach doesn't pass “the bus test” (namely, there is no satisfying and credible answer to the question, “What do we do if the smart guy who wrote this wonder of log analysis technology gets run over by a bus?”).
And the final, most terrifying reason: ongoing maintenance of such tools is what deals a mortal blow to many in-house log analysis projects. System vendors change, log formats change, often without notice and without documents (provided they did have documents in the first place) thus leading to log analysis system failures with subsequent gaps in PCI-compliance log review or, worse, log collection or retention. We are aware of more than one case where a large corporation abandoned a well-built in-house log analysis tool (with capabilities superior to those of commercial vendors at the time) after spending literally millions of dollars for that reason alone: efforts to update the tool levied a heavy “tax” on team's productivity.
Thus, many people turn to commercial vendors when looking for solutions to PCI logging and monitoring challenges. On the logging side, commercial log management solutions can aggregate all data from the in-scope entities, whether applications, servers, or network gear. Such solutions enable satisfying the log data collection, monitoring, analysis, data protection, and data retention. (Why do we keep saying “retention” where some people would have used to term “storage?” It is important to note that “retention” usually implies making sure that data is stored.) Vendors also help with system configuration guidance to enable optimum logging (sometimes for a fee as “professional services”). Advantages of such an approach are obvious: on day 1, you get a supported solution as well as a degree of certainty that the vendor will maintain and improve the technology as well as have a roadmap for addressing other log-related organization needs beyond PCI compliance.
On the negative side of acquiring a PCI logging solution from a vendor sits a landmine of “unmet requirements.” It might happen that what was bought and deployed doesn't match what was imagined and needed. Many factors contribute to such a situation: starting from aggressive vendor sales tactics (“overselling”) to insufficient onsite testing and to not thinking about the needs before talking to vendors. Without a doubt, if you “don't know what you need,” it is unlikely that you'd buy “exactly what you need.”
Fortunately, there are simple things you can do to avoid the pitfall of unmet requirements when acquiring a log management solution.
■ Review PCI logging guidance such as this book (as well as the standard itself) to clarify the standard's requirements.
■ Consider how a log management solution would work in your environment.
■ Define the need by talking to all the stakeholders in your PCI project and have the above information in mind.
Look through various commercial log management such as LogLogic (www.loglogic.com), ArcSight (www.arcsight.com), Splunk (www.splunk.com), or others to “case the joint” and to see what is out there. Congratulations! You are ready to talk to vendors. Here are a few additional questions to ask the vendor:
■ Can your tool collect and aggregate 100 percent of all log data from all in-scope log sources on the network?
■ Are your logs transported and stored securely to satisfy the CIA of log data?
■ Are there packaged reports that suit the needs of your PCI projects stakeholders such as IT, assessors, maybe even Finance or Human Resources? Can you create the additional needed reports to organize collected log data quickly?
■ Can you set alerts on anything in the logs to satisfy the monitoring requirements?
■ Does the tool make it easy to look at log data on a daily basis? Can the tools help you prove that you are by maintaining an assessment trail of log review activities? (Indeed, it is common for the assessors to ask for a log that shows that you review other logs and not for the original logs from information systems! Yes, log analyst activities need to be logged as well – if this is news to you then welcome to the world of compliance!)
■ Can you perform fast, targeted searches for specific data when asked? Remember, PCI is not about dumping logs on tape.
■ Can you contextualize log data (say for comparing application, network, and database logs related to an in-scope system) when undertaking forensics and other operational tasks?
■ Can you readily prove, based on logs, that security (such as antivirus and intrusion prevention), change management (such as user account management), and access control policies mandated by the PCI requirements are in use and up-to-date?
■ Can you securely share log data with other applications and users that are involved in various compliance initiatives?

Log Management Tools

Let's take a more detailed look at the capabilities of a typical log management solution, a common choice for security monitoring for PCI DSS. The first thing to mention is that such solutions make logs useful for security, IT performance monitoring, system and network troubleshooting, investigations, assessment, and, obviously, compliance such as PCI DSS.
For example, real-time alerting is useful primarily as a threat detection measure. To provide such data protection measures, companies should implement a log management solution that enables administrators to set alerts on all applications, devices, and system logs. This enables them to provide evidence that the infrastructure has been configured properly and that misconfigured or vulnerable systems are not providing a backdoor for intruders or malicious insiders. Alerts can provide administrators with early warning of misuse and attacks, allowing them to isolate and fix the problem before damage occurs or data is lost, and of various data access policies and processes not being followed.

Note
Alerts are only useful if there is a process and personnel in place to intake, analyze, and respond to alerts on a timely basis. In other words, if nobody is wearing a pager or looking for e-mail alerts, they are next to useless.
Securing the CIA of log data is explicitly mentioned in the PCI requirements above; thus, it is crucial to any implementation of a log management tool. This not only serves to reduce the risk of this vital information leaking by means of logs (confidentiality) and prevents it from being altered or lost thereby reducing its relevance, immutability, and forensic quality (integrity) but also makes sure that log data is there when you need it (availability). It is hardly possible to say which is the most important and thus the CIA triad lives on.
A need to be able to use logs to address all those PCI requirements brings us to access management and change management. Although two different areas with little overlap, both access and change managements are critical to meeting PCI compliance requirements as well as other regulations and IT governance frameworks, such as ITIL, COBIT, or various ISO guidance documents. Strong access and change control measures ensure that only authorized users can access or take action on critical data. The PCI standard mandates that companies maintain a complete record of access (both failed and successful), activity, and configuration changes for applications, servers, and network devices. Logs are that record. Thus, such log data allows IT to set up alerts to unusual or suspicious network behavior and provide information to assessors with complete and accurate validation of security policy enforcement and segregation of duties.
Further, a log management solution allows administrators to monitor who has permission to access or make changes to devices and applications in the network. It also enables administrators to create a complete assessment trail across devices and protect network resources from unauthorized access or modifications. An effective log management tool supports centralized, automated storage of collected data for faster, more reliable data retrieval during an assessment or while investigating suspicious behavior.
You probably remember that PCI compliance necessitates ongoing monitoring of network activity (see Requirement 11 and others) to validate that processes and policies for security, change and access management, and user validation are in place and up-to-date.
Logging and monitoring allow for fast problem isolation and thorough analysis when something goes (reactive analysis) or is about to go wrong (proactive analysis). Ongoing and automated log monitoring gives administrators greater insight into the PCI environment at all times so that unusual user activity, unauthorized access, or even risky insider behavior can be identified – and stopped – immediately.
In light of the above, the components of an effective log management solution are as follows:
■ Collection and aggregation of 100 percent of all log data from in-scope enterprise data sources including firewalls, VPN concentrators, Web proxies, IDSs, e-mail servers, and all the other systems and applications mentioned and implied in the PCI standard
■ Creation of reports that organize the log data quickly and automatically so that administrators can deliver detailed network activity information and proof of compliance to assessors
■ Setting of alerts based on changes to individual devices, groups of devices, or the network, to minimize network downtime and loss of data due to malicious attacks, security breaches, insider misuse, or performance issues
■ Fast data retrieval from securely stored, unaltered raw log files; immutable logs are critical in litigation and attestation
■ Integration with existing network management and security solutions to reduce maintenance and administration and leverage existing architecture
■ The ability to contextualize log data (comparing application, network, and database logs) when undertaking forensics and other operational tasks

Other Monitoring Tools

It is critical to remember that the scope of security monitoring in PCI DSS is not limited to logs because system logs alone do not cover all the monitoring needs. Additional monitoring requirements are covered by the following technologies (as well as process requirements that accompany them):
■ Intrusion detection or intrusion prevention; mandated by PCI Requirement 11.4 “Use intrusion detection systems and/or intrusion-prevention systems to monitor all traffic in the cardholder data environment”
■ File integrity monitoring; mandated by PCI Requirement 11.5 “Deploy file-integrity monitoring software to alert personnel to unauthorized modification of critical system files, configuration files, or content files”
We will cover the critical issues related to these technologies in the section below.

Intrusion Detection and Prevention

NIDS and IPSs are becoming a standard information security safeguard. Together with firewalls and vulnerability scanners, intrusion detection is one of the pillars of modern computer security. When referring to IDSs and IPSs today, security professional typically refers to NIDS and network IPS. As we covered in Chapter 4, “Building and Maintaining a Secure Network,” the former sniffs the network, looking for traces of attacks, whereas the latter sits “inline” and passes (or blocks) network traffic.
NIDS monitors the entire subnet for network attacks against machines connected to it, using a database of attack signatures or a set of algorithms to detect anomalies in network traffic. See Fig. 9.1 for a typical NIDS deployment scenario.
B9781597494991000143/f09-01-9781597494991.jpg is missing
Figure 9.1
Network Intrusion Detection Deployment
On the other hand, network IPS sits at a network choke point and protects such a network of systems from inbound attacks. To simplify the difference, IDS alerts whereas IPS blocks. See Fig. 9.2 for a typical network IPS deployment.
B9781597494991000143/f09-02-9781597494991.jpg is missing
Figure 9.2
Network Intrusion Prevention Deployment
The core technology of picking “badness” from the network traffic with a subsequent alert (IDS) or blocking (IPS) is essentially similar. Even when intrusion prevention functionality is integrated with other functions to be deployed as so-called Unified Threat Management (UTM), the idea remains the same: network traffic passes through the device with malicious traffic stopped, suspicious traffic logged, and benign passed through.
Also important is the fact that most of today's IDS and IPS rely upon the knowledge of attacks and thus require ongoing updates of signatures, rules, attack traces to look for, and so forth. This is exactly why PCI DSS mandates that IDS and IPS are not only deployed but also frequently updated and managed in accordance with manufacturer's recommendations.
In the context of PCI, IDS and IPS technologies are mentioned in the context of monitoring. Even though IDS can only alert and log attacks while IPS adds blocking functionality, both can and must be used to notify the security personnel about malicious and suspicious activities on the cardholder data networks. Below we present a few useful tips for deploying IDS and IPS for PCI DSS compliance and card data security.
Despite the domination of commercial vendors, the free open-source IDS/IPS Snort, now developed and maintained by its corporate parent, Sourcefire, is likely the best IDS/IPS by the number of deployments worldwide. Given its price (free) and reliable rule updates from Sourcefire (www.sourcefire.com), it makes a logical first choice for smaller organizations; it shouldn't be taken off the shortlist even for larger organizations seeking to implement intrusion detection or prevention.
Although a detailed review of IDS and IPS technologies and practices goes well beyond the scope of this book, we would like to present a few key practices for making your PCI-driven deployment successful.
First, four key facts about IDS and IPS, which are also highlighted in the PCI standard:
1. IDS or IPS technology must be deployed as per PCI DSS. If another device includes IDS or IPS functionality (such as UTM mentioned above), it will likely qualify as well.
2. IDS and IPS need to “see” the network traffic in cardholder; for IDS, it needs to be able to sniff it and for IPS, to pass it through. An IDS box sitting in the closet is not PCI compliance (and definitely not security!).
3. IDS and IPS must be actively monitored by actual people, devoted (full-time, part-time, or outsources) to doing just that. PCI DSS states that systems must be set to “alert personnel to suspected compromises.”
4. IDS and IPS rely on updates from the vendor; such updates must be deployed, or the devices will lose most of its value. PCI does highlight it by stating to “Keep all intrusion-detection and prevention engines up-to-date.”
The above four facts define how IDS and IPS are used for the cardholder requirement. Despite the above knowledge, IDS technologies are not the easiest one to deploy, especially in light of the number 3 consideration above. PCI DSS-driven IDS deployments suffer from a few of the common mistakes covered below.
First, using an IDS or an IPS to protect the cardholder environment and to satisfy PCI DSS requirement is impossible without giving it an ability to see all the network traffic. In other words, deploying an NIDS without sufficient network environment planning is a big mistake that reduces, if not destroys, the value of such tools. Network IPS, for example, should be deployed on the network choke point such as right inside the firewall leading to cardholder network, on the appropriate internal network segment, or in the De-Militarized Zone (DMZ). For the shared Ethernet-based networks, IDS will see all the network traffic within the Ethernet collision domain or subnet and also destined to and from the subnet but no more. For the switched networks, there are several IDS deployment scenarios that use special switch capabilities such as port mirroring or spanning. When one or more IDS devices are deployed, it is your responsibility to confirm that they can “cover” the entire “in-scope” network.
Second, even if an IDS is deployed appropriately, but nobody is looking at the alerts it generates, the deployment will end in failure and will not lead to PCI compliance. It's well known that IDS is a “detection” technology, and it never promised to be a “shoot-and-forget” means of thwarting attacks. Although in some cases, the organization might get away with dropping the firewall in place and configuring the policy, such a deployment scenario never works for intrusion detection. If IDS alerts are reviewed only after a successful compromise, the system turns into an overpriced incident response helper tool, clearly not what the technology designers had in mind. Even with IPS, a lot of suspicious indicators are not reliable enough to be blocked automatically, thus monitoring is just as critical as with IDS.
PCI DSS Requirement 12.5.2 does state that an organization needs to “Monitor and analyze security alerts and information, and distribute to appropriate personnel.” Still, despite this, many organizations deploy IDS and develop a no response policy. As a result, their network IPS is deployed, it “sees” all the traffic, and there is somebody reviewing the alert stream. But what is the response for each potential alert? Panic, maybe? Does the person viewing the alerts know the best course of action needed for each event? What alerts are typically “false positives” – alerts being triggered on benign activity – and “false alarms” – alerts being triggered on attacks that cannot harm the target systems – in the protected environment? Unless these questions are answered, it is likely that no intelligent action is being taken based on IDS alerts – a big mistake by itself, even without PCI DSS.
The fourth and final mistake is simply not accepting the inherent limitations of network intrusion protection technology. Although anomaly-based IDSs might detect an unknown attack, most signature-based IDS will miss a new exploit if there is no rule written for it. IDS and IPS must frequently receive vendor signature updates, as mandates by the PCI DSS. Even if updates are applied on a schedule, exploits that are unknown to the IDS vendor will probably not be caught by the signature-based system. Attackers may also try to blind or evade the NIDS by using many tools available for download. There is a constant battle between the technology developers and those who want to escape detection. IPS/IDS are becoming more sophisticated and able to see through the old evasion methods, but new approaches are constantly being developed by attackers. Those deploying the NIDS technology should be aware of its limitations and practice “defense-in-depth” by deploying multiple and diverse security solutions.
Thus, IDS/IPS is a key monitoring technology for PCI DSS and data protection; however, when deploying it, many pitfalls need to be considered if it were to be useful for PCI compliance and security.

Integrity Monitoring

In the prehistoric days of security industry, before all the current compliance frenzy and way before PCI DSS, the idea of monitoring key system files for changes was invented. As early system administrators engaged in an unequal battle with hackers who compromised almost every server connected to the Internet, the idea of a quick and easy way for verifying that system files was not modified and thus not subverted by hackers seemed like a god-send.
Indeed, just run a quick “scan” of a filesystem, compute cryptographic checksums, save them in a safe place (a floppy comes to mind – we are talking 90s here, after all), and then have a “known good” record of the system files. In case of problems, run another checksum computation and compare the results; if differences are found, then something or someone has subverted the files.
That is exactly the idea of integrity checking and monitoring. The tools such as the pioneering tripwire (now developed by its corporate parent, Tripwire, Inc) have matured significantly and offer near real-time checks, an ability to revert to the previous version of the changed files, as well as a detailed analysis of observed changes across a wide range of platforms for servers, desktops, and even network devices.

Note
Question: What is the difference between host intrusion detection and integrity monitoring?
Answer: Many different types of applications are labeled as host-based intrusion detection. In general, the distinction is that with IDS, the end goal is the detection of malicious activity in a host environment, whereas an integrity monitoring system aims to provide visibility into all kinds of change. Detecting malicious change or activity is a big part of an integrity monitoring system but that is not the entire motivation behind its deployment.
As we mentioned, PCI DSS mandates the use of such tools via Requirement 11.5. Namely, “Deploy file-integrity monitoring software to alert personnel to unauthorized modification of critical system files, configuration files, or content files; and configure the software to perform critical file comparisons at least weekly.”
This means that the tools must be deployed on in-scope systems, key files need to be monitored, and comparisons are to be run at least weekly. Indeed, knowing that the server has been compromised by attackers a week after the incident is a lot better than what some recent credit-card losses indicate. For example, TJX card theft was discovered years after the actual intrusion took place, causing the company some massive embarrassment.
On the tools side, although Tripwire rules the commercial file integrity monitoring, its open-source clone is also of the best known free, open-source tools. Free tripwire is even included with some Linux and Unix operating systems.
Some of the challenges with such tools include creating a list of key files to checksum. Typically, relying on integrity checking tool vendor default (or even “PCI DSS-focused”) policy is a good idea. Here is an example list of such files for a typical Linux server:
■ Configuration files in /etc directory
■ All system executables (/bin,/usr/bin, /usr/sbin, and other possible binary directories)
■ Key payment application executable, configuration, and data files
■ Log files /var/log (these require a special append-only mode in your integrity monitoring)
Also, just as with IDS and IPS, a response policy in case of breach of integrity is essential.
Finally, let's review our suggestions on monitoring and logging policy for PCI DSS.

Tools
On a more detailed level, here are some sample PCI-related reports and alerts for log review and monitoring.
Alerts used for real-time monitoring of in-scope servers are as follows:
■ New account created
■ New privileges added to a user account
■ Firewall rules change
■ Multiple failed logins
■ Critical system restarted
■ Antivirus protection failed to load
■ Malware detected
■ Logs created or log subsystem started
■ Log collection failed from an in-scope system
Reports used for daily review of preanalyzed data are as follows:
■ Risky firewall traffic
■ All traffic other than that allowed by PCI
■ Software update activities
■ User account changes on servers (e.g., additions, deletions, and modifications)
■ Login activity on in-scope servers
■ User group membership changes
■ Password changes on in-scope servers and network devices
■ All administrator/root activities on in-scope servers
■ Log review activities on a log management solution
By now the reader should be convinced that it is impossible to comply with PCI requirements without log data management processes and technologies in place. Complete log data is needed to prove that security, change management, access control, and other required processes and policies are in use, up-to-date, and are being adhered to. In addition, when managed well, log data can protect companies when compliance-related legal issues arise (e.g., when processes and procedures are in question or when an e-discovery process is initiated as part of an ongoing investigation). Not only does log data enable compliance but also allows companies to prove that they are implementing and continuously monitoring the processes outlined by the requirements.

Common Mistakes and Pitfalls

Additionally, we will present a few common mistakes noted in PCI DSS-driven logging implementations.
■ Logging in the PCI DSS is not confined to Requirement 10. As we discussed above, all the requirements imply having a solid log management policy, program, and tools.
■ Logging in PCI is not only about log collection retention; Requirement 10.6 directly states that you need to review, not just accumulate logs.
■ Log review in PCI does not mean that you have to read the logs yourself; using automated log management tools is not only allowed but suggested.
■ A careful review of what is in-scope must be performed. Otherwise, one creates a potentially huge issue for the organization in terms of having what is thought of as a solid PCI program, but then suffering a data breach and getting fined due to missing a wireless POS system or some other commonly overlooked but clearly in-scope systems. (Well, at least it becomes clear after your organization is fined.)
■ Your logging tools purchased and deployed for PCI compliance are almost certainly useful for other things ranging from other compliance mandates (see the above example of PCI and Sarbanes–Oxley) as well as operational, security, investigative, incident response, and other uses.

Case Study

Next, we present two of the case studies that illustrate what is covered in this chapter.

The Case of the Risky Risk-Based Approach

This case study covers deployment of a log management solution to satisfy PCI requirements at a large retail chain in the Midwest. Bert's Bazaar, an off-price retailer servicing the Midwest and southern US states, decided to deploy a commercial log management solution when their PCI assessor strongly suggested that they need to look into it. Given that Bert has a unique combination of a large set of in-scope systems (some running esoteric operating systems and custom applications) and an extreme shortage of skilled IT personnel, they chose to buy a commercial solution without seriously considering an in-house development. So, they progressed from not doing anything with their logs directly to running an advanced log management system.
The project took a few months following a phased approach. Bert's IT staff decided to implement it from the outside based on their risk assessment. They started from their DMZ firewalls and then progressed with feeding the following logs into a log management system, while simultaneously defining alerts and running reports from vendor's PCI compliance package.
Their project proceeded as follows:
1. All Internet DMZ firewalls
2. Select internal firewalls that control access to payment processing systems
3. DMZ front-end processing servers – operating system only
4. Other payment processing servers – operating system only
5. Databases that are involved in payment processing
6. Actual payment processing applications from all involved servers
A few things need to be said about the above approach. One common piece of technology conspicuously missing from the list is network intrusion detection. The reason is that the organization chose not to implement it due to resource shortage (even though modern NIDS have improved, they still require people to provide care and feeding). The sequence is based on both their risk assessment and the complexity of log collection. The former led them to focus on the outside threat first, whereas the latter delayed some of the log collection efforts: it is much easier to forward Cisco PIX firewall logs to an analysis server, but a database logging configuration, collection, and analysis present a significant challenge (due to multiple factors from affecting performance to grabbing logs from a database itself in a secure and reliable manner).
Overall, the project is a successful implementation of PCI logging requirements by using a commercial logging solution. The organization did pass the PCI assessment with flying colors and was commended on their comprehensive approach to logging. In addition, the security team built a case that their PCI logging implementation actually addresses a few other compliance mandates (such as US Sarbanes–Oxley Act) because PCI DSS goes into higher-level details while covering essentially the same areas of IT governance. At the same time, a log management tool also bolstered its operational capabilities and overall IT efficiency.

The Case of Tweaking to Comply

This case study is based on a major e-commerce implementation of an off-the-shelf log management technology in combination with in-house developed tools to address a unique need alongside PCI compliance. Upon encountering PCI compliance requirements, Wade's Webbies developed its own set of scripts to go through a Web server and payment application's server logs to identify hacking and fraud attempts. Such scripts were very useful but proved to be onerous to operate, update, maintain, and troubleshoot. Additionally, a few key IT staffers who helped develop the solution departed to join a consulting company.
Thus, IT management decided to pick a commercial log management application, which will have to work together or integrate with their previous scripts (that still delivered unique value to the organization); they would use a vendor's collection and analysis log management infrastructure but retain an ability to look for fraud using their own methods.
Their log management project proceeded as follows:
1. Web server logs from DMZ Web servers
2. Operating system logs from the same Web servers
3. Custom payment processing application logs
4. Network logs from the DMZ (firewall, router)
The project approach was driven by the preexisting log analysis solution. Although the vendor solution was being deployed, they were adapting their scripts to run based on the log management vendor's API. Such API provided access to preanalyzed as well as raw log data and allowed the organization to retain a large part of the effort spent on developing the scripts. At the same time, such API capability allows the users of the tools to take advantage of the vendor's advanced log management technology as well as regular updates and customer support.
Overall, this project was a successful illustration of a combined approach of using a homegrown and commercial solution and thus achieving combined benefits.

Summary

In conclusion, the authors would like to stress a few points that were covered as well as leave readers with a few thoughts about how PCI logging fits into the bigger picture of IT governance and risk management. Despite the fact that this book is about PCI DSS, we do not recommend that you embark on a log management project or on a security monitoring project solely for PCI DSS. Taking control of your logs is useful for a huge number of IT and information security goals; thus doing logs “just for compliance” is akin to using an expensive and powerful tool as a hammer. Overall, a common scenario observed by the authors is “buy for compliance [such as PCI], use for all the needed purposes.” We recommend that the organizations that are subject to PCI DSS use the motivating power of PCI DSS to acquire the needed tools and then proceed to using them for solving all the problems in the whole IT security realm.
References
[1] Sourcefire Security Calendar, www.ranum.com/security/computer_security/calendar/; [accessed 13.07.09].
[2] Common Event Expression (CEE), http://cee.mitre.org; [accessed 13.07.09].
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset