跳到主要内容
版本:v1.2.1

Example: security tagging review

Goal: before a security review or an incident exercise, find resources with no owner, no environment or no data classification.

You need: read-only credentials.

This checks tags only. It does not assess how securely anything is configured, and passing it does not make you compliant with any framework.

Template​

The built-in security-baseline tag policy requires:

Tag keyRule
OwnerAny value
Environmentprod, staging, dev, test or sandbox
DataClassificationpublic, internal, confidential or restricted

Command​

Terminal
inventag --template standard-bom --template security-baseline \
--create-excel --create-word --account-regions us-east-1

Output​

Output
inventag - WARNING - - No account specification method provided. Using default AWS credentials.
Wrote bom_output/tag_compliance_20261112_090000.json
Wrote bom_output/multi_account_bom_20261112_090000.docx
Wrote bom_output/multi_account_bom_20261112_090000.xlsx
Tag policy 'security-baseline': 1 of 23 resources compliant (4.3%), 22 non-compliant, 14 out of scope.

Sheets: Summary, ATHENA, DYNAMODB, EC2, EVENTS, IAM, KMS, LAMBDA, S3, VPC, Tag Compliance

Tag Compliance sheet, first rows:

AccountRegionServiceTypeResourceARNStatusMissing tagsProblems
123456789012us-east-1DYNAMODBTableacme-ordersarn:aws:dynamodb:us-east-1:123456789012:table...Non-compliantDataClassification
123456789012us-east-1EC2Instanceacme-web-1arn:aws:ec2:us-east-1:123456789012:instance/i...Non-compliantDataClassification
123456789012us-east-1EC2Volumeacme-build-cachearn:aws:ec2:us-east-1:123456789012:volume/vol...Non-compliantOwner, Environment, DataClassification
123456789012globalIAMRoleacme-orders-api-rolearn:aws:iam::123456789012:role/acme-orders-ap...Non-compliantOwner, Environment, DataClassification

Filter the "Missing tags" column for Owner to find unowned resources first.

Next steps​

  • Agree owners for the unowned resources, then tag them in your infrastructure code.
  • Narrow the check to data stores only:
.inventag/templates/data-stores.yaml
format_version: 1
kind: tag-policy
name: data-stores
description: Classification on data stores only
extends: security-baseline
spec:
scope:
services: [S3, DYNAMODB, RDS]