Back to CI/CD Pipeline
Q23Question 23 of 56

AWS Systems Manager (SSM) versus Patch Manager: broad fleet management versus OS/application patching

Key Concepts
  • Systems Manager (SSM) is a broad operations-management service: Run Command, Session Manager, Parameter Store, Inventory, State Manager, and Automation.
  • Patch Manager is one feature inside SSM, specialized for applying OS and application patches using baselines and maintenance windows.
  • The SSM Agent polls outbound over HTTPS, so no inbound ports need to be opened: Session Manager gives shell access without SSH keys.
  • Parameter Store holds configuration and KMS-encrypted secrets; the application reads them at startup instead of hardcoding credentials.
  • Patch baselines define which patches are approved; patch groups tag instances to a baseline; maintenance windows schedule when patching runs.
  • Patch Manager depends on SSM being set up first: the agent, the instance role, and connectivity to SSM endpoints.

Definition

Systems Manager is the whole operations toolbox for your fleet; Patch Manager is the one tool in that box that keeps the fleet patched on approved rules during approved windows.
  • Systems Manager (SSM) – a broad operations-management service providing one control plane over EC2 instances, on-premises servers, and other managed nodes.
  • Run Command – execute scripts remotely across many nodes at once.
  • Session Manager – shell access without SSH keys or open inbound ports.
  • Parameter Store – configuration values and KMS-encrypted secrets in a hierarchy.
  • Inventory – collect software metadata from all nodes.
  • Patch Manager – one feature inside SSM that applies OS/application patches using patch baselines (which patches are approved) and maintenance windows (when patching may run).

At National Bank of India, imagine Systems Manager is the entire facilities department for every branch. That department can unlock any door remotely (Session Manager), send a work order to every branch at once (Run Command), keep a master equipment list (Inventory), store shared keys in a locked cabinet (Parameter Store), and run repair procedures (Automation). Patch Manager is one specialist team inside that department whose only job is keeping the locks and alarms up to date, following an approved list and fixed off-hours windows.

Understanding the Concepts

What is AWS Systems Manager?

AWS Systems Manager (SSM) is a broad operations-management service that gives you a single control plane over a fleet of EC2 instances, on-premises servers, and other managed nodes. It bundles many capabilities under one service.

DIAGRAM
 Systems Manager capabilities:

 ┌──────────────────────────────────────────────────┐
 │              AWS Systems Manager                   │
 │                                                    │
 │  ┌──────────────┐  ┌──────────────┐               │
 │  │ Run Command  │  │ Session Mgr  │               │
 │  │ (scripts)    │  │ (shell, no   │               │
 │  │              │  │  SSH keys)   │               │
 │  └──────────────┘  └──────────────┘               │
 │  ┌──────────────┐  ┌──────────────┐               │
 │  │ Parameter    │  │  Inventory   │               │
 │  │ Store        │  │ (metadata)   │               │
 │  │ (config +    │  │              │               │
 │  │  secrets)    │  │              │               │
 │  └──────────────┘  └──────────────┘               │
 │  ┌──────────────┐  ┌──────────────┐               │
 │  │ State Mgr    │  │ Automation   │               │
 │  │ (drift fix)  │  │ (runbooks)   │               │
 │  └──────────────┘  └──────────────┘               │
 │  ┌──────────────┐                                  │
 │  │ Patch Manager│  ◀── One feature inside SSM     │
 │  │ (baselines + │                                  │
 │  │  windows)    │                                  │
 │  └──────────────┘                                  │
 └────────────────────────────────────────────────────┘

How does the SSM Agent work?

The SSM Agent is a small program on each managed node that polls the Systems Manager service for instructions over HTTPS outbound. Because it polls outbound, no inbound ports need to be opened.

BASH
# The node needs:
# 1. SSM Agent installed (pre-installed on Amazon Linux, Ubuntu AMIs)
# 2. IAM instance profile with AmazonSSMManagedInstanceCore policy
# 3. Outbound HTTPS to SSM endpoints

# Verify the agent is running
sudo systemctl status amazon-ssm-agent
JSON
// IAM instance profile policy for SSM
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": [
      "ssm:UpdateInstanceInformation",
      "ssmmessages:CreateControlChannel",
      "ssmmessages:CreateDataChannel",
      "ec2messages:GetMessages"
    ],
    "Resource": "*"
  }]
}

How does Run Command work?

Run Command lets you execute a script across many nodes at once, with output captured to S3 or CloudWatch Logs.

JAVA
package com.bank.ops;

import software.amazon.awssdk.services.ssm.SsmClient;
import software.amazon.awssdk.services.ssm.model.*;
import java.util.List;
import java.util.Map;

public class FleetCommandRunner {

    private final SsmClient ssmClient;

    public FleetCommandRunner(SsmClient ssmClient) {
        this.ssmClient = ssmClient;
    }

    // Restart bank-api on all production instances
    public String restartService() {
        SendCommandResponse response = ssmClient.sendCommand(
            SendCommandRequest.builder()
                .documentName("AWS-RunShellScript")
                .targets(Target.builder()
                    .key("tag:Environment")
                    .values("prod")
                    .build())
                .parameters(Map.of("commands",
                    List.of("systemctl restart bank-api")))
                .build());
        return response.command().commandId();
    }
}

How does Session Manager replace SSH?

Session Manager gives you a shell on an instance in a private subnet with no bastion host, no SSH key, and no inbound security-group rule. All sessions are logged for audit.

BASH
# Start a session -- no SSH key, no open port 22
aws ssm start-session --target i-0abc123def456

# Session is logged to CloudWatch Logs or S3 for audit
# No bastion host needed, no SSH keys to rotate

How does Parameter Store work?

Parameter Store holds configuration values and secrets in a hierarchy, with optional KMS encryption for SecureString parameters.

JAVA
package com.bank.config;

import software.amazon.awssdk.services.ssm.SsmClient;
import software.amazon.awssdk.services.ssm.model.GetParameterRequest;

public class SecureConfigReader {

    private final SsmClient ssmClient;

    public SecureConfigReader(SsmClient ssmClient) {
        this.ssmClient = ssmClient;
    }

    // Read database password from Parameter Store instead of hardcoding
    public String getDatabasePassword() {
        return ssmClient.getParameter(
            GetParameterRequest.builder()
                .name("/bank/prod/db-password")
                .withDecryption(true)  // KMS decrypts the SecureString
                .build()
        ).parameter().value();
    }
}
BASH
# Store a secret
aws ssm put-parameter \
  --name "/bank/prod/db-password" \
  --type SecureString \
  --value "NBI_prod_secure_2024" \
  --key-id alias/bank-secrets-key

# Read it
aws ssm get-parameter --name "/bank/prod/db-password" --with-decryption

What is Patch Manager and how does it work?

Patch Manager is one feature inside Systems Manager, specialized for applying OS and application patches. It uses patch baselines, patch groups, and maintenance windows.

TEXT
 Patch Manager concepts:

 Patch Baseline:  Rules for which patches are approved
                  (security + critical, 7-day delay)

 Patch Group:     Tag that maps instances to a baseline
                  (tag: PatchGroup=bank-prod)

 Maintenance Window:  Scheduled time when patching runs
                      (Sunday 2:00 AM - 4:00 AM)
BASH
# Create a patch baseline for production
aws ssm create-patch-baseline \
  --name "bank-prod-baseline" \
  --operating-system AMAZON_LINUX_2023 \
  --approval-rules '{"PatchRules":[{"PatchFilterGroup":{"PatchFilters":[{"Key":"CLASSIFICATION","Values":["Security","Bugfix"]},{"Key":"SEVERITY","Values":["Critical","Important"]}]},"ApproveAfterDays":7}]}'
BASH
# Register a maintenance window
aws ssm create-maintenance-window \
  --name "bank-prod-patch-window" \
  --schedule "cron(0 2 ? * SUN *)" \
  --duration 2 \
  --cutoff 1

What is the difference between SSM and Patch Manager?

| Aspect | Systems Manager (SSM) | Patch Manager |
|--------|----------------------|---------------|
| Scope | Broad fleet management | OS/app patching only |
| Relationship | The whole toolbox | One tool in the toolbox |
| Examples | Run Command, Session Mgr, Parameter Store | Patch baselines, maintenance windows |
| Dependency | Standalone service | Depends on SSM agent, role, and connectivity |
| Use case | Restart services, read secrets, audit fleet | Apply security patches on approved schedule |

What are common mistakes with SSM and Patch Manager?

TEXT
# WRONG: trying to use Patch Manager without SSM setup
# Patch Manager depends on the SSM Agent, instance role, and endpoint connectivity
# If SSM is not working, Patch Manager cannot reach the nodes

# CORRECT: verify SSM works first, then configure Patch Manager
aws ssm describe-instance-information  # Confirm nodes are registered
# Then create baselines, patch groups, and maintenance windows
TEXT
# WRONG: patching production during business hours
# Patch operations can restart services and cause downtime

# CORRECT: schedule patching in maintenance windows during off-hours
# Sunday 2:00 AM - 4:00 AM for production
# Immediate for test environments

What should a senior engineer know?

The key distinction is that Systems Manager is the whole operations toolbox and Patch Manager is one specialized tool for compliance-driven patching. If someone asks you to restart a banking service across twenty servers, store a database password securely, or audit which servers run an outdated library, that is Systems Manager. If someone asks you to make sure every production server gets this month's critical security patches during the approved off-hours window, that is Patch Manager.

Visual Overview

DIAGRAM
 SSM vs Patch Manager Relationship
 ===================================

 ┌──────────────────────────────────────────────┐
 │          AWS Systems Manager (SSM)            │
 │                                               │
 │  ┌─────────────┐  ┌─────────────┐            │
 │  │ Run Command │  │ Session Mgr │            │
 │  └─────────────┘  └─────────────┘            │
 │  ┌─────────────┐  ┌─────────────┐            │
 │  │ Param Store │  │  Inventory  │            │
 │  └─────────────┘  └─────────────┘            │
 │  ┌─────────────┐  ┌─────────────┐            │
 │  │ State Mgr   │  │ Automation  │            │
 │  └─────────────┘  └─────────────┘            │
 │                                               │
 │  ┌─────────────────────────────────────────┐ │
 │  │           Patch Manager                  │ │
 │  │  ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
 │  │  │ Baseline │ │  Group   │ │ Maint.   │ │ │
 │  │  │ (rules)  │ │  (tags)  │ │ Window   │ │ │
 │  │  └──────────┘ └──────────┘ └──────────┘ │ │
 │  └─────────────────────────────────────────┘ │
 │                                               │
 │  Foundation: SSM Agent + IAM Role + HTTPS     │
 └──────────────────────────────────────────────┘

 Patch Manager Flow
 ===================

 Maintenance window opens (Sun 2 AM)
        │
        ▼
 SSM Agent checks patch baseline rules
        │
        ▼
 Approved patches identified
 (security + critical, 7-day delay)
        │
        ▼
 Patches applied to instances in patch group
        │
        ▼
 Compliance report generated

Key Takeaway

AWS Systems Manager is the broad operations-management service with many capabilities: Run Command for remote scripts, Session Manager for shell access without SSH keys, Parameter Store for encrypted configuration and secrets, Inventory for fleet metadata, and Automation for multi-step runbooks. Patch Manager is not a separate product: it is one feature inside SSM whose single job is applying OS and application patches using baselines and maintenance windows.

Patch Manager depends entirely on SSM being set up first: the SSM Agent must run on each node, the node must have the IAM role, and connectivity to SSM endpoints must exist. A patch baseline defines which patches are approved and how long to wait after release. A patch group maps instances to a baseline via tags. A maintenance window schedules when the disruptive patching is allowed to run.

At National Bank of India we moved the database password from a properties file into Parameter Store as a KMS-encrypted SecureString, used Session Manager for audited shell access without SSH keys, and configured Patch Manager with a conservative production baseline scheduled into a Sunday 2 AM window.

Remember one sentence: Systems Manager is the whole operations toolbox for your fleet, and Patch Manager is the one specialized tool inside it for keeping the fleet patched on approved rules during approved windows.

---

Share
Use ← → arrow keys to navigate