sample-aiml-security-assessment

Changes Since Last Assessment

After each assessment run, the framework compares each account’s results with that account’s previous run and writes a “Changes since last assessment” report next to the run’s main report. It shows which findings were resolved, which are still open, which regressed, which are new, and which no longer appear.

Table of Contents

What you get

For every account whose run completed, in the same folder as that run’s main report (<AssessmentBucket>/<account_id>/):

File What it is
security_assessment_changes_<YYYYMMDD_HHMMSS>.html Interactive page: summary counts, counts by assessment area, and a filterable table of findings by change
security_assessment_changes_<YYYYMMDD_HHMMSS>.csv The same results, one row per finding, with both runs’ details, statuses, and severities

The timestamp is when the current run’s results were saved, in UTC, so the name identifies the run it describes. Running the comparison again for the same two runs overwrites the file instead of adding another.

In single-account mode the build also writes a small run record, assessment_history_run_<execution_id>.json, after every run. It says whether the run’s Step Functions execution succeeded; see Which run is “the previous run”.

The first run of an account has nothing to compare with, so no changes report is written for it. Every later run gets one, including runs where nothing changed (“No changes since the last assessment”).

A sample page is in sample-reports/ (security_assessment_changes.html). It comes from a real run, compared with the run before it, and was anonymized together with the single-account sample report: account IDs, resource IDs, and resource names are synthetic placeholders, and the same resource has the same placeholder on both pages.

Changes since last assessment: summary counts and counts by area

Turning it on or off

The report is controlled by the EnableAssessmentHistory deployment parameter in both deployment/aiml-security-single-account.yaml and deployment/2-aiml-security-codebuild.yaml:

Value Effect
true (default) A changes report is written after each run
false The comparison is skipped; the build log says Changes report disabled (EnableAssessmentHistory=false)

The parameter reaches the build as the ENABLE_ASSESSMENT_HISTORY CodeBuild environment variable. Stacks created before the parameter existed don’t have the variable, and are treated as true. A change takes effect on the next build.

Findings CSVs are saved every run whatever the setting, so after turning the report back on, the next run compares with the most recent usable run, including runs made while it was off. Run records are written only while the setting is on, so runs made while it was off are judged by their files alone.

When it runs

The comparison runs in the CodeBuild post-build phase (buildspec.yml), after the run’s results are in the central AssessmentBucket:

It can’t fail an assessment run:

It reads only the findings CSVs already in the bucket and, in single-account mode, the run records. It does not modify the scanners, the AWS SAM templates, the Step Functions workflow, or the IAM roles.

Which run is “the previous run”

Runs are told apart by the Step Functions execution ID in each findings CSV’s name. Execution IDs are random, so runs are ordered by when S3 saved their files; a run’s time is its latest file’s time.

The previous run is the most recent usable run saved before the current run. A run is usable when:

Service selection. A service turned off with the deployment’s Enable*Assessment switches writes no CSV, so its CSVs aren’t required. Which services a run selected comes from:

A selected service with no CSV still makes a run incomplete. A run with all four services off (Responsible AI GRC and OWASP only) is usable.

Runs made before release 2.0.0 have no AWS Agent Registry CSV and no run record, so they are judged by their files: AWS Agent Registry counts as not selected in that run and isn’t compared, and checks added in 2.0.0 are listed as found in only one run.

What is compared

Only what ran in both runs is compared:

Check IDs that appear in only one run (for example, after upgrading the framework) are listed in the report as a note. Only scanner check IDs are counted; derived AISF IDs never are, because both runs use the same mapping.

AWS AI Security Framework (AISF) rows are absent from findings CSVs. The changes report derives them from each run’s compared findings with the main report’s aisf_mappings.py: only services selected in both runs and regions scanned in both runs contribute. Both runs use the current mapping, so a mapping update does not appear as a change in findings. An AISF control changes when one of its source checks changes.

The changes report retains a Global AISF row when that control has no regional source row in the account, so it can pair across runs even if unrelated regional checks appear. When the control has a regional source row, its regional AISF rows incorporate any account-wide source findings and its separate Global row is omitted. The main report folds account-wide findings into every regional key and suppresses the entire Global key when an account has regional keys, so a Global AISF row in the changes report can be absent from the main report. A regional AISF row in the changes report appears only where that control has a regional source row. When SM-18’s regional source rows disappear between otherwise comparable runs while Global SM-42 stays Failed in both, the old regional AISF-07 rows are No longer reported and the new Global AISF-07 row is New, because their Region keys differ. AISF-00 appears under Global only for an account without regional rows; otherwise each region’s AISF-00 names controls with no source there. Each mapped AISF control currently draws on one service, so a service not selected in both runs removes its controls from the comparison and a note names them.

