In this chapter, we will look at a number of security fundamentals; some of these will be expanded upon in later chapters. For the exam, you will need to know all of the information in this book as the exam is fairly tricky.
We will cover the following exam objectives in this chapter:
- Explaining the importance of physical security controls: Lighting—signs—fencing/gate/cage—security guards—alarms—safe—secure cabinets/enclosures—protected distribution/protected cabling—Air gap—Mantrap—Faraday cage—lock types—biometrics—barricades/bollards—tokens/cards—environmental controls—HVAC—hot and cold aisles—fire suppression—cable locks—screen filters—cameras—motion detection—logs—infrared detection—key management
- Given a scenario, implement identity and access management controls: Access control models—MAC—DAC—ABAC—role-based access control—rule-based access control—physical access control—proximity cards—smart cards
- Comparing and contrasting various types of controls: Deterrent—preventive—detective—corrective—compensating—technical—administrative—physical
- Explaining cryptography algorithms and their basic characteristics: Hashing algorithms—MD5—SHA—HMAC—RIPEMD
Most security books start with the basics of security by featuring the CIA triad—this is a model designed to guide policies for information security within an organization. It is a widely used security model and it stands for confidentiality, integrity, and availability, the three key principles that should be used to guarantee having a secure system:
We'll discuss these principles in more depth here:
- Confidentiality: Prevents the disclosure of data to unauthorized people so that only authorized people have access to data, this is known as the need to know basis. Only those who should know the contents should be given access. An example would be that your medical history is only available to your doctor and nobody else.
We also tend to encrypt data to keep it confidential. There are two types of encryption known as symmetric and asymmetric. Symmetric encryption uses one key known as the private key or shared key. Asymmetric encryption uses two keys known as private key and the public key.
- Integrity: This means that you know that data has not been altered or tampered with. We use a technique called hashing that takes the data and converts it into a numerical value. If you run the hash when you suspect changes have taken place, and if the numerical value has changed, then the data has been tampered with. Common hashing algorithms in the exam are Secure Hash Algorithm version 1 (SHA1) and Message Digest version 5 (MD5).
- Availability: Availability could be using Redundant Array of Independent Disks (RAID) disks or maybe fail-over clustering. Availability ensures that data is always available; an example would be if you wanted to purchase an airplane ticket and the system came back with an error and you could not purchase it, this could be frustrating.
There are a wide variety of different security controls that are used to mitigate the risk of being attacked; the three main security controls are technical, administrator, and physical. In this section, we are going to look at these in more detail; you need to be familiar with each of these controls and when each of them should be applied. Let's start by looking at the three main controls.
Administrative controls are mainly written by managers to create organizational policies to reduce the risk within companies. An example could be an internet use policy so that the employees realize that the internet can only be used for company business and not used for social media during the working day. Another administrative control would be completing a holiday request form; the form would be available from the internal forms library.
Some of the administrative measures are as follows:
- Annual Security Awareness Training: This is an annual event where you are reminded about what you should be doing on a daily basis to keep the company safe. An example would be when you are finished for the day that you clear your desk and lock all documents away; another would remind you that your identity badge should be worn at all times and you should challenge anyone not wearing a badge. Another example is that companies now need their employees to complete cyber security training as the risk is getting greater each day.
- Annual Risk Assessment: A company will have a risk register where the financial director will look at all of the risks associated with money and the IT manager will look at all of the risks posed by the IT infrastructure. As technology changes and the hackers get more sophisticated, the risks can become greater.
- Penetration Testing/Vulnerability Scanning: A vulnerability scan is not intrusive as it merely checks for vulnerabilities, whereas a penetration test is more intrusive and can exploit vulnerabilities. These will be explained further into this book.
- Change Management: This is a process that a company adopts so that changes don't cause any security risks to the company. A change to one department could impact another department. The Change Advisory Board (CAB) assists with the prioritization and priority of changes; they also look at the financial benefits of the change and they may accept or reject the changes proposed for the benefit of the company. Information technology (IT) evolves rapidly and our processes will need to change to cope with potential security risks associated with newer technology.
Technical controls are those implemented by the IT team to reduce the risk to the business. These could include the following:
- Firewall Rules: Firewalls prevent unauthorized access to the network by IP address, application, or protocol. These are covered in depth later in this book.
- Antivirus/Antimalware: This is the most common threat to the business and we must ensure that all servers and desktops are protected and up to date.
- Screen Savers: These log computers off when they are idle, preventing access.
- Screen Filters: These prevent people walking past from reading the data on your screen.
- Intrusion Prevention Systems (IPS)/Intrusion Detection Systems (IDS): The intrusion detection system monitors the network for any changes and the intrusion prevention system stops the attacks.
Physical controls are controls that you can touch, for example:
- Cable Locks: These are attached to laptops to secure them so that nobody can steal them.
- Laptop Safe: Laptops and tablets are expensive, but the data they hold could be priceless, therefore there are safes for the storage of laptops and tablets.
- Biometric Locks: Biometrics are unique to each person; examples would be using their fingerprint, retina, palm, voice, an iris scanner, or facial recognition.
- Fences/Gates: The first line of defense should be a perimeter fence as the openness of many sites renders them highly vulnerable to intruders. Access to the site can be controlled by using a gate either manned by a security guard or with a proximity reader. A timber fence does not provide as much protection as a high steel fence.
- Burglar Alarms: These are set when the premises is not occupied, so when someone tries to break into your premises, it will trigger the alarm and notify the monitoring company or local police.
- Fire Alarms/Smoke Detectors: In a company, there will be fire alarms or smoke detectors in every room so that when a fire breaks out, and the alarms go off, the people inside the premises are given the opportunity to escape.
- Lighting: Lighting is installed for two main reasons: the first reason is so that anyone trying to enter your site at night can be seen and the second reason is for safety.
- Security Guards: They check the identity cards of people entering the building to stop unauthorized access. This also helps deter people trying to enter a building illegally.
- Mantraps: These are turnstile devices that only allow one person in at a time. They maintain a safe and secure environment mainly for a data center. A data center hosts many servers for different companies.
- Perimeter Protection: Fences, gates, and lights could protect the perimeter of your company. We could place bollards in front of a building to stop a car driving through the entrance. These normally protect ATM cash machines from being hit by a vehicle.
- Internal Protection: We could have safes and secure enclosures; the first example would be a toughened glass container or a sturdy mesh, both with locks to reduce access. We could also have protected distribution for cabling; this looks like metal poles that would have network cables inside. Screen filters used on a desktop could prevent someone from reading the screen.
- Faraday Cage: This is a metal structure, like a metal mesh used to house chickens. The cage prevents wireless or cellular phones from working inside the company. This could be built into the structure of a room used as a secure area. They would also prevent emissions escaping from your company.
- Key Management: This is where departmental keys are signed out and signed back in daily to prevent someone taking the keys away and cutting copies of them.
- Proximity card: These are contactless devices where a smart card is put near the proximity card device to gain access to a door or building.
- Tokens: Tokens are small physical devices where you touch the proximity card to enter a restricted area of a building. Some tokens allow you to open and lock doors by pressing the middle of the token itself; others display a code for a number of seconds before it expires.
- Environmental Controls: Heating, Ventilation, and Air-Conditioning (HVAC), and fire suppression systems, are also security controls. In a data center or a server room, the temperature needs to be kept cool or the servers inside will overheat and fail. They use a technique called hot and cold aisles.
- Air Gap: This is where a device has been taken off your network to isolate it. For example, you may want to isolate a computer that can complete a BACS transfer from the other computers in the finance department.
- Motion Detection/Cameras: These could be deemed physical controls, but the exam is focused on these being deterrent controls, they could also be detective controls providing non-repudiation.
- Barricades: Barricades can be erected across roads to stop traffic entering your site, but will not stop someone getting out of a car and jumping over them. You will need to use them in conjunction with security guards to fully protect your site.
- Bollards: Bollards are becoming very common as they control access by cars and stop them ramming through a front door. They stop ram raiders from stealing a cash machine or crashing into a jeweler's shop. They can be made from steel or concrete and are placed about four feet apart. In some countries, they are installed to prevent car bombers driving their vehicle into a group of people, maybe inside a shopping mall.
Preventative Controls are in place to deter any attack; this could be having a security guard with a large dog walking around the perimeter of your company. This would make someone trying to break in think twice. Some of the preventive measures that are taken are as follows:
- Disable User Accounts: When someone leaves a company, the first thing that happens is that their account is disabled, as we don't want to lose information that they have access to, and then we change the password so that they cannot access it. We may disable an account while people are on secondment or maternity leave.
- Operating System Hardening: This makes a computer's operating system more secure. It often requires numerous actions such as configuring system and network components properly, turning off features and services that it does not use, and applying the latest software and antivirus updates. There will be no vulnerabilities.
Deterrent Controls could be CCTV and motions sensors. When someone is walking past a building and the motion sensors detect them, it turns lights on to deter them.
A building with a sign saying that it is being filmed with CCTV prevents someone from breaking into your premises, as they think they are being filmed, even though there may not be a camera inside—but they don't know that.
Detective controls are used to investigate an incident that has happened and needs to be investigated; these could include the following:
- CCTV records events as they happen and from that you can see who has entered a particular room or has climbed through a window at the rear of a building.
- Log Files are text files that record events and the times that they occurred; they can log trends and patterns over a period of time. For example, servers, desktops, and firewalls are all events. Once you know the time and date of an event, you can gather information from various log files. These can be stored in Write-Once Read-Many (WORM) drives so that they can be read but not tampered with.
Corrective Controls are the actions you take to recover from an incident. You may lose a hard drive that contained data; in that case, you would replace the data from a backup you had previously taken.
Fire-Suppression Systems are another form of corrective control. You may have had a fire in your data center that has destroyed many servers, therefore when you purchase a replacement, you may install an oxygen suppressant system. This method uses argon/nitrogen and sometimes a small element of CO2 to displace the oxygen in the server room. The basis of this method is to reduce the oxygen level to below 15% because it will suppress a fire.
Compensating Controls can be called Alternative Controls; this is a mechanism that is put in place to satisfy the requirements of a security measure that is deemed too difficult or impractical to implement at the present time. It is similar to when you go shopping and you have $100 in cash - once you have spent your cash, you will have to use a credit card as a compensating control.
An example of this is where a new person has just been employed by the company, and the normal way to log in is to use a smart card and PIN. This resembles a bank card with a chip where you insert it into your laptop or keyboard and then insert a PIN to log in. Maybe it takes 3-5 days to get a new smart card, so during the waiting period, they may log in using a username and password:
The three main parts of access controls are identifying an individual, authenticating them when they insert a password or PIN, and then authorization, where an individual has different forms of access to different data. For example, someone working in finance will need a higher level of security clearance and have to access different data than a person who dispatched an order in finished goods:
- Identification: This is similar to everyone who has their own bank account; the account is identified by the account details on the bank card. Identification in a security environment may involve having a user account, a smart card, or maybe a fingerprint reader—this is unique to that individual.
- Authentication: Once the individual inserts their method of identification, they next to be authenticated, for example, by inserting a password or a PIN.
- Authorization: This is the level of access you have to selective data. You are normally a member of certain groups, for example, a sales manager could access data from the sales group and then access data from the managers group. You will only be given the minimum amount of access required to perform your job; this is known as least privilege.
Discretionary access control involves New Technology File System (NTFS) file permissions, which are used in Microsoft operating systems. The user is only given the access that he/she needs to perform their job.
The permissions are as follows:
- Full Control: Full access
- Modify: Change data, read, and read and execute
- Read and Execute: Read the file and run a program if one is inside it
- List Folder Contents: Expand a folder to see the subfolders inside it
- Read: Read the contents
- Write: Allows you to write to the file
- Special Permissions: Allows granular access; for example, it breaks each of the previous permissions down to a more granular level
- Data Creator/Owner: The person that creates the unclassified data is called the owner and they are responsible for checking who has access to that data:
Least Privilege is where you give someone only the most limited access required so that they can perform their job role; this is known as "need to know" basis. The company will write a least privilege policy so that the administrators know how to manage it.
Mandatory Access Control (MAC) is based on the classification level of the data. MAC looks at how much damage they could cause to the interest of the nation. These are as follows:
- Top Secret: Highest level, exceptionally grave damage
- Secret: Causes serious damage
- Confidential: Causes damage
- Restricted: Undesirable effects
Examples of Mandatory Access Control (MAC) are as follows:
|Nuclear energy project||Top Secret|
|Research and development||Secret|
|Ongoing legal issues||Confidential|
These are the roles:
- Custodian: The custodian is the person who stores and manages classified data.
- Security Administrator: The security administrator is the person who gives access to classified data once clearance has been approved.
- Owner: This is the person who writes and data and they are the only people that can determine the classification. For example if they are writing a secret document they will pitch it at that level, no higher.
File Permissions: Linux permissions come in a numerical format; the first number represents the owner, the second number represents the group, and the third number represents all other users:
- Owner: First number
- Group: Second number
- All other users: Third number
- Numerical values:
- 4: Read (r)
- 2: Write (w)
- 1: Execute (x)
Unlike a Windows permission that will execute an application, the execute function in Linux allows you to view or search.
A permission of 6 would be read and write. A value of 2 would be write, and a value of 7 would be read, write, and execute. Some examples are as follows:
- Example 1: If I have 764 access to File A, this could be broken down as:
- Owner: Read, write, and execute
- Group: Read, write
- All other users: Read
- Example 2: Determine which of the following permissions to File B is the highest and which is the lowest:
- 776 File B, also shown as rwx rwx -rw
- 677 File B
- 777 File B
The highest would therefore be the third example
Another way it is shown in the exam is by using three sets of three dashes, for example:
- Owner full control would be shown as rwx --- ---
- Group full control --- rwx ---
- User full control --- --- rwx
You can also change permissions in Linux: If permissions to File C is 654 and we wish to change these permissions, we will run the chmod 777 File C command, which changes the permissions to File C.
This is a subset of duties within a department. An example would be two people with the finance department who only handle the petty cash. In IT terms, it could be that only two of the IT team administer the email server.
In Rule-Based Access Control (RBAC), a rule is applied to all of the people within a department, for example, contractors will only have access between 8 a.m. and 5 p.m., and the help desk people will only be able to access Building 1, where their place of work is. It can be time-based or have some sort of restriction, but it applies to the whole department.
In Attribute-Based Access Control (ABAC), access is restricted based on an attribute in the account. John could be an executive and some data could be restricted to only those with the executive attribute. This is a user attribute from the directory services such as a department or a location. You may wish to give different level of control to different departments.
To control access to data, people may be put into groups to simplify access. An example would be if there were two people who worked in Information Technology (IT) who needed access to older IT data. These people are called Bill and Ben:
Everyone in the sales team may have full control of the sales data by using group-based access, but you may need two new starters to have only read access. In this case, you would create a group called new starters and give those people inside that group only read permission to the data.
- Hashing: It is where the data inside a document is hashed using an algorithm such as Secure Hash Algorithm version 1 (SHA1) and Message Digest version 5 (MD5). This turns the data inside the file into a long text string known as a hash value; this is also known as a message digest.
- Hashing the Same Data: If you copy a file and therefore have two files containing the same data, and if you hash them with the same hashing algorithm, it will always produce the same hash value. Even if from two different vendors.
- Verifying Integrity: During forensic analysis, the scientist takes a copy of the data prior to investigation. To ensure that he/she has not tampered with it during investigation, he/she will hash the data before starting and then compare the hash to the data when he/she has finished. If the hash matches, then we know that the integrity of the data is intact.
- One-way function: For the purpose of the exam, hashing is a one-way function and cannot be reversed.
- HMAC authentication: In cryptography, an HMAC (sometimes known as either keyed-hash message authentication code or hash-based message authentication code) is a specific type of Message Authentication Code (MAC) involving a cryptographic hash function and a secret cryptographic key. We can have HMAC-MD5 or HMAC-SHA1; the exam provides both data integrity and data authentication.
- Digital signature: This is used to verify the integrity of an email so that you know it has not been tampered with in transit. The private certificate used to sign the email that creates a one-way hash function and when it arrives at its destination the recipient has already been given a public key to verify that it has not been tampered with in transit. This will be covered in more depth later in this book.
- RACE Integrity Primitives Evaluation Message Digest (RIPEMD): This is a 128-bit hashing function. RIPEMD (https://en.wikipedia.org/wiki/RIPEMD) has been replaced by RIPEMD-160, RIPEMD-256, and RIPEMD-320. For the purpose of the exam, you need to know that it can be used to hash data.
The reason that we hash a file is to verify its integrity so that we know if someone has tampered with it.
In this exercise, we have a file called data.txt. First of all, I use a free MD5 hashing tool and browse to the data.txt file, which generates a hash value. I have also created a folder called Move data to here:
- Get the original hash:
- Copy the hash from the current hash value to the original hash value.
- Copy the data.txt file to the Move data to here folder, then go to the MD5 hash software and browse to the data.txt file in the new location, and press verify. The values should be the same as shown here:
The values are the same, therefore we know the integrity of the data is intact and it has not been tampered with when moving the readme.txt file.
- Next, we go into the data.txt file and change a single character, add an extra dot at the end of a sentence, or even enter a space that cannot be seen. We then take another hash of the data and we will then see that the hash value is different and does not match; this means that the data has been tampered with:
Defense in Depth is the concept of protecting a company's data with a series of defensive layers so that if one layer fails, another layer will already be in place to thwart an attack. We start with our data, then we encrypt it to protect it:
- The data is stored on a server
- The data has file permissions
- The data is encrypted
- The data is in a secure area of the building
- There is a security guard at the building entrance checking identification
- There is CCTV on the perimeter
- There is a high fence on the perimeter
Therefore, before someone can steal the data, they have seven layers of security that they must pass through. The concept of defense in depth is that if one layer fails, then the next layer protects:
- What are the three components of the CIA triad?
- Why might a CCTV camera be sited outside a building without any film inside?
- What does confidentiality mean?
- How can we protect a data center from people entering it?
- What is the purpose of an air gap?
- Name three administrative controls.
- Name three physical controls.
- Following an incident, what type of control will be used when researching how the incident happened?
- How do I know if the integrity of my data is intact?
- What is a corrective control?
- What is the purpose of hashing?
- If I hash the same data with different SHA1 applications, what will the output be?
- What two things does HMAC provide?
- What type of control is it when I change the firewall rules?
- What is used to log in to a system that works in conjunction with a PIN?
- What is the name of the person who looks after classified data and who is the person that gives people access to the classified data?
- When you use a DAC model for access, who determines who gains access to the data?
- What is least privilege?
- What access control method does SELinux utilize?
- What is the Linux permission of 777? What access does it give you?
- What does the Linux permission execute allow me to do?
- The sales team are allowed to log in to the company between 9 a.m. and 10 p.m. What type of access control is being used?
- Two people from the finance team are only allowed to authorize the payment of checks; what type of access control are they using?
- What is the purpose of the defense in depth model?
- When someone leaves the company what is the first thing we should do with their user account?
- Confidentiality means only allowing those authorized to access data. Integrity means that data has not been tampered with. Availability means that data is available when you need it, for example when purchasing an airline ticket.
- We could place a CCTV camera in a prominent location as a deterrent; people walking past cannot tell if it has film or not, so we are using it as a deterrent.
- Confidentiality means that we are limiting access to data to only those who should have access.
- To stop people entering a data center, we would install a mantrap, a turnstile device, so that we can control who accesses the data center, one at a time.
- An air gap is what it says on the tin, it is a gap between your network and a machine you would use an air gap maybe between Research and Development Machine and the corporate network. You basically isolated a system.
- Administrative controls could be writing a new policy to make the company run smoothly; we may have just implemented change management. You could implement a new form to ensure that all of the data required for an application is supplied. We could run an annual security awareness training day, complete a risk assessment, or perform penetration testing.
- Physical control is huge. Remember that these can be physically touched. You can choose three from: cable locks, laptop safe, biometric locks, fences, gates, burglar alarms, fire alarms, lights, security guards, bollards, barricades, a Faraday cage, key management, proximity cards, tokens, HVAC, an air gap, motion sensors, and cameras and biometric devices such as an iris scanner.
- If we investigate an incident, we need to collect all of the facts about the incident; this is a detective control. Think of a detective such as Sherlock Holmes who is always investigating mysteries.
- If we hash the data before and after, and the hash value remains the same, then the integrity of the data is intact. If the second hash is different, the data has been tampered with.
- A corrective control is a one-way function where an incident has happened and we want to redeem the situation. For example, if the hard drive on my laptop fails, then I will purchase a new hard drive, put it into my laptop, install the operating system and application, then obtain a copy of my data from a backup.
- Hashing is a technique that lets you know if data has been tampered with, but it does not hide the data.
- If the same data is hashed with two different applications that can hash data with SHA1, then the hash value will be the same.
- HMAC provides data integrity and data authentication. You can use HMAC-SHA1 or HMAC-MD5.
- If I change firewall rules, I am doing this to reduce risk; it is carried out by administrators, therefore it is a technical control.
- A smart card is a credit card-type device that has a chip built in; once inserted into the keyboard or USB card reader, you will then be asked to enter a PIN.
- The person who stores and manages classified data is called the custodian. The person who gives access to the classified data is the security administrator. Prior to getting access to the data, the person may well be vetted.
- In the DAC model, the data is unclassified and the data creator, who is also called the owner, will decide who gains access to the data and its classification.
- Least privilege is a technique that says that people should only get the most limited access to data that they need to perform their job.
- SELinux uses the MAC model to access data. This is the secure version of Linux.
- In Linux 777, give the owner who is the first digit, the group that is the sent digit and all users who are the third group read, write, and execute. It could also be a rwx.
- The Linux permission for execute (x) allows you to search for or view data.
- An access control method that applies either a time restriction or location restriction is called rule-based access.
- A subset of a department with access to a subset of duties is called role-based access.
- The defense in depth model has many different layers; the idea behind this is if one layer is broken through, the next layer will provide protection.
- When someone leaves the company, we should disable their account so that the keys associated with it are still available. The next stage is to change the password so nobody can access it, especially the person who has just left.