14 KiB
Az - Logic Apps
{{#include ../../../banners/hacktricks-training.md}}
기본 정보
Azure Logic Apps는 Microsoft Azure에서 제공하는 클라우드 기반 서비스로, 개발자가 다양한 서비스, 데이터 소스 및 애플리케이션을 통합하는 워크플로를 생성하고 실행할 수 있게 해줍니다. 이러한 워크플로는 비즈니스 프로세스를 자동화하고, 작업을 조정하며, 다양한 플랫폼 간의 데이터 통합을 수행하도록 설계되었습니다.
Logic Apps는 광범위한 사전 구축된 커넥터를 사용하여 워크플로를 생성할 수 있는 시각적 디자이너를 제공하므로, Office 365, Dynamics CRM, Salesforce 등 다양한 서비스에 쉽게 연결하고 상호작용할 수 있습니다. 또한 특정 요구에 맞는 사용자 정의 커넥터를 생성할 수도 있습니다.
예시
- 데이터 파이프라인 자동화: Logic Apps는 Azure Data Factory와 결합하여 데이터 전송 및 변환 프로세스를 자동화할 수 있습니다. 이는 Azure SQL Database와 Azure Blob Storage와 같은 다양한 데이터 저장소 간에 데이터를 이동하고 변환하는 확장 가능하고 신뢰할 수 있는 데이터 파이프라인을 생성하는 데 유용하며, 분석 및 비즈니스 인텔리전스 작업에 도움을 줍니다.
- Azure Functions와 통합: Logic Apps는 Azure Functions와 함께 작동하여 필요에 따라 확장되는 정교한 이벤트 기반 애플리케이션을 개발하고 다른 Azure 서비스와 원활하게 통합할 수 있습니다. 사용 사례의 예로는 Logic App을 사용하여 Azure Storage 계정의 변경과 같은 특정 이벤트에 응답하여 Azure Function을 트리거하는 것이 있으며, 이를 통해 동적 데이터 처리가 가능합니다.
LogicAPP 시각화
그래픽으로 LogicApp을 볼 수 있습니다:

또는 "Logic app code view" 섹션에서 코드를 확인할 수 있습니다.
SSRF 보호
Logic App이 SSRF에 취약하더라도, Logic Apps는 메타데이터에서 자격 증명에 접근할 수 없으므로 자격 증명에 접근할 수 없습니다.
예를 들어, 다음과 같은 것은 토큰을 반환하지 않습니다:
# The URL belongs to a Logic App vulenrable to SSRF
curl -XPOST 'https://prod-44.westus.logic.azure.com:443/workflows/2d8de4be6e974123adf0b98159966644/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=_8_oqqsCXc0u2c7hNjtSZmT0uM4Xi3hktw6Uze0O34s' -d '{"url": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/"}' -H "Content-type: application/json" -v
호스팅 옵션
여러 호스팅 옵션이 있습니다:
- 소비형
- 다중 테넌트: 공유 컴퓨팅 리소스를 제공하며, 퍼블릭 클라우드에서 운영되고, 작업당 요금 모델을 따릅니다. 이는 경량 및 비용 효율적인 작업에 이상적입니다.
- 표준
- 워크플로우 서비스 계획: 네트워킹을 위한 VNET 통합이 있는 전용 컴퓨팅 리소스와 워크플로우 서비스 계획 인스턴스당 요금을 부과합니다. 이는 더 많은 제어가 필요한 요구가 높은 작업에 적합합니다.
- 앱 서비스 환경 V3: 완전한 격리 및 확장성을 갖춘 전용 컴퓨팅 리소스입니다. 또한 네트워킹을 위해 VNET과 통합되며, 환경 내의 앱 서비스 인스턴스를 기반으로 한 요금 모델을 사용합니다. 이는 높은 격리가 필요한 기업 규모의 애플리케이션에 이상적입니다.
- 하이브리드: 로컬 처리 및 다중 클라우드 지원을 위해 설계되었습니다. 고객 관리 컴퓨팅 리소스를 로컬 네트워크 접근과 함께 허용하며, Kubernetes 이벤트 기반 자동 확장(KEDA)을 활용합니다.
열거
{% tabs %} {% tab title="az cli" %} {% code overflow="wrap" %}
# List
az logic workflow list --resource-group <ResourceGroupName>
# Get info
az logic workflow show --name <LogicAppName> --resource-group <ResourceGroupName>
# Get details of a specific Logic App workflow, including its connections and parameters
az rest \
--method GET \
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}?api-version=2016-10-01&$expand=connections.json,parameters.json" \
--headers "Content-Type=application/json"
# Get details about triggers for a specific Logic App
az rest --method GET \
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{logicAppName}/triggers?api-version=2016-06-01"
# Get the callback URL for a specific trigger in a Logic App
az rest --method POST \
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{logicAppName}/triggers/{triggerName}/listCallbackUrl?api-version=2016-06-01"
# Get the history of a specific trigger in a Logic App
az rest --method GET \
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{logicAppName}/triggers/{triggerName}/histories?api-version=2016-06-01"
# List all runs of a specific Logic App workflow
az rest \
--method GET \
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs?api-version=2016-06-01" \
--headers "Content-Type=application/json"
# Get all actions within a specific run of a Logic App workflow
az rest \
--method GET \
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs/{runName}/actions?api-version=2016-06-01" \
--headers "Content-Type=application/json"
# List all versions of a specific Logic App workflow
az rest \
--method GET \
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions?api-version=2016-06-01" \
--headers "Content-Type=application/json"
# Get details of a specific version of a Logic App workflow
az rest \
--method GET \
--uri "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionName}?api-version=2016-06-01" \
--headers "Content-Type=application/json"
az rest \
--method GET \
--uri "https://examplelogicapp1994.scm.azurewebsites.net/api/functions/admin/download?includeCsproj=true&includeAppSettings=true" \
--headers "Content-Type=application/json"
# List all Logic Apps in the specified resource group
az logicapp list --resource-group <ResourceGroupName>
# Show detailed information about a specific Logic App
az logicapp show --name <LogicAppName> --resource-group <ResourceGroupName>
# List all application settings for a specific Logic App
az logicapp config appsettings list --name <LogicAppName> --resource-group <ResourceGroupName>
{% endcode %} {% endtab %}
{% tab title="Az PowerShell" %} {% code overflow="wrap" %}
Get-Command -Module Az.LogicApp
# List
Get-AzLogicApp -ResourceGroupName <ResourceGroupName>
# Get info
Get-AzLogicApp -ResourceGroupName <ResourceGroupName> -Name <LogicAppName>
# Get details of a specific Logic App workflow run action
Get-AzLogicAppRunAction -ResourceGroupName "<ResourceGroupName>" -Name "<LogicAppName>" -RunName "<RunName>"
# Get the run history for a specific Logic App
Get-AzLogicAppRunHistory -ResourceGroupName "<ResourceGroupName>" -Name "<LogicAppName>"
# Get details about triggers for a specific Logic App
Get-AzLogicAppTrigger -ResourceGroupName "<ResourceGroupName>" -Name "<LogicAppName>"
# Get the callback URL for a specific trigger in a Logic App
Get-AzLogicAppTriggerCallbackUrl -ResourceGroupName "<ResourceGroupName>" -LName "<LogicAppName>" -TriggerName "<TriggerName>"
# Get the history of a specific trigger in a Logic App
Get-AzLogicAppTriggerHistory -ResourceGroupName "<ResourceGroupName>" -Name "<LogicAppName>" -TriggerName "<TriggerName>"
{% endcode %} {% endtab %} {% endtabs %}
통합 계정
통합 계정은 Azure Logic Apps의 기능입니다. 통합 계정은 EDI, AS2 및 XML 스키마 관리를 포함한 고급 B2B 기능을 활성화하여 기업 수준의 통합을 용이하게 합니다. 통합 계정은 Logic Apps에 사용되는 다음 아티팩트를 저장하는 Azure의 컨테이너입니다:
- 스키마: 통합 계정에서 메시지를 검증하고 처리하기 위한 XML 스키마를 관리합니다.
- 맵: 통합 워크플로 내에서 데이터 형식을 변환하기 위해 XSLT 기반 변환을 구성합니다.
- 어셈블리: 논리 및 데이터 처리를 간소화하기 위해 통합 계정 어셈블리를 관리합니다.
- 인증서: 메시지를 암호화하고 서명하기 위한 인증서를 처리하여 안전한 통신을 보장합니다.
- 파트너: B2B 거래를 위한 거래 파트너 정보를 관리하여 원활한 통합을 가능하게 합니다.
- 계약: 거래 파트너와 데이터 교환을 위한 규칙 및 설정을 구성합니다 (예: EDI, AS2).
- 배치 구성: 메시지를 효율적으로 그룹화하고 처리하기 위한 배치 처리 구성을 관리합니다.
- RosettaNet PIP: B2B 통신을 표준화하기 위해 RosettaNet 파트너 인터페이스 프로세스(PIPs)를 구성합니다.
열거
{% tabs %} {% tab title="az cli" %} {% code overflow="wrap" %}
# Integration account
az logic integration-account list --resource-group <resource-group-name>
az logic integration-account show --resource-group <resource-group-name> --name <integration-account-name>
az logic integration-account list-callback-url --resource-group <resource-group-name> --integration-account-name <integration-account-name>
# Batch-configuration
az logic integration-account batch-configuration list \
--resource-group <resource-group-name> \
--integration-account-name <integration-account-name>
az logic integration-account batch-configuration show \
--resource-group <resource-group-name> \
--integration-account-name <integration-account-name> \
--batch-configuration-name <batch-configuration-name>
# Map
az logic integration-account map list \
--resource-group <resource-group-name> \
--integration-account <integration-account-name>
az logic integration-account map show \
--resource-group <resource-group-name> \
--integration-account <integration-account-name> \
--map-name <map-name>
# Partner
az logic integration-account partner list \
--resource-group <resource-group-name> \
--integration-account <integration-account-name>
az logic integration-account partner show \
--resource-group <resource-group-name> \
--integration-account <integration-account-name> \
--name <partner-name>
# Session
az logic integration-account session list \
--resource-group <resource-group-name> \
--integration-account <integration-account-name>
az logic integration-account session show \
--resource-group <resource-group-name> \
--integration-account <integration-account-name> \
--name <session-name>
# Assembly
# Session
az logic integration-account assembly list \
--resource-group <resource-group-name> \
--integration-account <integration-account-name>
az logic integration-account assembly show \
--resource-group <resource-group-name> \
--integration-account <integration-account-name> \
--assembly-artifact-name <assembly-name>
{% endcode %} {% endtab %}
{% tab title="Az PowerShell" %} {% code overflow="wrap" %}
Get-Command -Module Az.LogicApp
# Retrieve details of an integration account
Get-AzIntegrationAccount -ResourceGroupName <resource-group-name> -Name <integration-account-name>
# Retrieve the callback URL of an integration account
Get-AzIntegrationAccountCallbackUrl -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name>
# Retrieve details of a specific agreement in an integration account
Get-AzIntegrationAccountAgreement -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <agreement-name>
# Retrieve details of a specific assembly in an integration account
Get-AzIntegrationAccountAssembly -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <assembly-name>
# Retrieve details of a specific batch configuration in an integration account
Get-AzIntegrationAccountBatchConfiguration -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <batch-configuration-name>
# Retrieve details of a specific certificate in an integration account
Get-AzIntegrationAccountCertificate -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <certificate-name>
# Retrieve details of a specific map in an integration account
Get-AzIntegrationAccountMap -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <map-name>
# Retrieve details of a specific partner in an integration account
Get-AzIntegrationAccountPartner -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <partner-name>
# Retrieve details of a specific schema in an integration account
Get-AzIntegrationAccountSchema -ResourceGroupName <resource-group-name> -IntegrationAccountName <integration-account-name> -Name <schema-name>
{% endcode %} {% endtab %} {% endtabs %}
권한 상승
로직 앱 권한 상승과 동일:
{% content-ref url="../az-privilege-escalation/az-logic-apps-privesc.md" %} az-logic-apps-privesc.md {% endcontent-ref %}
포스트 익스플로잇
{% content-ref url="../az-post-exploitation/az-logic-apps-post-exploitation.md" %} az-logic-apps-post-exploitation.md {% endcontent-ref %}
{{#include ../../../banners/hacktricks-training.md}}