If AISF rows cannot be derived, the other assessment areas are still compared and the report explains why in its notes. An unreadable derived row or a mapping error is named in a note while successfully derived controls remain in the comparison.

Change states

Previous run Current run Change
Failed Passed Resolved
Failed Failed Still open
Passed Failed Regressed
Not present, or N/A Failed New
Failed Not present No longer reported
Failed N/A No longer assessed

All other combinations have no Failed result in either run (for example, Passed → Passed or Passed → N/A) and are shown as Not failing.

Failed → N/A is not counted as resolved, because N/A also covers access-denied and unavailable-region results.

How findings are matched between runs

Rows are grouped by assessment area, Region, and Check_ID. The Finding title isn’t part of the group: many checks use one title when they fail and another when they pass or can’t be assessed (for example, SM-04 writes “GuardDuty Not Enabled”, “GuardDuty Enabled”, or “GuardDuty Check Error”). Some checks write one row per resource (for example, one row per IAM role), with the resource only in Finding_Details. Within a group, rows are paired in five steps: same title and details, same details with a new title, one row each, several rows against one summary row, and everything else left unpaired.

The five matching steps in detail 1. **Same title, identical details.** Rows with the same `Finding` and `Finding_Details` are paired. Then rows with the same `Finding` are paired if their details match once values that change on every run are blanked out: | Changing value | Written by | | --- | --- | | `(N days)` | AC-03 (and AG-17, mapped from it), AR-02 | | `N days ago` | FS-31 (and OW-09, mapped from it) | | `on YYYY-MM-DD`, `since YYYY-MM-DD` | BR-14, SM-02 | Only these values are blanked. Digits in general are not, because resource names contain digits. A test fails if a scanner starts writing another day count or date into `Finding_Details` without it being added to this list. 2. **Same details, new title.** Rows whose details match, blanked the same way, are paired even if the title changed (for example, a title renamed in a new release). 3. **One row each.** Two remaining rows are paired even if their title and details differ, if each is its run's only row in the group, or its run's only row with that title. If both are Failed and their details differ, the row shows as Still open and is marked "details changed" (see [Known limits](#known-limits)). 4. **Several rows and one summary row.** If one run has several Failed rows left and the other run's only row for the check isn't Failed (a Passed summary such as "All 3 models have network isolation enabled", or an N/A error row), each Failed row is paired with that row. Several Failed rows and a Passed summary show as Resolved; a Passed summary and several Failed rows show as Regressed. 5. **Everything else is unpaired**, and shows as New or No longer reported. A pair is made only when it's unambiguous: if two rows would pair with the same row in steps 1 and 2, none of them is paired. The CSV's `Match_Rule` column records which step paired each row (`exact`, `normalized`, `details`, `single-row`, `check-level`, or `unmatched`), so any result can be traced. A `check-level` summary row appears once for each row it's paired with. Repeated rows within a run are dropped first, with the same rule the main report uses.

Reading the report

The page uses the main report’s layout, styling, and light/dark setting (the choice carries over between the two reports).

The sidebar lists the main report and the changes CSV by file name. The links work when the files are in the same folder, for example downloaded together or copied with aws s3 sync; opening the page straight from the S3 console opens one file at a time. The main report has no link to a single finding: use its search box, for example with the Check ID.

The changes CSV

One row per compared finding, in these columns:

Column Contents
Account_ID The account
Assessment_Area bedrock, sagemaker, agentcore, agent-registry, agentic, responsible-ai-grc, owasp, or aisf
Region, Check_ID, Finding As in the findings CSVs
Change One of the change states above, including Not failing
Previous_Status, Current_Status Passed, Failed, N/A, or Not present
Previous_Severity, Current_Severity Each run’s severity (blank when not present)
Previous_Finding_Details, Current_Finding_Details Each run’s details (blank when not present)
Resolution, Reference From the current run, or the previous run when the finding is gone
Match_Rule exact, normalized, details, single-row, check-level, or unmatched
Previous_Execution_ID, Current_Execution_ID The two runs compared

A cell that starts with =, +, -, @, a tab, or a carriage return gets a leading ' so spreadsheet programs don’t run it as a formula; finding text can contain resource names chosen by anyone who can create resources.

Build log messages

Search the CodeBuild log for Changes report to find the comparison’s messages. If no changes report was written, the message says why.

All build log messages | Message | Meaning | | --- | --- | | `Changes report for account ` | Start of that account's comparison | | `Compared run (saved