{"id":95430,"date":"2021-08-19T09:00:51","date_gmt":"2021-08-19T16:00:51","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/security\/blog\/?p=95430"},"modified":"2023-05-15T22:58:33","modified_gmt":"2023-05-16T05:58:33","slug":"automating-security-assessments-using-cloud-katana","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/security\/blog\/2021\/08\/19\/automating-security-assessments-using-cloud-katana\/","title":{"rendered":"Automating security assessments using Cloud Katana"},"content":{"rendered":"
Today, we are open sourcing Cloud Katana<\/a>, a cloud-native serverless application built on the top of Azure Functions<\/a> to assess security controls in the cloud and hybrid cloud environments. We are currently covering only use cases in Azure, but we are working on extending it to other cloud providers.<\/p>\n <\/p>\n Figure 1: Cloud Katana design principles.<\/em><\/p>\n Cloud Katana was designed and developed under the following principles:<\/p>\n Cloud Katana is a cloud-native solution that relies on platform as a service (PaaS) concepts to provide a simplified and scalable event-driven solution without worrying about deploying and maintaining the underlying infrastructure used to execute simulations.<\/p>\n To meet this need, Cloud Katana uses Azure Functions to abstract the operating system layer from the code through a pay-per-execution billing model that automatically scales based on trigger invocations.<\/p>\n Figure 2: A basic definition of a serverless execution model.<\/em><\/p>\n Simulation steps are represented as blocks of code called functions and invoked via HTTP requests<\/a> through a built-in serverless web API.<\/p>\n With this feature, one could simply send an HTTP request with information about the specific simulation and wait for the infrastructure underneath to process the request. Currently, all functions are written in PowerShell (subject to change) and categorized following the MITRE ATT&CK framework.<\/p>\n Figure 3: Compute on demand via a serverless web API and categorized by ATT&CK tactics.<\/em><\/p>\n Every attack simulation is documented in a YAML-based format to aggregate metadata such as title, description, ATT&CK mappings, expected input and output, and even preconditions to make sure we have the right permissions before running a simulation step. This facilitates the processing of every documented action programmatically and the automatic setup of a few other resources.<\/p>\n Figure 4: YAML-based documentation example.<\/em><\/p>\n The project is also designed to handle state and ensure reliability across numerous attack simulations by using an extension of Azure functions named durable functions<\/a>. This feature allows the orchestration and execution of scenarios where actions could depend on the state and output of other simulation steps. This is good to define specific attack paths as code.<\/p>\n Figure 5: Orchestrated stateful execution to execute chains of events.<\/em><\/p>\n Cloud Katana also enforces authentication and authorization best practices to secure the application.<\/p>\n The project uses the Microsoft Identity Platform<\/a> (also known as Azure Active Directory or Azure AD) as its identity provider to authenticate clients. This feature requires a registered Azure AD application, which allows users to connect to the Azure Function app using OAuth authentication.<\/p>\n In addition, using an identity provider enables the following features:<\/p>\n Figure 6: OAuth device authorization grant flow used by Cloud Katana.<\/em><\/p>\n Besides enforcing users to authenticate before executing simulations, the project also implements \u201cApplication Role Assignments\u201d to restrict access to selected users. This allows organizations to select who can use the project in their environments.<\/p>\n Furthermore, when executing simulations in Azure, Cloud Katana uses a user-assigned managed identity<\/a> to access Azure AD-protected resources. One of the advantages of managed identities is that it removes the need to provision or rotate any secrets.<\/p>\n Figure 7: A user-assigned managed identity accessing Azure resources.<\/em><\/p>\n Access to Azure resources is defined by the permissions assigned to the managed identity. We currently cover Azure-based scenarios. Therefore, we use permissions associated with each major set of Microsoft Graph APIs<\/a> to control access to specific Azure resources.<\/p>\n For example, if we wanted to use Cloud Katana to add credentials to an application, we would need to grant the following permissions<\/a> (from least to most privileged) to the managed identity:<\/p>\n Figure 8: Cloud Katana adding credentials to an Azure AD application via Microsoft Graph API.<\/em><\/p>\n Another feature that makes Cloud Katana a very powerful tool is the flexibility to use any programming language to request simulations. If the client used to interact with Cloud Katana can handle the Azure AD authentication process, it doesn’t matter how the simulation is requested.<\/p>\n Figure 9: Programming language agnostic clients to interact with the serverless web API.<\/em><\/p>\n Microsoft Authentication libraries are available via PowerShell as MSAL.PS<\/a> and Python as MSAL<\/a>. We could also use other open-source projects, such as Jupyter Notebooks<\/a>, to create repetitive templates to show the execution of simulations and share the process with other security researchers.<\/p>\n Figure 10: Running a Jupyter Notebook to execute simulations.<\/em><\/p>\n Finally, we are currently experimenting with Azure App Service Hybrid Connections<\/a> to not only run simulations in the cloud but also on-premises. Hybrid Connections use a relay agent<\/a> to securely expose services that run on-premises to the public cloud. The relay agent sits in the middle between the on-premise server and the Cloud Katana Azure Function app.<\/p>\n A relay agent\u2014Hybrid Connection Manager<\/a> (HCM)\u2014is set up on the on-premise server and configured to call out to the Azure Relay over port 443. The Cloud Katana function app then connects to the Azure Relay to interact with the on-premise server and execute simulations locally. The connection uses TLS 1.2 for security and shared access signature (SAS) keys for authentication and authorization.<\/p>\n Figure 11: Running simulations on resources on-premise from Cloud Katana function app.<\/em><\/p>\n After learning about Cloud Katana\u2019s design principles, you can check our docs to deploy the project<\/a>.<\/p>\n Once the Azure function app is deployed successfully, you can run some of the demos available<\/a> in our docs. The main idea is not only to write simulation steps as code and execute them on demand but also to assess detections and security controls.<\/p>\n Besides automating and releasing more simulation steps, we are also going to be working on several features to improve the deployment of the tool and execution scope. The list below shows some of the ideas we currently have (not in a specific order):<\/p>\n We look forward to contributions and feedback from the community. If you would like to contribute to specific areas of the project, open an issue in our GitHub repository<\/a> and share your ideas. Look at the previous \u201cFuture Work\u201d section for some ideas.<\/p>\n To learn more about this open-source initiative, visit the Cloud Katana GitHub repository<\/a>.<\/p>\n To learn more about Microsoft Security solutions,\u00a0visit our\u00a0website<\/a>.\u00a0Bookmark the\u00a0Security blog<\/a>\u00a0to keep up with our expert coverage on security matters. Also, follow us at\u00a0@MSFTSecurity<\/a>\u00a0for the latest news and updates on cybersecurity.<\/p>\n","protected":false},"excerpt":{"rendered":" Today, we are open-sourcing Cloud Katana, a cloud-native tool under development, to automate simulation steps on-demand in multi-cloud and hybrid cloud environments. This tool is an event-driven, serverless compute application built on the top of Azure Functions that expedites the research process and validation of security controls.<\/p>\n","protected":false},"author":106,"featured_media":95550,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ms_queue_id":[],"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","footnotes":""},"content-type":[3662],"topic":[3664,3667],"products":[],"threat-intelligence":[],"tags":[3822],"coauthors":[2572],"class_list":["post-95430","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","content-type-news","topic-ai-and-machine-learning","topic-cloud-security","tag-microsoft-security-insights"],"yoast_head":"\nDesign principles of Cloud Katana<\/h2>\n
<\/p>\n
\n
A serverless execution model<\/h2>\n
<\/p>\n
Compute on-demand as a web API<\/h2>\n
<\/p>\n
YAML-based attack definitions<\/h2>\n
<\/p>\n
Orchestrated stateful execution<\/h2>\n
<\/p>\n
Secure authentication and authorization<\/h2>\n
Authentication<\/h3>\n
\n
<\/p>\n
Authorization<\/h3>\n
Managed identities integration<\/h2>\n
<\/p>\n
Granular access control to Azure resources<\/h2>\n
\n
<\/p>\n
Programming language agnostic clients<\/h2>\n
<\/p>\n
<\/p>\n
Cloud and on-premise simulations<\/h2>\n
<\/p>\n
Deploy Cloud Katana<\/h2>\n
Assess security controls<\/h2>\n
Future work<\/h2>\n
\n
Community contributions<\/h2>\n
Learn more<\/h2>\n