{"id":1304,"date":"2022-04-11T10:38:25","date_gmt":"2022-04-11T09:38:25","guid":{"rendered":"http:\/\/www.klaushaller.net\/?p=1304"},"modified":"2022-04-11T10:38:25","modified_gmt":"2022-04-11T09:38:25","slug":"paas-perimeter-security-in-azure-and-gcp","status":"publish","type":"post","link":"https:\/\/www.klaushaller.net\/?p=1304","title":{"rendered":"PaaS Perimeter Security in Azure and GCP"},"content":{"rendered":"\n<p>With all the efficient and innovative Platform-as-a-Service (PaaS) services in the cloud world, a catastrophe is only one click away. An engineer wrongly configures a database or object storage service, and cybercriminals have access to all data from anywhere on the internet. Booz Allen Hamilton, WWE, Verizon Wireless, Accenture, the Pentagon: these are just some prominent companies and organizations that misconfigured their AWS S3 object storage and lost millions of data records. So, how can cloud security architects avert such catastrophes?<\/p>\n\n\n\n<p>The article exemplifies typical but risky configuration options in Microsoft\u2019s Azure and the Google Cloud Platform (GCP). Then, its focus shifts to Azure\u2019s concepts of Private Endpoints and Private Links and to GPC Service Controls. Looking at the different features of the two sample public cloud providers allows for a better understanding of the various security risks and mitigation approaches when protecting PaaS services.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Basic PaaS Configurations<\/h1>\n\n\n\n<p>When creating PaaS service instances via the GUI, the cloud vendors usually suggest (also) security configuration options with a relaxed security level. Their motto: simple and easy to set up, every engineer trying out the cloud and a specific service should succeed. But such configurations come with risks that this section elaborates on in more detail.<\/p>\n\n\n\n<p>In classic data centers, a solution can invoke internal web or microservices only if meeting two conditions:<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\"><li>Authentication (and authorization), i.e., only specific applications, solutions, and users can invoke the service after verifying their identity and when they have the needed access rights and roles.<\/li><li>Reachability of the service in the network: Networks are typically divided into different zones, separated by firewalls. Invoking services in different zones requires opening up connections.<\/li><\/ol>\n\n\n\n<p>PaaS service default configurations usually require authentication but come with limited network-level protection. By default, PaaS services belong to one zone: the worldwide internet, where everybody can reach everything.<\/p>\n\n\n\n<p>Figure 1 illustrates the network security configurations when creating instances for two typical GCP PaaS services: Cloud Storage, Google\u2019s object storage service, and managed SQL database instances. When engineers create a database service in GCP, they have to choose between a public and a private IP address (Figure 1, 1). A public IP means that everyone on the internet can connect to this service. If the authentication mechanisms are in place and configured correctly and if attackers cannot get access keys etc., this is a perfectly safe approach. However, it is a challenge to ensure that none of hundreds or thousands of engineers in a larger IT organization ever make a critical mistake. And indeed, Goole provides the option to restrict access to certain network zones to reduce the risk (Figure 1, 2).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/gcp_paas_services_cloud_storage_sql_server_instance_network_security.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"496\" height=\"231\" src=\"http:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/gcp_paas_services_cloud_storage_sql_server_instance_network_security.jpg\" alt=\"\" class=\"wp-image-1305\" srcset=\"https:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/gcp_paas_services_cloud_storage_sql_server_instance_network_security.jpg 496w, https:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/gcp_paas_services_cloud_storage_sql_server_instance_network_security-300x140.jpg 300w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/a><figcaption>Figure 1: GCP PaaS Services for storing data. Network security settings when creating SQL Server (left) and Cloud Storage instances (right)<\/figcaption><\/figure>\n\n\n\n<p>When creating a Cloud Storage bucket, engineers must decide whether to enforce the prevention of public access to the data stored in this bucket. The challenges with any object storage are \u2013 be it in GCP, Azure, AWS, or any other cloud \u2013 contradicting network security needs for the two primary use cases.<\/p>\n\n\n\n<p>The first use case for object storage is storing classic (internal) application data. An archiving system might store Pdf files, security solutions potentially video recordings that document who performed which command on a particular system. Such data must not be made available to the internet. The perfect security setting preventing for such an object storage service instance is \u201cforbid all internet access.\u201d<\/p>\n\n\n\n<p>The second use case for object storage is storing and delivering websites, e.g., a web page with an interview text plus incorporated pictures. Everyone on the internet should be able to access the web pages and read the interview. There is no need for network firewalls or authentication mechanisms.<\/p>\n\n\n\n<p>So, there are two highly relevant use cases, and one technology solves both needs and challenges. That is, usually, perfect, just not in this case. In this peculiar case, it is a security risk. When you configure the object storage for a bank\u2019s know-your-customer documents by mistake as publicly accessible website storage, you might only notice when your documents appear for sale in the darknet.<\/p>\n\n\n\n<p>Public IPs and the risk of misconfiguration is not a GCP specialty. Figure 2 presents a GUI mask for creating a Cosmos DB database service via the Azure portal. Two settings create public endpoints: \u201call networks\u201d and \u201cpublic endpoint (selected networks).\u201d Especially in the case of \u201call networks,\u201d anyone on the internet can reach the Cosmos service instance. In other words, access control misconfigurations can have catastrophic results.<\/p>\n\n\n\n<p>To point out the situation clearly \u2013 and this is the same for GCP Cosmos DB or Azure SQL databases and many more database services in the cloud \u2013 there is no sensible reason why databases should have a public IP. Databases are backend systems. There is no point reaching them from outside the organization.<\/p>\n\n\n\n<p>The screenshot in Figure 2 has a third option for Cosmos DB: Private Endpoints. The following section looks at the details.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/cosmos_db_network_security.png\"><img loading=\"lazy\" decoding=\"async\" width=\"605\" height=\"332\" src=\"http:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/cosmos_db_network_security.png\" alt=\"\" class=\"wp-image-1306\" srcset=\"https:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/cosmos_db_network_security.png 605w, https:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/cosmos_db_network_security-300x165.png 300w\" sizes=\"auto, (max-width: 605px) 100vw, 605px\" \/><\/a><figcaption><a>Figure <\/a>2: Network security options when creating a Cosmos DB<\/figcaption><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">Azure Private Endpoint and Link<\/h1>\n\n\n\n<p>Some time ago, Azure introduced Private Endpoints and Private Links. They provide an extra layer of security. Thanks to them, engineers can incorporate PaaS service instances (e.g., Cosmos databases) into a VNet and access PaaS services without going via public IPs. When creating a Cosmos Database Service instance with this option, engineers create a Private Endpoint in their VNet with a VNet-internal, private, non-public IP. The Private Endpoint points to the actual resource, e.g., a Cosmos Database, via a Private Link.<\/p>\n\n\n\n<p>\u201cPrivate Endpoint\u201d is the third connectivity option in the example of creating a Cosmos service instance (Figure 3). When chosen, engineers can create and add a private endpoint. The Private Endpoint has a name \u2013 and the engineer specifies into which VNet Azure shall deploy the Private Endpoint.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/azure_private_endpoint.png\"><img loading=\"lazy\" decoding=\"async\" width=\"548\" height=\"298\" src=\"http:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/azure_private_endpoint.png\" alt=\"\" class=\"wp-image-1307\" srcset=\"https:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/azure_private_endpoint.png 548w, https:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/azure_private_endpoint-300x163.png 300w\" sizes=\"auto, (max-width: 548px) 100vw, 548px\" \/><\/a><figcaption><a>Figure <\/a>3: Private Endpoint configuration option for Azure Cosmos DB<\/figcaption><\/figure>\n\n\n\n<p>Figure 4 illustrates what happens in the background in the case of a private endpoint \/ private link connectivity (B) versus the traditional approach (A).<\/p>\n\n\n\n<p>In addition to configuring Azure Private Endpoints and Private Links, engineers must be aware of and mitigate two more risks. First, Private Links and Private Endpoints are for themselves save, but the cloud architecture must ensure no firewalls are open on the resource itself (risk C). The benefit is that there is no need to open a firewall to make solutions work and components interact. Thus, forbidding opening ports gets feasible. Second, criminal employees might try to exfiltrate data. They could send company data to a personal Cosmos Database service instance controlled and owned by themselves as private persons (D). Cloud security architects can demand that all traffic to storage or database services goes via Azure Private Endpoints thanks to Private Endpoints and Private Links. Auditing and analyzing networks for exfiltration paths gets much more straightforward.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/azure_paas_understanding_private_endpoints_and_private_link.png\"><img loading=\"lazy\" decoding=\"async\" width=\"448\" height=\"233\" src=\"http:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/azure_paas_understanding_private_endpoints_and_private_link.png\" alt=\"\" class=\"wp-image-1308\" srcset=\"https:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/azure_paas_understanding_private_endpoints_and_private_link.png 448w, https:\/\/www.klaushaller.net\/wp-content\/uploads\/2022\/04\/azure_paas_understanding_private_endpoints_and_private_link-300x156.png 300w\" sizes=\"auto, (max-width: 448px) 100vw, 448px\" \/><\/a><figcaption><a>Figure <\/a>4: Classic PaaS Connectivity (A) versus Private Endpoint \/ Private Link (B). C and D illustrate remaining network security risks for Private Endpoint and Private LInks.<\/figcaption><\/figure>\n\n\n\n<p>Before discussing Google\u2019s real cool feature for PaaS perimeter protection, a final remark about Azure Private Links. Azure Private Link Service enables engineers to make their own services and resources available via Azure Private Endpoints. Thereby, they benefit from the same security features for their code that Microsoft relies on for protecting its Azure PaaS services.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">GCP Perimeter Protection with VPC Service Controls<\/h1>\n\n\n\n<p>Google\u2019s VPC Service Controls concept enables cloud security architects to build a perimeter-protected network zone composed of IaaS and (!) PaaS resources. A VPC Service Control definition comprises five main elements: projects, services in scope, accessible services, access level, and traffic exceptions.<\/p>\n\n\n\n<p>The <strong>GCP projects<\/strong> of a VPC Service Control define the trust perimeter. These projects trust each other and can freely interact as defined by the network configurations. In contrast, applications in other VPC Service Control perimeters must not access the resources if not permitted explicitly.<\/p>\n\n\n\n<p>The <strong>GCP<\/strong> <strong>Services<\/strong> part of a VPC Service Control definition specifies for which services the perimeter protection of the VPC Service Control applies. That is a crucial setting. If, for example, Cloud Storage is not part of the perimeter definition, engineers can easily transfer data in and out of the VPC Service Control perimeter. A note: Google adds the feature to more and more services, but it might not yet be available for all needed by a company. Thus, disabling unprotectable GCP services can e a necessity.<\/p>\n\n\n\n<p><strong>GCP Accessible Services<\/strong> add another nuance to perimeter definitions. The feature enables engineers to limit the GCP services, which resources can invoke within the Service Control perimeter.<\/p>\n\n\n\n<p>As a result of a VPC Service Control definition, services respectively their callability fall into three categories:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Service instances of GCP services under VPC Service Control perimeter protection. They are only accessible from within the perimeter. Plus, they cannot invoke external service instances.<\/li><li>Service instances of GCP services without restriction. VMs within a VPC Service Control can connect to VPC-internal and external service instances. Plus, VPC external resources can (try to) connect to VPC-internal instances of this type.<\/li><li>Services blocked for use within a VPC Service Control (\u201cGCP Accessible Services\u201d) setting.<\/li><\/ul>\n\n\n\n<p>The <strong>GCP Access Level<\/strong> is an option for context-aware authentication and authorization. It is a new and upcoming approach requiring a detailed analysis worth a dedicated article.<\/p>\n\n\n\n<p>A last core element is an option for defining exceptions, i.e., adding <strong>ingress and egress traffic<\/strong> <strong>rules<\/strong> allowing otherwise not allowed traffic into and out of the VPC Service Control. Thus, VMs from within one service parameter might get read access to Cloud Storage in a different service perimeter.<\/p>\n\n\n\n<p>VPC Service Controls in the GCP world and the Azure Private Link\/Private Endpoint help cloud security architects shield PaaS (and IaaS) service instances from the internet or other internal network zones. Their absoluteness \u2013 especially the exceptionally rigid VPC Service Controls \u2013 is what makes them so valuable. No one has to define, analyze, and manage thousands of rules and exceptions to understand and ensure the overall security posture of a network consisting of IaaS and PaaS resources. Instead, PaaS security becomes (nearly) a child\u2019s play.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With all the efficient and innovative Platform-as-a-Service (PaaS) services in the cloud world, a catastrophe is only one click away. An engineer wrongly configures a database or object storage service, and cybercriminals have access to all data from anywhere on the internet. Booz Allen Hamilton, WWE, Verizon Wireless, Accenture, the Pentagon: these are just some [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1309,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24,22,25,23],"tags":[37,42,41],"class_list":["post-1304","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","category-cloudsecurity","category-gcp","category-securityarchitecture","tag-network-security","tag-paas","tag-paas-security"],"_links":{"self":[{"href":"https:\/\/www.klaushaller.net\/index.php?rest_route=\/wp\/v2\/posts\/1304","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.klaushaller.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.klaushaller.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.klaushaller.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.klaushaller.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1304"}],"version-history":[{"count":1,"href":"https:\/\/www.klaushaller.net\/index.php?rest_route=\/wp\/v2\/posts\/1304\/revisions"}],"predecessor-version":[{"id":1310,"href":"https:\/\/www.klaushaller.net\/index.php?rest_route=\/wp\/v2\/posts\/1304\/revisions\/1310"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.klaushaller.net\/index.php?rest_route=\/wp\/v2\/media\/1309"}],"wp:attachment":[{"href":"https:\/\/www.klaushaller.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.klaushaller.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.klaushaller.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}