INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Topic lessonTopic: CloudWatch, CloudTrail, Config and incident investigation

CloudTrail vs AWS Config: activity records and configuration history

CloudTrail helps investigate who or what requested an operation; AWS Config helps examine how a recorded resource was configured. An activity record alone does not establish current configuration, and configuration history alone does not identify a human actor. Follow one security-group change to see how the two records complement each other.

What you will learn

Choose the appropriate evidence, align subject, timestamps and collection conditions, and explain what activity and configuration differences establish.

Prerequisite

Know AWS resources, accounts, Regions and security-group permission rules. No AWS account is needed. Read fixed documentation examples; this page does not receive real logs or change AWS settings.

Choose activity evidence or configuration evidence

Choose evidence from the question; this is not a log-delivery path
Choose evidence from the question; this is not a log-delivery path1: Your question — Investigate activity — CloudTrail. 2: Your question — Investigate configuration — AWS Config12Your questionCloudTrailAWS ConfigChoose evidence from the question; this is not a log-delivery path1: Your question — Investigate activity — CloudTrail. 2: Your question — Investigate configuration — AWS Config12Your questionCloudTrailAWS Config
  1. Your question → CloudTrailInvestigate activity
  2. Your question → AWS ConfigInvestigate configuration
Your question
Actor and action, or resource configuration?
CloudTrail
Read the recorded action, identity and outcome.
AWS Config
Read recorded configuration, relationships and history.
The services answer different questions
QuestionPrimary evidenceNot established by that evidence alone
Which credentials requested an operation?Relevant CloudTrail events, including action and outcome.Conclusive human identity, current configuration or application effects.
How was this resource configured earlier?AWS Config records and history for the resource in scope.Every point in time, the acting identity or successful traffic.
Did application responses or errors change?Metrics and application logs aligned by subject and time.Activity/configuration records alone do not establish every aspect of health.

CloudTrail records activity by users, roles and AWS services. Config records configuration and relationships for supported resources in scope. Neither replaces every other source of evidence. Combine the required records and retain gaps as unknowns.

Read a Config configuration item

A configuration item (CI) is a Config record for a resource. Inspect its identity, configuration, relationships and recording time. Similar-looking security-group names in different accounts, Regions or resource IDs do not identify the same comparison subject.

Identify the purpose of each field
CheckExample CI fieldInterpretation
Same subject?accountId / awsRegion / resourceType / resourceIdAlign account, Region, resource type and ID.
What configuration?configurationResource-specific configuration; the API represents it as a JSON-encoded string.
Related resources?relationshipsRelationships recorded in this CI, not a complete application-dependency model.
When recorded?configurationItemCaptureTimeWhen recording of configuration changes was initiated; not the API-operation timestamp.
What record status?configurationItemStatusA status for configuration update, discovery or deletion; OK does not mean secure or healthy.

Do not rely on a CI’s relatedEvents as an automatic CloudTrail join. The documented field is empty from version 1.3 onward. Empty does not establish that no operation occurred. Correlate the required events separately by subject, time and content.

Fixed example: adding 8080 alongside 443

Read B1 records by time; arrows show reading order
Read B1 records by time; arrows show reading order1: C1: 10:00 UTC — Read the next record — T1: 10:02 UTC. 2: T1: 10:02 UTC — Compare the later configuration — C2: 10:06 UTC12C1: 10:00 UTCT1: 10:02 UTCC2: 10:06 UTCRead B1 records by time; arrows show reading order1: C1: 10:00 UTC — Read the next record — T1: 10:02 UTC. 2: T1: 10:02 UTC — Compare the later configuration — C2: 10:06 UTC12C1: 10:00 UTCT1: 10:02 UTCC2: 10:06 UTC
  1. C1: 10:00 UTC → T1: 10:02 UTCRead the next record
  2. T1: 10:02 UTC → C2: 10:06 UTCCompare the later configuration
C1: 10:00 UTC
Config records an inbound TCP 443 permission.
T1: 10:02 UTC
Stipulated successful request to add 8080.
C2: 10:06 UTC
Config records inbound TCP 443 and 8080.
B1: compare the request with before/after configuration
RecordStipulated contentInterpretation
C1 / Config10:00 UTC record: allow inbound TCP 443 from 192.0.2.0/24.The earlier record includes 443.
T1 / CloudTrail-side record10:02 UTC: a successful AuthorizeSecurityGroupIngress operation adds TCP 8080.Read action and outcome; success is a given, not inferred from the action name.
C2 / Config10:06 UTC record: allow inbound TCP 443 and 8080 from the same source.The difference is added 8080; 443 remains.

