Icarus: a cloud security perspective
Abstract
Increasingly, cloud computing is used because of its significant advantages. However, this use can increase risk, as the solutions are not in the organizations’ infrastructure but in an external perimeter. This thesis presents a study of cloud security in which an agnostic reference architecture is developed for any cloud service provider. The three most used providers are also compared in order to materialize the architecture and make a proof of concept. The solution presented was based on the controls in Annex A of ISO 27001 (information security) and aimed to minimize the increased risk of applications hosted in the cloud as much as possible and speed up the process of any need to obtain ISO 27001 certification.
Full text
Universidade do Minho Escola de Engenharia João Aloísio Sousa Araújo Icarus - A Cloud Security Perspective January, 2022
Universidade do Minho Escola de Engenharia João Aloísio Sousa Araújo Icarus - A Cloud Security Perspective Master’s Dissertation Integrated Master’s in Informatics Engineering Work supervised by José Carlos Bacelar Ferreira Junqueira de Almeida January, 2022
COPYRIGHT AND TERMS OF USE OF THIS WORK BY A THIRD PARTY This is academic work that can be used by third parties as long as internationally accepted rules and good practices regarding copyright and related rights are respected. Accordingly, this work may be used under the license provided below. If the user needs permission to make use of the work under conditions not provided for in the indicated licensing, they should contact the author through the RepositóriUM of Universidade do Minho. License granted to the users of this work Creative Commons Atribuição-NãoComercial-CompartilhaIgual 4.0 Internacional CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/deed.pt
STATEMENT OF INTEGRITY I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledged the Code of Ethical Conduct of the Universidade do Minho.
Lorem ipsum.
Acknowledgements I want to thank Celfocus for this opportunity and all the colleagues who helped me during the internship. Special acknowledgment to Professor José Almeida for his support and availability in supervising this study. And finally, thank my family and girlfriend for all their support. iv
Abstract Increasingly, cloud computing is used because of its significant advantages. However, this use can increase risk, as the solutions are not in the organizations’ infrastructure but in an external perimeter. This thesis presents a study of cloud security in which an agnostic reference architecture is developed for any cloud service provider. The three most used providers are also compared in order to materialize the architecture and make a proof of concept. The solution presented was based on the controls in Annex A of ISO 27001 (information security) and aimed to minimize the increased risk of applications hosted in the cloud as much as possible and speed up the process of any need to obtain ISO 27001 certification. Keywords: Cloud, Security, Architecture, Controls, ISO … v
Resumo Cada vez mais, a computação em nuvem é utilizada devido às suas grandes vantagens. No entanto, esta utilização pode vir com um risco acrescido, pois as soluções não estão nas infraestruturas das organizações mas, sim num perímetro externo. Esta tese apresenta um estudo de segurança na nuvem em que é desenvolvida uma arquitectura de referencia agnóstica a qualquer prestador de computação em nuvem. São comparados também os três prestadores mais utilizados a fim de materializar a arquitectura e fazer uma prova de conceito. A solução apresentada foi baseada nos controlos do anexo A do ISO 27001 (segurança da informação) e tem como objetivo minimizar ao máximo o risco acrescido das aplicações hospedadas na nuvem e acelerar o processo de eventual necessidade de obter a certificação do ISO 27001. Palavras-chave: Nuvem, Segurança, Arquitectura, Controlos, ISO … vi
Contents 1 INTRODUCTION 1 1.1 Context ....................................... 1 1.2 Motivation ..................................... 2 1.3 Contributions .................................... 2 2 STATE OF THE ART 3 2.1 CyberSecurity OverView ............................... 3 2.1.1 What is CyberSecurity ........................... 3 2.1.2 The importance of Cyber Security ...................... 4 2.1.3 Security by Design ............................. 5 2.1.4 Zero trust and Least privilege access .................... 5 2.1.5 Defense in Depth .............................. 5 2.2 Application Security ................................. 6 2.2.1 The OWASP Testing Project ......................... 6 2.2.2 Testing Techniques ............................. 6 2.2.3 OWASP Top 10 ............................... 9 2.3 Container Security ................................. 10 2.3.1 Virtualization ................................ 10 2.3.2 Major risk of containers technologies .................... 11 2.4 DevSecOps ..................................... 12 2.5 Cloud Shared Responsibility Model ......................... 12 2.6 ISO ......................................... 14 2.6.1 ISO 27001-Information Security Management ................ 14 3 REFERENCE ARCHITECTURE 19 3.1 On-Premise Reference Architecture ......................... 19 3.1.1 Controls applied .............................. 20 3.2 Cloud Service Provider agnostic architectures .................... 21 3.2.1 Single VPC architecture ........................... 21 3.2.2 Multi VPC architecture ........................... 24 vii
CHAPTER 2. STATE OF THE ART 2.2 Application Security As described above, application security has some goals, but this section will be discussing how to test the Security of an Application. 2.2.1 The OWASP Testing Project The Open Web Application Security Project 2 (OWASP) is a nonprofit foundation that works to improve the security of software and produces freely-available articles, methodologies, documentation, tools, and technologies. The OWASP Testing Project has been in development for many years. The aim of the project is to help people understand the what, why, when, where, and how of testing web applications. The project has delivered a complete testing framework, not merely a simple checklist or prescription of issues that should be addressed. Readers can use this framework as a template to build their own testing programs or to qualify other people’s processes. (OWASP, WSTG-stable-INFO-02) What is testing ? ”Testing is a process of comparing the state of a system or application against a set of criteria”. The problem is when people test against a set of mental criteria that are neither well defien nor complete and that result in numerous flaws Why Perform Testing ? Allows organizations to compare themselves against industry peers, to understand the magnitude of resources required to test and maintain software and understanding the gap between existing practices and industry best practices. When to Test ? Improve the Software Development Life Cycle (SDLC) by including security in each of its phases. What to Test ? Test people, to ensure that there is adequate education and awareness. Process to ensure that there are adequate policies and standards and that people know how to follow these policies. Technology to ensure that the process has been effective in its implementation. 2.2.2 Testing Techniques 2.2.2.1 Manual Inspections and Reviews Manual inspection are human evaluations that generally test the security consequences of people, policies, and processes. Inspection of technology decisions such as architectural designs can also include manual inspections. They are usually carried out by analyzing documentation or conducting interviews with the designers or system owners. This can appear to be a simple concept but by asking someone how something works and why it was implemented in a specific way, the tester can quickly determine if any security concerns are likely to be evident. 2https://owasp.org/ 6
CHAPTER 2. STATE OF THE ART 2.2.2.2 Threat Modeling Threat modeling has become a popular technique to help system designers think about the security threats that their systems and applications might face. Therefore, threat modeling can be seen as a risk assessment for applications. It enables the designer to develop mitigation strategies for potential vulnerabilities and helps them focus their inevitably limited resources and attention on the parts of the system that most require it. It enables to find at an early stage possible vulnerabilities and threats and implement strategies to mitigate them. There are five steps to create a threat model: • Decomposing the application • Defining and classifying the assets • Exploring potential vulnerabilities • Exploring potential threat • Creating mitigation strategies Figure 2.2: Threat Model example 2.2.2.3 Code Review Source code review is the process of manually checking the source code of a web application for security issues. Many serious security vulnerabilities cannot be detected with any other form of analysis or testing. All the information for identifying security problems is there in the code, somewhere! Although there is nothing to replace this process of manual code review, there are some tools that can assist us. •Static application security testing (SAST) - Is a testing methodology that analyzes the source code to find security vulnerabilities. SAST scans an application before the code is compiled, gives feedback in realtime. 7
CHAPTER 2. STATE OF THE ART •Dynamic Application Security Testing (DAST) - Involves examining the app during runtime. Usually doesn’t provide the information that static analysis provides, but it is a good way to detect interesting elements from a user’s point of view. Find security vulnerabilities or weak spots in a program while it is running. It is clear that a SAST and a DAST have different goals, so they should complement each other and never choose between one or the other. 2.2.2.4 Penetration Testing Penetration test or commonly known as ethical hacking is essentially the “art” of testing a system or application remotely to find security vulnerabilities. Typically, the penetration test team is able to access an application as if they were users. The tester acts like an attacker and attempts to find and exploit these vulnerabilities. There are three types of testing, Black Box Testing where the tester impersonates the attacker and doesn’t have any knowledge about the system. White Box Testing where the tester has full knowledge of the system like design, specification, documentation, and so on. Gray Box Testing where the tester has partial knowledge of the system. 8
CHAPTER 2. STATE OF THE ART 2.2.3 OWASP Top 10 The OWASP Top 10 is a standard awareness document for developers and web application security. It represents a broad consensus about the most critical security risks to web applications. Using the OWASP Top 10 is perhaps the most effective first step towards changing the software development culture within your organization into one that produces more secure code (OWASP, 2017). Figure 2.3: OWASP Top 10 2017 9
CHAPTER 2. STATE OF THE ART 2.3 Container Security 2.3.1 Virtualization ”Virtualization has been in use for many years, but it is best known for enabling cloud computing. In cloud environments, hardware virtualization is used to run many instances of operating systems (OSs) on a single physical server while keeping each instance separate. This allows more efficient use of hardware and supports multi-tenancy- Souppaya et al., 2017 In figure 2.4 we can see the timeline of virtualization. In traditional architectures (pre-virtualization), the operating system is directly installed on hardware devices, the operating system can only allocate the physical CPU and memory resources. A hypervisor, also known as a virtual machine monitor or VMM, is software that creates and runs virtual machines (VMs). A hypervisor allows one host computer to support multiple guest VMs by virtually sharing its resources, such as memory and processing. Hypervisors support the creation and management of virtual machines (VMs) by abstracting a computer’s software from its hardware. Hypervisors make virtualization possible by translating requests between the physical and virtual resources. ”A container is a virtual runtime environment that runs on top of a single operating system (OS) kernel and emulates an operating system rather than the underlying hardware. A container engine is a managed environment for deploying containerized applications. The container engine allocates cores and memory to containers, enforces spatial isolation and security, and provides scalability by enabling the addition of containers.- Firesmith, 2017 Unlike non-virtualization or hypervisor virtualization, the container virtualization isolates each application from each other, and with it goes their dependencies. It is possible to combine hypervisor virtualization with container virtualization, where each VM has their own OS and each OS has the container engine, this process results in a hybrid architecture virtualization. Figure 2.4: Virtualization 10
CHAPTER 2. STATE OF THE ART 2.3.2 Major risk of containers technologies Based on a typical container architecture represented in figure 2.5 we can detect what and where are the major risk of this technology, these risks are represented in figure 2.6. Figure 2.5: Container Architecture Figure 2.6: Major risk of containers technologies 11
CHAPTER 2. STATE OF THE ART 2.4 DevSecOps Security is just as critical to business success as the overall quality, performance, and usability of an application. As development cycles are shortened and delivery frequencies are increased, it becomes essential to ensure that quality and safety are built in from the very start. DevSecOps is all about adding security to DevOps processes. In figure 2.7 we can see that everything previously discuss should be implemented at a Software Development life cycle in order to develop more secure software and don’t compromise either the Organization or their clients. Figure 2.7: Example of DevSecOps 2.5 Cloud Shared Responsibility Model The Shared Responsibility Model defines the distribution of responsibilities for security in the cloud between the cloud provider and the customer. The responsibility is different according to the service provided. In the cloud, we can have three kinds of services, Infrastructure as a Service (IaaS), Platform as a Service (Paas), and Software as a Service (SaaS). IaaS is fully self-service for accessing and monitoring computers, networking, storage, and other services. IaaS allows businesses to purchase resources on-demand and as-needed instead of having to buy the hardware outright, as the name says, the users have full control of their infrastructure. 12
CHAPTER 2. STATE OF THE ART PaaS provides cloud components to certain software while being used mainly for applications. PaaS delivers a framework for developers that they can build upon and use to create customized applications. All servers, storage, and networking are managed by the cloud provider or a third-party provider while the developers maintain and manage their applications. Software as a Service, also known as cloud application services, represents the most commonly utilized option for businesses. All the responsibilities are from the cloud service provider. In figure 2.8 we can see the Shared Responsibility Model where are defined the users and cloud provider responsibilities of each service. Figure 2.8: Shared Responsibility Model source by : https://blogs.vmware.com/cloud/2021/06/10/improve-cloud-security-posture-management/ 13
CHAPTER 2. STATE OF THE ART 2.6 ISO ISO is an independent, non-governmental organization, that promote worldwide proprietary, industrial, and commercial standards. These standards aid in the creation of products and services that are safe, reliable, and of good quality and, help businesses increase productivity while minimizing errors and waste. They also serve to safeguard consumers and the end-users of products and services, ensuring that certified products conform to the minimum standards set internationally. 2.6.1 ISO 27001-Information Security Management ISO 27001 Provides requirements for an information security management system (ISMS), organizations that accomplish ISO 27001 demonstrate to regulatory authorities that they take the security of information very seriously and, having identified the risks, done as much as is reasonably possible to address them. ISO 27001 has a document with a list of controls and their objectives named ”Annex a”, which is composed of 14 controls, where which control have their own sub controls in a total of 114 (ISMS, 2020). These controls are: • A.5 – Information Security Policies • A.6 – Organisation of Information Security • A.7 – Human Resource Security • A.8 – Asset Management • A.9 – Access Control • A.10 – Cryptography • A.11 – Physical & Environmental Security • A.12 – Operations Security • A.13 – Communications Security • A.14 – System Acquisition, Development & Maintenance • A.15 – Supplier Relationships • A.16 – Information Security Incident Management • A.17 – Information Security Aspects of Business Continuity Management • A.18 – Compliance 14
CHAPTER 2. STATE OF THE ART In order to understand what a system needs to fulfill to achieve ISO 27001 certificate, all 114 controls were analyzed and are described in figure 2.9. Once the goal is to shift these controls to the cloud, all controls related to physical security were ignored because that responsibility will be to the cloud service providers. Figure 2.9: Annex A controls Based on the study of the controls it was decided to divide the pyramid of 2.9 into 8 layers, Architecture , Technological layer , Compliance , Information Management , Operation Security , Acess Control,Management of Security Events, and Security Test. 15
CHAPTER 3. REFERENCE ARCHITECTURE subnet, and DataBase Subnet.[(Cloudflare, 2021b),(AWS, 2021b)] Network Controls : With the subnets deployed now, it’s time to control the East-West traffic, for that will be used Network Security Groups (NSG) as the replacement of the between zones firewalls that are placed On-Premise architecture. A Network Security Group or Security Group acts like a firewall where allows it to filter network traffic to and from resources and virtual networks. It is possible to define rules to deny or allow specific traffic and set an Access Control List that has that purpose. For each rule, it is possible to specify source and destination, port, and protocol. The NSG will assure that the subnets only allow traffic from the desired subnet, this is, the Presentation subnet only accepts traffic from DMZ and Application subnet, the Application subnet only allows traffic from the Presentation and the DataBase subnets, and the Database subnet only allows traffic from the Application subnet. [(Azure, 2021),(Annamalai, 2014),(AWS, 2021a)] Instead of a traditional network firewall, a valid optional is a Next-Generation Firewall (NGFW). A traditional firewall provides stateful inspection of network traffic. It allows or blocks traffic on OSI layer 3 and filters traffic based on administrator-defined rules. A next-generation firewall does this, and so much more, like packet filtering, Stateful inspection, and VPN awareness. In addition to access control, NGFWs can block modern threats such as advanced malware and application-layer attacks, it can be viewed as an IDS/IPS add-on and not a replacement.(Cloudflare, 2021a) There is no generic cloud tool or service for IDS/IPS, WAF, proxy, and reverse proxy, so these controls will be reliant on the CSP. However, these controls will be represented in the agnostic architecture. The communication protocol must still be HTTPS. For this architecture, it was added a VPN connection to the internal application with the purpose of internal use for employees. To obtain the many advantages of the cloud, like scalability and availability, a Network Load Balancer (NLB ) will be placed, before the DMZ. A Network Load Balance automatically distributes the incoming traffic originating from the internet across multiple targets. This increases the availability of the application because it can handle millions of requests per second. The NLB distributes traffic across the registered targets in its subnet only. In short, the Network Load Balancer distributes network load efficiently across multiple servers, ensures high availability and reliability by sending requests only to servers that are online and, provides the flexibility to add or subtract servers as demand dictates.(Google, 2021b) Behind each subnet will be an Application Load Balancer. This has the same goal as the Network load balance but for distributing the traffic for each server by demand. With ALB it is possible to automatically scale the resources by demand. Policy on the use of Cryptographic Controls Like some elements of the DMZ, the cryptographic controls depends on the CSP, although most CSP has default data encryption at rest and in movement, there isn’t an agnostic tool or service. So to clarify all data flows must be encrypted and use strong cryptographic protocols and technics. In the same way that 22
CHAPTER 3. REFERENCE ARCHITECTURE these controls aren’t represented in the On-Premise architecture, they won’t be in the agnostic architecture as well. The agnostic architecture is defined in figure 3.2, there is possible to see the controls represented and the first shift of On-Premise architecture to the cloud. Figure 3.2: Single VPC Reference Architecture 23
CHAPTER 3. REFERENCE ARCHITECTURE 3.2.2 Multi VPC architecture Until now it was presented two architectures, besides the controls implemented and requisites both architectures have a unique environment. Now all the changes will be on the cloud architecture, where is easier to expand the infrastructure, and for that, it was added a new requisite, the infrastructure must be able to support multiple environments , for example, Development environment, Pre-Production environment, and Production environment. In addition to being an ISO 27001 control, 2.9, it is a regular practice of Organizations, so the cloud architecture must ensure that the organization can deploy, securely, their environments. To accomplish this requisite, the Single-VPC agonist architecture will improve to a Multi-VPC architecture, where each environment will be deployed in each own VPC. This strategy increases the segregation and consequently the security of each environment, especially the Development environment where is more propitious to have vulnerabilities and misconfigurations. ”Using a Multi-VPC architecture allows you to isolate different parts of your infrastructure.- (Wittig, 2016) Besides, the agnostic architecture, in figure 3.2, lacks some resources efficiency on the DMZ subnet. That means that any application has its own DMZ subnet, if we scale the numbers of applications it means that the numbers of DMZ subnets will grow as well. So the infrastructure will have repeated resources for the same function. Once the DMZ is the first line of defense the rules, filter, protection, and all other controls of the DMZ are the same for all applications in the infrastructure. So instead of having the DMZ multiple times replicated, it is possible to remove it from a subnet and places it on a VPC that will be shared by all environments and distribute the traffic to the respective application. As mentioned before, each environment will be deployed in each own VPC, for simplification, it will be deployed three environments, the Development, the Production, and an Internal one for the employee’s application. That means three VPC, and an extra one for the DMZ what makes a total of four. With this improvement comes a challenge, which is, how will the VPC communicate. It has to be considered three factors, scalability, performance, and configuration. There are mainly two types of connections, the VPC-to-VPC peering, and a Transit Gateway.(AWS, 2020) Represented in figure 3.3 is a VPC-to-VPC peering design, this approach is a direct forward connection between two VPCs. Is a simple way to connect two VPCs, enables full bidirectional connectivity between the VPCs. Although is not the most efficient in terms of scalability, for example, if there is VPC peering between VPC A and VPC B and VPC A to VPC C, traffic from B to C cannot travel through A to C, there must be a direct connection from B to C. This means with a growth infrastructure, resources, and instances, there will be more VPC peering connections, therefore, harder to configure and maintain those connections, besides, usually there is a limitation of VPC peering connections per VPC. 24
CHAPTER 3. REFERENCE ARCHITECTURE Figure 3.3: VPC-to-VPC Peering Design Transit Gateway is like a hub and spoke where a gateway receives all the traffic and redirect to the respective VPC. Transit Gateway enables customers to connect thousands of VPCs, with this strategy is easier to scale infrastructure with multiple VPCs. Usually, the Transit Gateway comes with a higher cost than a VPC peering, the cost is related to the number of connections and, GB transferred. Figure 3.4 shows how the Transit Gateway design is. Figure 3.4: Transit VPC Design 25
CHAPTER 3. REFERENCE ARCHITECTURE For the reference architecture was chosen the transit gateway as the VPC communication approach, since the infrastructure must handle multiple environments, the main criteria are scalability and easy configuration. The last control added is the event and centralization of the logs. To improve the architecture was added a logging appliance with a central repository to have full control of what is happening in all environments. This event and centralization of logs are an ISO control mentioned on Operation Security layer of figure 2.9. The figure 3.5 is the Multi-VPC reference architecture in an agnostic solution where all controls above are represented. Figure 3.5: Multi- VPC reference Architecture 26
CHAPTER 3. REFERENCE ARCHITECTURE 3.3 Cloud Service Providers The next step is to choose a Cloud Service Provider to materialize the agnostic architecture. According to c-sharpcorner 1 and Gartner 2 , the most Cloud Service Providers for infrastutre as code are Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP), therefore, these will be compared to decide which one will implement the architecture. It will have three criteria to compare these CPS, the first and the most important is the Native Security controls that assure the ISO requirements. The Second is the maturity of the CPS, this means, the community, documentation, and support. The last one is the cost, based on the Architecture which CSP is cheaper to implement. The documentation of each CSP was analyzed, in order to, find the native service or tool that assures the ISO controls represented on each layer of pyramid 2.9. That comparison is represented in table 3.1 where for each layer and for each control the native service that assures the control of each CSP are represented. In that table, it is possible to see that GCP has a few gaps in comparison to the other two, a lot of that because of its late entrant, to the IaaS market. Between AWS and Azure, both assure the same controls besides the Azure that doesn’t have an Incident Secure Response service.(Google, 2021a) Since the AWS is older and has a lot more clients and users than the rest of the others, it is natural that the community and documentation are more complete. While the native controls were studied and analyzed it was possible to verify that the AWS has more community support and documentation than the Azure and GCP. In terms of the cost, AWS is the most expensive, followed by azure and the one cheaper is the GCP.(Solanki, 2021) Although the GCP is the cheapest CSP, the principal goal and criteria is Security, so the priority is the native controls, and for that reason, GCP will not be an option to materialize the infrastructure. Since AWS and Azure have practically the same controls covered, besides the one already mentioned, the key differentiation was the documentation and community support which AWS has more advantage in this field. Taking into account everything mentioned above the Cloud Service Provider chosen to materialize Architecture 3.5 will be the Amazon Web Services. 1https://www.c-sharpcorner.com/article/top-10-cloud-service-providers/ 2https://www.gartner.com/technology/media-products/reprints/AWS/1-271W1OT3-PTB.html 27
CHAPTER 3. REFERENCE ARCHITECTURE Native Security Controls Layer ISO Control AWS Azure GCP Architecture Network Segregation VPC,Subnet VPC,Subne VPC,Subnet Network Controls AWS Network Firewall,Shield,AWS WAF Azure Firewall,Azure WAF Google Cloud Firewall,Cloud IDS,Google Cloud Armor Secure Development Environment VPC,Subnet VPC,Subnet VPC,Subnet Policy on the use of Cryptographic Controls AWS Encryption SDK Azure Storage Service Encryption (SSE) GCP defautl Encryption Technological layer Secure Development Policy AWS Systems Manager Patch Manager, CIS Hardened Images CIS Hardened Images CIS Hardened Images Controls Against Malware Shield Microsoft Antimalware Google Cloud Armor Managed Protection Compliance Information Security Requirements Analysis & Specification AWS Inspector n/d n/d Identification of Applicable Legislation & Contractual Requirements Artifact Service Trust Portal n/d Information Management Inventory of Assets AWS Config Azure Security Control Cloud Asset Inventory Information Classifications AWS IAM Azure Identity Management Identity and Access Management Operation Security Documented Operating Procedures n/d n/d n/d Management of Technical Vulnerabilities Security Hub Security Center Security Command Center Information Backup AWS Backup, Glacier Backup n/d Event Logging Cloud Trail, Cloud Watch Azure Monitor Cloud Logging Protection of Log Information Cloud trail, Cloud watch Azure Audit Logs Cloud Audit Logs 28
CHAPTER 3. REFERENCE ARCHITECTURE Native Security Controls Acess Control Management of Secret Authentication Information of Users AWS KMS Key vault Secret Manager Management of Privileged Acess Rights IAM Azure Identity Management Identity and Access Management User Access Provisioning IAM Azure Identity Management Identity and Access Management Review of User Access Rights IAM Azure Identity Management Identity and Access Management Access Control Policy IAM Azure Identity Management Identity and Access Management Management of Security Events Responsibilities & Procedures n/d n/d n/d Reporting Information Security Events n/d n/d n/d Planning Information Security Continuity AWS Backup, CloudEndure BackUp,Site Recovery n/d Response to Information Security Incidents AWS Detective n/d n/d Security Test System Security Test n/d n/d n/d n/d - Not Defined Table 3.1: CSP Native Security Controls. 29
Chapter 4 PROOF OF CONCEPT This chapter has the goal to implement and test the infrastructure in AWS. For the POC will be deployed a dummy application. The next sections will be explained the AWS architecture, as well as the application and a walkthrough of all AWS services and controls. The dummy application will be a page with checkboxes where someone can do a security assessment of their system. The technologic layer is ReactJs for the frontend, Java spring boot for the backend, and H2 engine for the database. The backend loads the controls stored in the database and exposes an API that will be consumed by the frontend. 4.1 AWS POC Architecture Now that the CPS is selected is time to convert the agnostic services into AWS services. To test the infrastructure hosting the dummy application there was no need to implement a second environment and the internal application. The controls applied to a single environment and a single application should be replicated and used with a multi-environment and applications. Since the only challenge is the configuration of the tools and services to support those. Figure 4.1 represents the AWS POC architecture, the following is a walkthrough of the AWS services and controls. •DMZ : – Network Firewall - AWS doesn’t provide a native next-generation firewall, so was opted for the traditional NetWork Firewall. – AWS Shields - AWS Shield is a managed Distributed Denial of Service (DDoS) protection service, although there is not an IDS/IPS native service, the AWS Shields can integrate with WAF and intercept and identify potential attacks. 30
CHAPTER 4. PROOF OF CONCEPT – AWS WAF - Besides the protection that any WAF does of layer 7, the AWS WAF helps protect web applications or APIs against bots that may affect availability, compromise security, or consume excessive resources. – Proxy and Reverse Proxy - There is not a native service that acts as a proxy, so the solution is to instantiate machines with a proxy service like Nginx. – AWS CloudFront - Delivers your content through a worldwide network of data centers called edge locations. When a user requests content that you’re serving with CloudFront, the request is routed to the edge location that provides the lowest latency (time delay), so that content is delivered with the best possible performance. It can be integrated with security tools. – S3 VPC endpoint - Has a policy that controls the use of the endpoint to access Amazon S3 resources where the frontend will be deployed. •DashBoard VPC : – BackEnd Instance - The backend instance that will allocate the server will be an EC2. – Database Instance - The Database instance that will allocate the database will be an AWS RDS. – API Gateway - AWS API Gateway is a fully managed service that makes it easy to create, publish, maintain, monitor, and secure APIs at any scale. •Serverless Services : – React FrontEnd Component - The frontend will be deployed on AWS s3 that is an object storage service offering industry-leading scalability, data availability, security, and performance. – Log Storage - Like the frontend the logs will be saved on a dedicated S3, that only will store logs. – CloudWatch - This is a monitoring service for resources and applications. CloudWatch collects and tracks metrics, collects and monitors log files, sets alarms, and automatically reacts to changes in Amazon Web Services resources. – CloudTrail - This is a service that enables governance, compliance, and operational and risk auditing of AWS accounts. Actions taken by a user, role, or an AWS service are recorded as events in CloudTrail. Events include actions taken in the AWS Management Console, AWS Command Line Interface, and AWS SDKs and APIs. It’s possible also to view, search, download, archive, analyze, and respond to account activity across your AWS infrastructure. It identifies who or what took which action, what resources were acted upon when the event occurred, and other details to help analyze and respond to activity in AWS accounts. – AWS Key Management Service - Is a managed service that makes it easy to create and control the encryption keys used to encrypt data, allows to manage secrets and keys. 31
CHAPTER 4. PROOF OF CONCEPT 16 } 17 } 18 } For last, this is a configuration example of the network security group of the Database subnet. We can see that the ingress and egress traffic are only to and from the backend subnet. So no other traffic is allowed to access the database. 1# Database Security Group 2resource ”aws_security_group” ”subnet-database-sg” { 3name = ”rds-sg” 4vpc_id = aws_vpc.app-vpc.id 5 6# Only MySQL in from Backend Security Group 7ingress { 8security_groups = [aws_security_group.subnet-backend-sg.id] 9from_port = var.rds_port 10 to_port = var.rds_port 11 protocol = ”tcp” 12 description = ”MySQL” 13 //cidr_blocks = [var.subnet_backend_range] 14 } 15 16 # Only MySQL out to Backend Security Group 17 egress { 18 security_groups = [aws_security_group.subnet-backend-sg.id] 19 from_port = var.rds_port 20 to_port = var.rds_port 21 protocol = ”tcp” 22 description = ”MySQL” 23 //cidr_blocks = [var.subnet_backend_range] 24 } 25 } 38
CHAPTER 4. PROOF OF CONCEPT 4.2 Controls in Action This section will show some services and controls in action in the AWS management console. Will present some configuration, alarms, dashboard, and information and findings that the implemented controls have of the infrastructure. Figure 4.3 shows the trails configurations of the CloudTrail. We set the CloudTrail to monitor the front-end bucket, logs bucket, and API call and error rate. Cloud trail will monitor accounts behavior that affects these resources. Figure 4.3: CloudTrail trail configuration In figure 4.4 are represented some logs collected by CloudTrail. We can see which user or service did what in what resource. Figure 4.4: CloudTrail logs As mentioned before, CloudWatch allows having more visibility in our resources. To test the CloudWatch alarms, we set two alarms. The first is to notify if the API get three or more forbidden request in one minute. The second is to report if we get five or more forbidden access in five minutes to the S3 front-end. This forbidden request refers to direct access to the front-end S3 bucket. As referred before, the front-end is 39
CHAPTER 4. PROOF OF CONCEPT only accessible by the CloudFront. All other traffic is dropped. Figure 4.5 shows the CloudWatch alarms dashboard. Figure 4.5: CloudWatch Dashboard The following image 4.6 shows the notification email triggered by the CloudWatch alarm. It is possible to set a trigged response, like block or time out the Ip of who trigged the alarm. Figure 4.6: CloudWatch alarm notification via email CloudWatch group logs by resource, and we can set the time of retention of the logs. Each organizations has to define the time to live of the logs analysing the risk and the needs of the logs.We can see that configuration in 4.7 40
CHAPTER 4. PROOF OF CONCEPT Figure 4.7: CloudWatch logs groups Figure 4.8 shows the security findings aggregated in the Security hub. 4.8 shows the security findings aggregated in the Security hub. Figure 4.8: Security Hub dashboard In the dashboard, the security hubs provide a brief summary of the vulnerabilities found by criticality. We can see that a critical vulnerability was found in the infrastructure. 4.9 represents the Security hub summary. Figure 4.9: Security Hub summary The critical vulnerability identified in the security hub is the S3 bucket logs used to store CloudTrail logs was with public access 4.10. This misconfiguration was mitigated by defining a correct policy on the bucket. Figure 4.10: Critical Vulnerability find by Security hub 41
CHAPTER 4. PROOF OF CONCEPT The GuarDuty shows in 4.11 that the root privileges were used to do some action. And generate a report on what actions were and by what IP. This helps to prevent and find privileges escalation attacks. Figure 4.11: GuarDuty dashboard The KSM key dashboard in 4.12 presents the information of the keys. Information like their usage, status and type. Figure 4.12: KMS keys dashboard The AWS system manager in 4.13 shows how easy it is to apply patches to the infrastructure instances. Figure 4.13: AWS System Manager patch dashboard 42
Chapter 5 CONCLUSION AND FUTURE WORK This thesis has initially presented a synthesis of the ISO 27001 controls and an overview of cybersecurity in the industry. With that knowledge consolidated was developed two reference architecture, one On- Premise and another agnostic in the cloud. Further on we compare three cloud service providers in terms of native security tools and services, that comply with the ISO Controls, the documentation offered, and price. That comparison allows it to choose a Cloud Service Provider to materialize the agnostic reference architecture with the controls identified on the comparison previously effectuated. Was developed as well a dummy application to deploy in the infrastructure. Due to a limited budget, we have to adapt the reference architecture to only use the free tier services. In the end, we test the infrastructure services implementations and behavior. We identified the native services and tools needed to respect the ISO controls on the three most popular cloud service providers. But the agnostic reference architecture allows it to materialize in any Cloud Service provider, missing only the mapping of the native services and tools to the ISO controls. With this work, we identify the controls, services, and tools that must be implemented and develop a safe and secure cloud infrastructure. If one day the goal is to be ISO 27001 compliant, this study speeds up the process and benefits the organization because all the services, tools, and architecture were based in annex A ISO 27001. In short, although the cloud has a large attack surface, with the right services and tools we can reduce this surface and keep hosted applications secure. Note that no system is unbreakable or impenetrable, we have to use all possible means and strategies to make our system as secure as possible. Future work will be to try to obtain a budget to implement the infrastructure with all identified services and tools. And finally, do a blue team/red team exercise, where the red team goes through the attacker and tries to penetrate or damage the infrastructure and the blue team will monitor the infrastructure and apply responses to the attacks.. 43
Bibliography Annamalai, N. (2014). Network security groups.https://azure.microsoft.com/pt-pt/blog/network-security- groups/ AWS. (2020). Building a scalable and secure multi-vpc aws network infrastructure. https://d1.awsstatic. com/whitepapers/building-a-scalable-and-secure-multi-vpc-aws-network-infrastructure.pdf AWS. (2021a). Security groups for your vpc.https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ SecurityGroups.html AWS. (2021b). Vpcs and subnets? https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets. html AWS. (2021c). What is amazon vpc? https://docs.aws.amazon.com/vpc/latest/userguide/what-is- amazon-vpc.html Azure. (2021). Network security groups.https://docs.microsoft.com/en-us/azure/virtual-network/ network-security-groups-overview Bruijn, & Janssen. (2017). Building cybersecurity awareness: The need for evidence-based framing strategies. 34, 1–7. https://doi.org/https://doi.org/10.1016/j.giq.2017.02.007 Cloudflare. (2021a). What is a next-generation firewall (ngfw)? https://www.cloudflare.com/learning/ security/what-is-next-generation-firewall-ngfw/ Cloudflare. (2021b). What is a subnet? | how subnetting works? https://www.cloudflare.com/learning/ network-layer/what-is-a-subnet/ Cloudflare. (2021c). What is a virtual private cloud (vpc)? https://www.cloudflare.com/learning/cloud/ what-is-a-virtual-private-cloud/ Dong, X. M. R. L. Z. L. J. L. M. (2011). Specifying and enforcing the principle of least privilege in role-based access control. Concurrency and Computation: Practice and Experience vol. 23 iss. 12. Firesmith, D. (2017). Virtualization via containers.https://insights.sei.cmu.edu/sei_blog/2017/09/ virtualization-via-containers.html Google. (2021a). Compare aws and azure services to google cloud.https://cloud.google.com/free/docs/ aws-azure-gcp-service-comparison Google. (2021b). External tcp/udp network load balancing overview.https://cloud.google.com/loadbalancing/docs/network IBM. (2020). Three-tier architecture.https://www.ibm.com/cloud/learn/three-tier-architecture ISMS. (2020). Introducing annex a controls.https://www.isms.online/iso-27001/annex-a-controls/ 44
BIBLIOGRAPHY Microsoft. (2021). What is infrastructure as code? https://docs.microsoft.com/en-us/devops/deliver/ what-is-infrastructure-as-code Newcombe, L. (2012). Securing cloud services: A pragmatic approach to security architecture in the cloud. OWASP. (2017). The owasp top ten.https://owasp.org/www-project-top-ten/ OWASP. (WSTG-stable-INFO-02). The owasp testing project.https://owasp.org/www-project-web-security- testing-guide Pettey, C. (2020). Cloud shift impacts all it markets. Retrieved October 26, 2020, from https://www. gartner.com/smarterwithgartner/cloud-shift-impacts-all-it-markets/ Reid, G. (2016). Detection in depth.https://blogs.cisco.com/security/detection-in-depth Schneider, F. (2003). Least privilege and more. IEEE Security Privacy Magazine vol. 1 iss. 5. Schneier, B. (2000). The process of security. https://www.schneier.com/essays/archives/2000/04/ the_process_of_secur.html Solanki, J. (2021). Cloud pricing comparison 2021: Aws vs azure vs google cloud.https://www.simform. com/blog/compute-pricing-comparison-aws-azure-googlecloud/ Souppaya, M. P., Morello, J., & Scarfone, K. (2017). Application container security guide. https://doi.org/ https://doi.org/10.6028/NIST.SP.800-190 Wittig, A. (2016). Beyond the default: A multi-vpc architecture. https://cloudonaut.io/beyond-the-default- a-multi-vpc-architecture/ 45
List of Figures 2.1 World’s Biggest Data Breaches & Hacks ......................... 4 2.2 Threat Model example ................................. 7 2.3 OWASP Top 10 2017 .................................. 9 2.4 Virtualization ...................................... 10 2.5 Container Architecture ................................. 11 2.6 Major risk of containers technologies .......................... 11 2.7 Example of DevSecOps ................................. 12 2.8 Shared Responsibility Model ............................... 13 2.9 Annex A controls .................................... 15 3.1 On-Premise Reference Architecture ........................... 20 3.2 Single VPC Reference Architecture ............................ 23 3.3 VPC-to-VPC Peering Design ............................... 25 3.4 Transit VPC Design ................................... 25 3.5 Multi- VPC reference Architecture ............................ 26 4.1 AWS Reference Architecture ............................... 33 4.2 POC Architecture .................................... 36 4.3 CloudTrail trail configuration ............................... 39 4.4 CloudTrail logs ..................................... 39 4.5 CloudWatch Dashboard ................................. 40 4.6 CloudWatch alarm notification via email ......................... 40 4.7 CloudWatch logs groups ................................. 41 4.8 Security Hub dashboard ................................. 41 4.9 Security Hub summary ................................. 41 4.10 Critical Vulnerability find by Security hub ......................... 41 4.11 GuarDuty dashboard .................................. 42 4.12 KMS keys dashboard .................................. 42 4.13 AWS System Manager patch dashboard ......................... 42 46