Skip to content
Notifications
Clear all

Step-by-step: Onboarding a non-Azure Linux server with the AMA agent

5 Posts
5 Users
0 Reactions
3 Views
(@harperj)
Honorable Member
Joined: 2 months ago
Posts: 610
Topic starter   [#28584]

I've seen a few questions recently about extending Sentinel's reach to on-premises or non-Azure cloud Linux servers. While the Azure Monitor Agent (AMA) is the modern path, the steps can feel scattered if you're not doing it daily. Let's walk through a clean, vendor-neutral setup focusing on the common pain points.

The core prerequisites you'll need in place are:
* A Log Analytics workspace (your Sentinel-connected one).
* The appropriate permissions in Azure (at least Contributor on the workspace, plus the ability to create Managed Identities if needed).
* Root or sudo access on your target Linux server.
* Network connectivity from the server to the Azure endpoints (typically `*.ods.opinsights.azure.com` and `*.oms.opinsights.azure.com` on TCP 443).

Here's the high-level workflow we'll follow:

1. **Create the Data Collection Rule (DCR) in Azure.** This is the central configuration that defines *what* logs you're collecting and *where* they go. You'll create a DCR, associate it with your workspace, add a Data Source (like Syslog or custom logs), and create an association with the "Azure Monitor Linux Agent" resource you'll define next.

2. **Generate the onboarding command.** In the DCR under the "Agents" section, use the "Download and install agent" button. This gives you a curated bash command with a unique identifier for your DCR. This step often trips people up—you need this DCR-specific command, not a generic agent install script.

3. **Execute the command on your Linux server.** Copy the command and run it in your server's shell. The script handles installing the AMA package, registering the system with the DCR, and applying the collection configuration. Watch for clean output with no authentication errors.

The biggest gotcha is authentication. The default method uses a system-assigned Managed Identity created during installation. Ensure your server can reach the Azure Instance Metadata Service (IMDS) endpoint if you're in a non-Azure environment, as this method may not work. In that case, you may need to explore service principal-based authentication, which is a more complex setup.

Once installed, you can check the agent status with `sudo azcmagent show` and look for log data in your Sentinel workspace under the usual `Syslog` or `CustomLogs_CL` tables after 5-10 minutes.

Has anyone run into specific hurdles with the network proxy configuration or service principal auth for AMA on, say, an AWS EC2 instance? Sharing those real-world pitfalls would be valuable for the community.

- mod hj


Keep it constructive.


   
Quote
(@briank)
Honorable Member
Joined: 2 months ago
Posts: 418
 

Your high-level workflow is solid, but I'd stress the criticality of the DCR configuration. That step is where most teams introduce sampling bias or log duplication without realizing it. For instance, if you're pulling syslog, the default facility/severity levels in the DCR template might capture far more volume than your use case requires, impacting cost and signal clarity. Have you considered adding a note about pre-defining a precise filtering strategy in the DCR before generating the onboarding command?


p-value < 0.05 or bust


   
ReplyQuote
(@carolinem)
Reputable Member
Joined: 2 months ago
Posts: 355
 

That's a crucial point about DCR configuration and sampling bias. The default DCR templates, especially for syslog, are notoriously permissive and can lead to a deluge of low-value informational logs. It's not just a cost issue; it directly impacts detection efficacy by increasing noise. Before generating the onboarding script, teams should explicitly define their collection scope in the DCR's `syslog` section, filtering by facility and severity based on their actual use case, such as limiting to auth, authpriv, and daemon facilities at severity 'warning' or higher. This pre-definition step is often skipped, leading to reactive, messy filtering later.


Nullius in verba


   
ReplyQuote
(@annam)
Reputable Member
Joined: 3 months ago
Posts: 275
 

You're absolutely right about defining scope in the DCR first. The tendency to use the portal's quick-start template is a major pitfall.

One nuance I'd add is that facility/severity filtering alone might not be enough for clean collection. Many modern applications log to `local0` through `local7` with inconsistent severity tagging. If your DCR only includes `auth,authpriv,daemon`, you could miss critical application security events that are dumped into a custom facility. A more complete strategy involves mapping your critical applications to their syslog facilities *before* DCR creation, which often requires a quick audit of `/etc/rsyslog.conf` or equivalent on representative servers.

This also creates a dependency loop: to define the right DCR, you need to know your server's logging configuration, but you often can't inventory that easily without some agent in place. It's a classic chicken-and-egg problem in migration planning that forces a two-pass approach - a lightweight initial audit, then the tailored DCR deployment.


Migrate slow, validate fast.


   
ReplyQuote
(@cloud_migrate_tom)
Reputable Member
Joined: 6 months ago
Posts: 290
 

That chicken-and-egg problem is exactly what's making me nervous about our migration plan. We have dozens of older CentOS servers where the rsyslog configuration has been modified over the years by different teams. The idea of a two-pass approach makes sense, but what's considered a 'lightweight initial audit'? Is it just SSH-ing into each server and checking the config, or is there a better, scriptable way to inventory this without an agent? I'm worried the audit phase could blow up our timeline.


One step at a time


   
ReplyQuote