Auto-Close Stale Test Results is a Configuration Compliance module that closes test results your third-party scanners have stopped reporting. Results for decommissioned or purged assets remain in your active lists when no new import updates them. You set the conditions in a configuration record, and matching results move to the Closed-Stale resolution, which reduces active test results and remediation tasks.
What the module changes in your test result data
Configuration Compliance does not calculate test results. It imports them from third-party integrations, so the application depends on those scans to refresh each record. When a scanner stops seeing an asset, because the asset was decommissioned or purged, its test results stop being refreshed. Without a cleanup rule, those results can stay open and inflate your counts.
The module also helps you reconcile the assets in your Configuration Management Database (CMDB) with what your scanners still report. With fewer open results, your teams have fewer remediation tasks to triage, and the open items left over are more likely to describe assets that still exist.
Terms you need before you configure the rule
Four terms appear on the configuration screens and in the condition builder. Learn what each one points to before you build a condition.
- Stale test result: an aged result that no scan has found, updated or detected for a significant period.
- Asset last scanned date: the Last configuration compliance scan date column on the Discovered Item table related to the test result. It records the latest time a third-party scanner scanned the asset.
- Last failed date: the Last seen column on the Test Results table, read when the Result field is set to failed.
- Test Results last found: the number of days since the scanner last found the test result again. The window for this value can be configured.
Which results the rule can close
The rule acts on test result detections that match the filter conditions you set and that were detected by a supported third-party scanner integration. Results that fail the condition stay as they are, and so do results that came from other sources. The feature supports the Qualys vulnerability integration and the Tenable.io integration. Check that your scanner feeds fall into that group before you plan around the rule.
How Closed-Stale differs from a scanner closure
Matching results receive the value Closed-Stale in the Resolution field. That value marks the result as closed by the auto-close feature. A result that a scanner closed carries Closed or Fixed-Closed instead. Filter on the Resolution value when you report on closed results so the two groups stay separate.
How states roll up to remediation tasks
A remediation task groups test results, and its state follows theirs. The precedence order for test result states runs from Open, then Closed, then Fixed-Closed, and finally Closed-Stale. The roll-up rules work like this:
- If any test result in the task is Open, the task state does not change.
- If at least one test result is Closed – Fixed and the rest are Closed-Stale, the task moves to Closed – Fixed.
- If all test results in the task are Closed-Stale, the task moves to Closed – Canceled.
Names changed in v14.9 of Configuration Compliance. Test Result Group is now Remediation Task, Group Rules is now Remediation Task Rules, and Policy is now Test group. Match these names to the screens on your release. For how the tasks are worked once their state changes, see remediation in Configuration Compliance.
Plan the rule before you touch the configuration
Start with an inventory. List the third-party integrations that import test results into Configuration Compliance and confirm which of them are in the supported group. Then list the asset types those integrations scan. Retired servers and cloud instances may leave scanner output on different schedules, so one window may not suit each asset type. Build one record per asset group when the windows differ. If your team also reviews calculator outputs, see Configuration Compliance calculator rules.
Next, decide what should happen to results in the In-review and Deferred states. Those states usually represent work your team has already scheduled. Decide whether a closed-stale result should override that work. The answer determines how you set the deferred-result option, and the people who own the work should agree to it before the first run.
Configure an Auto-Close Stale Test Results record
Creating the record requires the sn_vulc.admin role. The steps below cover each field on the form.
- Navigate to All > Configuration Compliance > Administration > Auto-Close Stale Test Results.
- Enter a value in the Name field. Choose a name that shows the window and the scanner.
- Select Active when you want the record to close matching results. A cleared Active box leaves the record in place without closing anything.
- Set Ignore stale TRs for deferred TRs. When selected, test results mapped to the In-review or Deferred states are ignored and not closed. When cleared, any test results that match your criteria close.
- Leave Execution order at 100 unless you need a different place in the sequence. Records run in ascending order of this value.
- Enter a Description. It helps you find the record again when you have several.
- Build the Condition in the condition builder. The default filter is Discovered Item > Last scan.
- Click Submit.
For help planning this work, see ServiceNow implementation.
Build the condition and choose a look-back window
The condition decides which results close on each run, so it needs careful attention. Start with the default filter. It reads Discovered Item > Last scan, which is the date a third-party scanner last scanned the related asset. If that date is out of date for a group of assets, their results can match the condition and close. Check the date on a sample before you rely on it.
Consider a configuration item with two asset IDs, where one ID has not come through a third-party import for 90 days. A condition that closes results not found or updated in 90 days or more would close the matching results for that asset ID. The 90-day figure is an example of the setup, not a recommended window.
Choose the window from two inputs: how often your scanners run, and how long a retired asset normally stays in scanner output. A window shorter than your scan cycle can close results for assets that are still in scope, so set it longer than a normal gap between scans.
What the daily job does to matching results
The scheduled job named Auto-Close Stale Test Results runs daily. It identifies the test results that match the conditions of each active record and moves them into the closed state, with the Resolution field set to Closed-Stale.
Closed-Stale is not a permanent exit. If the scanner finds a Closed-Stale result again, the result reopens and returns to Open. If the scanner later reports the result as fixed, with Resolution Fixed, the result moves to Closed with Resolution Fixed. Results with Result Pass stay Closed with Resolution Fixed.
Checks to run after you activate the rule
Run these checks on the first cycle, and again whenever you change a condition.
- Open the record and confirm that the Active box, the Condition and the Execution order match your plan.
- Before you select Active, compare a sample of the test results the condition selects with the assets in your CMDB.
- After the next daily run, filter test results on the Resolution value Closed-Stale and compare the count with the count you expected.
- Check remediation tasks where all test results are Closed-Stale. They should show the state Closed – Canceled.
- Confirm that the deferred-result option matches how your team handles In-review and Deferred results.
Why a stale result stays open
When a result you expected to close remains open, work through these causes in order. Start with the roll-up. A single open result holds its remediation task in the current state, even when the other results on that task have closed.
- The condition does not match the result. Compare the Discovered Item scan date and the Test Results last found value for that result with your window.
- The result is in the In-review or Deferred state, and Ignore stale TRs for deferred TRs is selected.
- The result came from an integration the feature does not support.
- The record is not Active.
If the result is still open after these checks, record its state, its Discovered Item scan date and the current condition before you change anything.
Questions about closing stale results in Configuration Compliance
How long should the look-back window be?
Pick a window longer than the normal gaps between scans in your environment, and shorter than the period you are willing to keep retired assets in your active lists.
Should I activate a new record right away?
Usually not. Save the record with Active cleared, check which results the condition returns, and select Active after the counts look right. That order gives you a chance to correct the condition before the daily job acts on it. When you sign off the change, the policy and compliance management testing and acceptance checklist gives you a structure for the sign-off.
Who should own the record after it is created?
Name someone who holds the sn_vulc.admin role, because that role is required for the procedure. That person should review the Closed-Stale count after each run and keep the record’s condition, window and change date in a note that the next administrator can read.
What should I record before I change a condition?
Write down the number of results the current condition matches, the Execution order of the record, and the date of the change. With those three values, you can measure what the new condition does on the next daily run.