Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing some documentation for setup - "GitHub Action using Workload identity federation (recommended)" #494

Open
michaelmsonne opened this issue Oct 12, 2024 · 1 comment

Comments

@michaelmsonne
Copy link
Contributor

As written about with @merill in 1:1, we are missing more steps to have the complete guide here: https://maester.dev/docs/monitoring/github#set-up-the-github-actions-workflow

Some parts for connecting to EXO and so on is missing in the GitHub Action information for "GitHub Action using Workload identity federation (recommended)" as EXO was added after GitHub.

How to set it to connect to EXO also - as when I test this flow (and from what I can see it the sample), it´s only connect to Entra ID...

@CSIUser01
Copy link

I'm getting the same issue with it only connecting to Entra ID. I took a shot at writing what it needs to be but this is somewhat out of depth so I'm not certain it would work but maybe it gives someone a start...
.......Starting from the 'jobs: entry......
jobs:
run-maester-tests:
name: Run Maester Tests and Connect to Exchange Online
runs-on: ubuntu-latest
steps:
# Step 1: Run Maester action
- name: Run Maester action
uses: maester365/maester@main
with:
client_id: ${{ secrets.AZURE_CLIENT_ID }}
tenant_id: ${{ secrets.AZURE_TENANT_ID }}
include_public_tests: true # Optional: Set to false if you are keeping to a certain version of tests or have your own tests
step_summary: true # Optional: Set to false if you don't want a summary added to your GitHub Action run
artifact_upload: true # Optional: Set to false if you don't want summaries uploaded to GitHub Artifacts
# Other inputs are available and can be reviewed in the action.yml in the Maester repository

# Step 2: Connect to Exchange Online
- name: Install Exchange Online Management Module
  run: |
    pwsh -Command "Install-Module -Name ExchangeOnlineManagement -Force -AllowClobber"

- name: Authenticate to Exchange Online
  run: |
    pwsh -Command |
      $ExchangeSession = Connect-ExchangeOnline -Organization ${{ secrets.EXCHANGE_ORGANIZATION_NAME }} `
                                                -AppId ${{ secrets.EXCHANGE_APP_ID }} `
                                                -CertificateThumbprint ${{ secrets.EXCHANGE_CERT_THUMBPRINT }} `
                                                -TenantId ${{ secrets.AZURE_TENANT_ID }};
      Import-PSSession $ExchangeSession -DisableNameChecking;
  env:
    AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
    # Ensure EXCHANGE_ORGANIZATION_NAME, EXCHANGE_APP_ID, and EXCHANGE_CERT_THUMBPRINT are stored in your GitHub secrets.

# Additional steps can be added here to perform actions in Exchange Online

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants