Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article describes context and troubleshooting steps for Azure Machine Configuration (MC) and Policy scenarios which rely on OSConfig for Linux. For example, as of this writing the following built-in policy definitions are powered by MC and OSConfig.
- Linux machines should meet requirements for the Azure compute security baseline
- Nexus Compute Machines should meet Security Baseline
- Audit SSH security posture for Linux (powered by OSConfig)
- Configure SSH security posture for Linux (powered by OSConfig)
For more information about Machine Configuration, see Understanding Azure Machine Configuration
Policy stages and artifacts
The end-to-end flow from policy assignment to compliance reporting includes several stages. Artifacts (ARM objects in Azure or logs on machines) are created during each stage. In a troubleshooting mindset, the presence or absence of these artifacts can indicate which stages have completed. The contents of these logs and ARM objects can provide insight into unexpected outcomes.
| Stage | Action | Artifacts |
|---|---|---|
| 1 | Admin creates Azure Policy assignment, which connects a policy definition to a scope. For example, assigning "Audit SSH security posture..." to "my_resource_group" | Azure Policy assignment structure |
| 2 | Azure Policy periodically identifies machines which are in scope for the assignment, and creates a guestConfigurationAssignment for each |
guestConfigurationAssignments |
| 3 | MC agent on machine (if installed) downloads and invokes the MC package called for by the guestConfigurationAssignment |
- Package downloads: /var/lib/GuestConfig/Configuration- Logs: /var/lib/GuestConfig/gc_agent_logs/gc_agent.log or /var/lib/GuestConfig/arc_policy_logs/gc_agent.log |
| 4 | The OSConfig-powered package audits and/or remediates OS settings, returning results to MC agent | /var/log/osconfig* |
| 5 | MC Agent and service populate the reuslts to AssignmentReport in Azure |
AssignmentReport |
| 6 | Reporting experiences build on the AssignmentReports. | For example, - Policy assignment compliance view, which shows the number of compliant machines, and so on. - Guest Assignment view (list of rules with status for specific machine) - Azure Resource Graph queries |
Capturing agent logs and other artifacts from a machine
The following example illustrates gathering all MC and OSConfig artifacts from a machine for analysis elsewhere.
sudo tar --create --gzip --file "mc_osc_data_$(date +%F_%H%M%S).tar.gz" --ignore-failed-read {/var/log,etc/osconfig}/osconfig* /var/lib/GuestConfig/Configuration /var/lib/GuestConfig/{gc_agent_logs,arc_policy_logs}/gc_agent.log
Related resources
- For assistance contact Microsoft Support
- To provide feedback, discuss feature requests, contact: linux_sec_config_mgmt@service.microsoft.com