Many log files are written on a Web Gateway and especially end user relevant data (like the access.log) is considered personal data. In many geographies (especially the European Union) it is required to apply special protection to this data. Many corporations also have their own guidelines to protect the data of their employees from unauthorized access.
McAfee Web Gateway (MWG) provides you with several options to protect these log files. The configuration is very flexible and allows you to make individual changes to different logs as well as to different appliances in your worldwide cluster.
Encryption: This option allows you to encrypt your log files and make sure that in case someone gains access to your MWG appliance, the logs are not readable. Encryption also prevents unauthorized administrators from reading the log files without permission.
Anonymization: This option allows you to replace "user identifiable" data in the log files with encrypted data. As an example, the username and client IP address (those two fields are the most common) could be replaced in your access log.
The "4-Eyes Principle" refers to a practice where data is protected with two different passwords. Those two passwords are given to two different people and only when those two come together can the data be decrypted (two people = 4 eyes). In many organizations this principle is applied to sensitive data where two different parts of the organization (separation of duties) are involved. For example for a log file protected by two passwords, one could be given to the IT admin and the other to an HR representative.
MWG allows you to apply all possible combinations to log files as well as anonymization of user data:
- No password set (default)
- One password set (simple protection to restrict unauthorized access)
- Two passwords (Full compliance with regulations and company policy on separation of duties)
Navigate to Policy >> Settings >> File System Logging and select the log file you wish to encrypt.
In the settings details you should first set the appropriate passwords (at least one is recommended!).
Afterwards you can enable encryption by simply setting the option for "Encrypt the log file".
Notice that you will not be able to import encrypted log files into McAfee Web Reporter or McAfee Content Security Reporter without decrypting them first.
Decrypt a log file:
To decrypt an encrypted log file you need to utilize the tool "LogFileDecrypter" on the command line of your MWG. The decryption tool by default displays the result of the decrypted log file directly to the command line. Therefore it is recommended to redirect the output into a new file.
To enable anonymization, you will need to modify the default log line being written to your log file. We will be using the access.log as the example in this document.
Navigate to Policy > Log handler > Default > Access Log and as a first step make a copy (Copy and Paste button above the "Write access.log" rule) of the existing access.log rule. Disable the copied rule for now.
Open the copied rule and rename it to "Write access.log (anonymized).
The next step is to replace the property "Authentication.Username" with the anonymized version. To do that, open the Event "Set User-Defined.logLine" and then double click on the line that shows "Authentication.Username"
In the new window, change the Parameter property to "FileSystemLogging.MakeAnonymous". Make sure to select the Settings from the drop down. In our example, the correct setting would be "Access Log Configuration" as we are anonymizing the access.log.
Also make sure that at least one password is set in this Settings container. For the "4-Eyes principle", you need to set two passwords.
Now click on the "Parameters" button for the MakeAnonymous property and select the property Authentication.Username.
Several "OK" clicks later you should be able to see the new part of your log line. The username is now being anonymized. You can apply the same steps as above to the Client.IP field as well. The result should look similar to the screenshot below.
The final step is to activate the new logging rule and disable the original one. Make sure that you ONLY have one of the two enabled at a time as they both write into the same log file.
Deanonymize a log file:
To deanonymize an log file you need to utilize the tool "LogFileDecrypter" on the command line of your MWG. The decryption tool by default displays the result of the deanonymized log file directly to the command line. Therefore it is recommended to redirect the output into a new file.