CloudTrail eventTime is when the request completed; Config configurationItemCaptureTime is when recording of configuration changes was initiated. The 10:02-to-10:06 interval is neither a four-minute delivery guarantee nor measured change duration. In actual investigation, correlate subject, request, outcome and configuration rather than joining by nearby timestamps alone.

When a record is missing, check collection conditions

Before concluding that nothing changed
CheckWhat to establish
SubjectCorrect account/Region/resource ID? Is this resource type recorded?
Start and operationWhen did recording start? Is the relevant recorder operating with required permissions?
FrequencyContinuous or Daily? Do another recorder or resource-specific conditions affect coverage?
Retrieval scopeRequired interval, destination and read access? Could recording or delivery still be pending?

Continuous records configuration changes continuously. Daily provides the latest state over the previous 24-hour period when it differs from the preceding CI. A→B→A changes therefore cannot be read as a complete per-change sequence from Daily records. Continuous also does not guarantee that every record appears without delay.

A configuration recorder performs recording. Customers manage the scope of a customer managed recorder; a linked AWS service controls a service-linked recorder’s scope. Stopping one does not establish that all account recording has stopped. This lesson stops or changes neither.

Separate recording, rule evaluation and remediation

Separate recorded facts, evaluation criteria and actions
Separate recorded facts, evaluation criteria and actions1: Configuration record — When evaluating a configured rule — Selected-rule evaluation. 2: Selected-rule evaluation — When remediation is also configured and run — Remediation action12ConfigurationrecordSelected-ruleevaluationRemediation actionSeparate recorded facts, evaluation criteria and actions1: Configuration record — When evaluating a configured rule — Selected-rule evaluation. 2: Selected-rule evaluation — When remediation is also configured and run — Remediation action12ConfigurationrecordSelected-ruleevaluationRemediationaction
  1. Configuration record → Selected-rule evaluationWhen evaluating a configured rule
  2. Selected-rule evaluation → Remediation actionWhen remediation is also configured and run
Configuration record
Inspect resource configuration and recording time.
Selected-rule evaluation
Read scope, criteria, evaluation time and result.
Remediation action
Check separately configured action, access and outcome.

A Config rule evaluates a resource against configured desired conditions. Read COMPLIANT within that rule’s scope, criteria and evaluation time. It differs from CI OK and is not a declaration that no vulnerability exists. Recording, evaluation and current resources require separate checks.

When a rule reports NON_COMPLIANT, inspect which condition differs rather than assuming it was fixed. Config remediation uses separately associated actions such as Systems Manager Automation. Manual/automatic configuration, permissions, target and execution results need review; an evaluation label does not prove successful remediation.

Check what the evidence establishes

Choose an option to see the result and explanation.

Which evidence primarily helps investigate earlier security-group rules?
Read the answer and reason

Answer: Config configuration history for the same resource · Compare the same resource’s records over time, while checking collection and retrieval scope.

B1 C1 contains TCP 443; C2 contains TCP 443 and 8080. What changed?
Read the answer and reason

Answer: 8080 was added and 443 remains · Read the set difference: it does not show 443 removal or successful communication.

T1 is at 10:02 and C2’s recording time is 10:06. What follows?
Read the answer and reason

Answer: Interpret each time and correlate subject, content and outcome · Separate request completion from recording initiation; proximity alone does not establish causation.

A transient change is absent from Daily history. Does that prove no change occurred?
Read the answer and reason

Answer: No; check recording scope, frequency, operation and retrieval · Unavailable evidence differs from no change; Continuous also has conditions such as possible delays.

A CI has configurationItemStatus=OK. What does this establish alone?
Read the answer and reason

Answer: A configuration-update status; overall security is separate · Read it as CI status, separately from rule evaluation and application checks.

A change request records AccessDenied. Which reading is justified?
Read the answer and reason

Answer: Read a denied request and inspect actual configuration separately · Investigate the operation result separately from configuration and other activity.

A Config rule is NON_COMPLIANT. Does that prove automatic remediation completed?
Read the answer and reason

Answer: No; inspect remediation configuration, permissions and execution · Evaluation and action are distinct; establish that the required action was configured, run and successful.

Check, then explain in your own words

  1. Select CloudTrail or Config evidence from the question.
  2. Read B1 for the same resource and explain addition, timestamps and collection scope.
  3. Check the distinction between recording, evaluation and remediation.
Check your understanding: Someone says “we have both CloudTrail and Config records.” What should you align?

Align account/Region/resource ID, action and outcome, timestamp meanings, before/after configuration, and collection scope/frequency.

Activity, configuration, evaluation and actual functionality require distinct evidence.

Sources and conditions checked

The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.