Skip to content

Add sumologic_o365_audit_source resource#849

Open
vsinghal13 wants to merge 4 commits intomasterfrom
vsinghal-o365-app-reg-support
Open

Add sumologic_o365_audit_source resource#849
vsinghal13 wants to merge 4 commits intomasterfrom
vsinghal-o365-app-reg-support

Conversation

@vsinghal13
Copy link
Collaborator

@vsinghal13 vsinghal13 commented Feb 19, 2026

Description

Add support for O365 Audit Source with App Registration Authentication

Summary

This PR adds a new Terraform resource sumologic_o365_audit_source that enables collection of Office 365 audit logs using Azure AD App Registration authentication.

Changes

New Resource: sumologic_o365_audit_source

  • Collects Office 365 audit logs via the Office 365 Management Activity API
  • Supports Azure AD App Registration authentication with:
    • tenant_id - Azure AD tenant ID
    • client_id - Azure AD application (client) ID
    • client_secret - Azure AD client secret (marked as sensitive)
  • Configurable workload types:
    • Audit.Exchange - Exchange audit logs
    • Audit.AzureActiveDirectory - Azure AD audit logs
    • Audit.SharePoint - SharePoint audit logs
    • Audit.General - General audit logs
    • DLP.All - Data Loss Prevention logs
  • Supports Office 365 deployment regions:
    • Commercial - Commercial cloud
    • GCC - Government Community Cloud
    • GCC High - Government Community Cloud High

HTTP Source Enhancements

Extended the HTTPSource struct to support third-party references with new types:

  • HTTPThirdPartyRef - Container for third-party resource configurations
  • HTTPResource - Resource configuration with service type, path, and authentication
  • HTTPPath - Path configuration for O365 notification endpoints
  • HTTPAuthentication - Authentication configuration for App Registration

Bug Fix

Fixed base_url provider configuration to properly read from SUMOLOGIC_BASE_URL environment variable at runtime using schema.EnvDefaultFunc instead of os.Getenv().

Testing

  • Added comprehensive acceptance tests in resource_sumologic_o365_audit_source_test.go
  • Tests verify resource creation, updates, and proper handling of sensitive fields
  • Tests read credentials from environment variables:
    • SUMOLOGIC_TEST_O365_TENANT_ID
    • SUMOLOGIC_TEST_O365_CLIENT_ID
    • SUMOLOGIC_TEST_O365_CLIENT_SECRET
  • All tests passing ✅

Documentation

Added complete documentation at website/docs/r/o365_audit_source.html.markdown including:

  • 4 usage examples covering different workloads and regions
  • Prerequisites for Azure AD app registration setup
  • Import instructions
  • Complete argument and attribute reference

Check list

@vsinghal13 vsinghal13 requested review from a team and maimaisie as code owners February 19, 2026 20:51
@vsinghal13 vsinghal13 added the collection Item is related to data collection aspect of Sumo Logic. label Feb 19, 2026
@github-actions
Copy link

⚠️ Warning: Please update CHANGELOG.md with your changes.

@vsinghal13
Copy link
Collaborator Author

vsinghal13 commented Feb 20, 2026

    resource_sumologic_monitors_library_monitor_test.go:522: Step 2/2 error: Error running apply: exit status 1
        
        Error: ***"id":"7Z1J2-9ST0M-2CBV5","errors":[***"code":"permission:invalid_subject","message":"Invalid Subject.","detail":"One or more subjects does NOT exist!"***]***
        
          with sumologic_monitor.test,
          on terraform_plugin_test.tf line 3, in resource "sumologic_monitor" "test":
           3: resource "sumologic_monitor" "test" ***
        
--- FAIL: TestAccSumologicMonitorsLibraryMonitor_update (11.48s)

unrelated test failing cc @ashpaliwal

@vsinghal13 vsinghal13 force-pushed the vsinghal-o365-app-reg-support branch from 868cffd to 9c72296 Compare February 24, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

collection Item is related to data collection aspect of Sumo Logic.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants