Maintaining Inventory and Software Compliance
Operating a large fleet requires knowing what is installed where and whether each node complies with policy. This lesson explains Systems Manager Inventory and the data it collects, Resource Data Sync for aggregating inventory across accounts and Regions, Systems Manager Compliance including custom compliance types, the AWS Config rules that evaluate software on managed nodes, and AWS License Manager for commercial licence compliance.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the metadata types that Systems Manager Inventory collects, including custom inventory.
- Explain how Resource Data Sync aggregates inventory and compliance data for analysis with Athena and Quick Sight.
- Explain how Systems Manager Compliance reports patch, association and custom compliance.
- Describe how AWS Config uses managed node inventory to evaluate required and prohibited software.
- Explain how AWS License Manager tracks commercial licence usage with licence configurations and hard or soft limits.
Inventory Collection
Systems Manager Inventory collects metadata from managed nodes on a schedule through a State Manager association with the AWS-GatherSoftwareInventory document. Quick Setup can enable collection for all nodes in an organisation. The collected data types are listed below.
| Type | Examples |
|---|---|
| Applications | Installed packages and programs with versions and publishers |
| AWS components | Versions of the SSM Agent, CloudWatch agent and other AWS software |
| Network configuration | IP addresses, MAC addresses, DNS servers and gateways |
| Instance details | Operating system name and version, computer name, domain |
| Windows updates | Installed Windows updates (hotfixes) |
| Services | Windows services and their state |
| Files | Files in specified paths with sizes and modification times |
| Windows registry and roles | Registry keys and Windows server roles |
| Custom inventory | Any data the team defines, such as rack location or a licence key type |
Custom inventory is written as JSON files in a specific directory on the node or submitted with the PutInventory API, with a type name beginning Custom:. Inventory data can be queried in the console across nodes, for example to find every node with a vulnerable version of a library.
Resource Data Sync
Inventory is stored per account and Region. A Resource Data Sync sends inventory, patch compliance and association compliance data from an account and Region to a central S3 bucket, and syncs from many accounts and Regions can write to the same bucket, optionally using an organisation-wide sync. The bucket policy must allow Systems Manager to write, and the data can be encrypted with KMS. Once centralised, the data is queried with Amazon Athena, using an AWS Glue crawler or the schema that the sync creates, and visualised in Amazon Quick Sight. This is the standard answer to scenarios that ask for a central, queryable view of installed software across an organisation.
Report across the fleet
Systems Manager Compliance
Compliance shows whether managed nodes meet requirements, using three sources. Patch compliance comes from Patch Manager scans. Association compliance comes from State Manager association runs. Custom compliance comes from the PutComplianceItems API, which lets any process, such as a security scanner or a Lambda function, record compliance items of a custom type with a status and severity for a node. All three appear in the same view, are aggregated in Explorer and are included in Resource Data Sync, and changes in compliance status emit EventBridge events for alerting and remediation.
Which compliance source?
AWS Config Integration
When AWS Config records the resource type AWS::SSM::ManagedInstanceInventory, it keeps a configuration history of each node's inventory, so auditors can see when software was installed or removed. Config managed rules then evaluate the inventory, as listed below.
ec2-managedinstance-applications-required: every node has the listed applications, such as an endpoint protection agent.ec2-managedinstance-applications-blacklisted: no node has prohibited applications.ec2-managedinstance-platform-check: nodes run the expected platform and version.ec2-managedinstance-association-compliance-status-checkandec2-managedinstance-patch-compliance-status-check: association and patch compliance.ec2-instance-managed-by-systems-manager: every EC2 instance is a managed node.
Config rules add continuous evaluation, history and remediation. A non-compliant node can be remediated automatically by an SSM Automation runbook, for example by installing a missing agent, as described in the AWS Config module.
The table below summarises which tool answers which question.
| Question | Tool |
|---|---|
| What is installed on each node now? | Systems Manager Inventory |
| What is installed across all accounts, queryable with SQL? | Resource Data Sync with Athena |
| Which nodes are missing patches or failing associations? | Systems Manager Compliance |
| When did software change, and is it allowed? | AWS Config with managed instance inventory rules |
| Are we within our commercial software licence entitlements? | AWS License Manager |
Licence Compliance with AWS License Manager
Software compliance also means staying within the licences the organisation has bought for commercial software such as Microsoft Windows Server, SQL Server and Oracle Database. AWS License Manager tracks this with licence configurations, which define the counting model (vCPUs, cores, sockets or instances), the number of licences owned and whether the limit is hard or soft. A licence configuration is associated with AMIs, launch templates, CloudFormation templates or Service Catalog products, so that every instance launched from them is counted automatically. A hard limit blocks launches that would exceed the entitlement; a soft limit allows the launch and raises an alert.
License Manager uses Systems Manager Inventory to discover software installed on managed nodes, including on-premises servers, and applies automated discovery rules to count it against a licence configuration, which catches installations that did not come from a tracked AMI. With AWS Organizations, licence configurations are shared through AWS RAM and usage is reported centrally. License Manager also manages Dedicated Hosts through host resource groups for bring-your-own-licence software that is licensed per physical core or socket. License Manager alerts, published through EventBridge, can notify the licensing team or trigger a workflow when usage approaches the limit.
Finding and Removing Prohibited Software
After a vulnerability announcement, a security team must find every instance in 30 accounts running a specific version of a remote access tool, remove it, and ensure it never reappears.
-
Collect
Confirm that Inventory collection is enabled on all nodes through Quick Setup.
-
Find
Query the central Resource Data Sync bucket with Athena for the application name and version.
-
Prevent
Deploy the ec2-managedinstance-applications-blacklisted Config rule with the tool's name to all accounts through a conformance pack.
-
Remediate
Attach an automatic remediation that runs a runbook which uninstalls the package with aws:runCommand, and notify the security team through EventBridge.
A team wants a dashboard of installed application versions across all accounts and Regions, updated daily. Which combination of services provides it?
Show answer
Systems Manager Inventory on all nodes, a Resource Data Sync from each account and Region to a central S3 bucket, Amazon Athena to query the data and Amazon Quick Sight for the dashboard.
Exam Tips
Remember for the exam
- Inventory (AWS-GatherSoftwareInventory association) collects applications, AWS components, network, files, services, registry and custom data.
- Resource Data Sync aggregates inventory and compliance from many accounts and Regions into one S3 bucket for Athena and Quick Sight.
- Compliance combines patch, association and custom (PutComplianceItems) compliance.
- AWS Config rules such as ec2-managedinstance-applications-required and -blacklisted evaluate node software and can trigger SSM Automation remediation.
- AWS License Manager counts licence usage from AMIs, launch templates and discovered software; hard limits block launches, soft limits alert.