Merge pull request #1843 from osnabrugge/renovate/main-ghcr.io-buroa-… #368
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Content to logs [e9f91fbc-6845-4bf1-b1ba-66cd624f8685] | |
# Note: This workflow will deploy everything in the root directory. | |
# To deploy content only from a specific path (for example SentinelContent): | |
# 1. Add the target path to the "paths" property like such | |
# paths: | |
# - 'SentinelContent/**' | |
# - '!.github/workflows/**' | |
# - '.github/workflows/sentinel-deploy-e9f91fbc-6845-4bf1-b1ba-66cd624f8685.yml' | |
# 2. Append the path to the directory environment variable below | |
# directory: '${{ github.workspace }}/SentinelContent' | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- '**' | |
- '!.github/workflows/**' # this filter prevents other workflow changes from triggering this workflow | |
- '.github/workflows/sentinel-deploy-e9f91fbc-6845-4bf1-b1ba-66cd624f8685.yml' | |
jobs: | |
deploy-content: | |
runs-on: windows-latest | |
env: | |
resourceGroupName: 'rg-logs' | |
workspaceName: 'logs' | |
workspaceId: '841bc73b-bbf7-4a29-be51-b05f3169b575' | |
directory: '${{ github.workspace }}' | |
cloudEnv: 'AzureCloud' | |
creds: ${{ secrets.AZURE_SENTINEL_CREDENTIALS_e9f91fbc68454bf1b1ba66cd624f8685 }} | |
contentTypes: 'AnalyticsRule,AutomationRule,HuntingQuery,Parser,Playbook,Workbook' | |
branch: 'main' | |
sourceControlId: 'e9f91fbc-6845-4bf1-b1ba-66cd624f8685' | |
rootDirectory: '${{ github.workspace }}' | |
githubAuthToken: ${{ secrets.GITHUB_TOKEN }} | |
smartDeployment: 'true' | |
steps: | |
- name: Login to Azure (Attempt 1) | |
continue-on-error: true | |
id: login1 | |
uses: azure/login@v2 | |
if: ${{ env.cloudEnv == 'AzureCloud' }} | |
with: | |
creds: ${{ secrets.AZURE_SENTINEL_CREDENTIALS_e9f91fbc68454bf1b1ba66cd624f8685 }} | |
enable-AzPSSession: true | |
- name: Wait 30 seconds if login attempt 1 failed | |
if: ${{ env.cloudEnv == 'AzureCloud' && steps.login1.outcome=='failure' }} | |
run: powershell Start-Sleep -s 30 | |
- name: Login to Azure (Attempt 2) | |
continue-on-error: true | |
id: login2 | |
uses: azure/login@v2 | |
if: ${{ env.cloudEnv == 'AzureCloud' && steps.login1.outcome=='failure' }} | |
with: | |
creds: ${{ secrets.AZURE_SENTINEL_CREDENTIALS_e9f91fbc68454bf1b1ba66cd624f8685 }} | |
enable-AzPSSession: true | |
- name: Wait 30 seconds if login attempt 2 failed | |
if: ${{ env.cloudEnv == 'AzureCloud' && steps.login2.outcome=='failure' }} | |
run: powershell Start-Sleep -s 30 | |
- name: Login to Azure (Attempt 3) | |
continue-on-error: false | |
id: login3 | |
uses: azure/login@v2 | |
if: ${{ env.cloudEnv == 'AzureCloud' && steps.login2.outcome=='failure' }} | |
with: | |
creds: ${{ secrets.AZURE_SENTINEL_CREDENTIALS_e9f91fbc68454bf1b1ba66cd624f8685 }} | |
enable-AzPSSession: true | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Deploy Content to Azure Sentinel | |
uses: azure/powershell@v2 | |
with: | |
azPSVersion: 'latest' | |
inlineScript: | | |
${{ github.workspace }}//.github/workflows/azure-sentinel-deploy-e9f91fbc-6845-4bf1-b1ba-66cd624f8685.ps1 |