Ferritaas Incident Intelligence
Defect Intelligence Report Bug 0891109 Severity: Medium (P3)

Ansible fortinet.fortios Collection Idempotency Failure on Address Groups

The FortiOS REST API returns firewall address group members in non-deterministic internal object sequence, causing the Ansible fortinet.fortios collection to detect false state drift and issue redundant PUT updates on every playbook run.

Technical Root Cause Analysis

In automated NetDevOps pipelines, Ansible relies on strict idempotency: if the state defined in an infrastructure playbook matches the running configuration on the firewall, the execution must return changed: false. The fortinet.fortios.fortios_firewall_addrgrp module performs this validation by fetching the existing address group configuration via the CMDB REST API and calculating a JSON diff against the user's YAML specification.

In FortiOS 7.2.1 through 7.2.5, the CMDB API endpoint returns address group member lists ordered according to internal database allocation slots rather than alphabetical string sorting. When Ansible receives the response, it compares the unordered member array against the YAML list. Because array element positions differ, Ansible assumes an unauthorized configuration change has occurred and issues an HTTP PUT request to update the group. Every unnecessary PUT causes a configuration commit, generates a new revision checksum, and forces the FortiOS kernel to recompile policy lookup indices for all firewall policies referencing the group, generating high CPU spikes and breaking FortiManager sync status.

TASK [fortinet.fortios.fortios_firewall_addrgrp : Manage Corporate DMZ Group] ********************** changed: [fgt-edge-01] => { "changed": true, "diff": { "before": {"member": [{"name": "Server_DB_02"}, {"name": "Server_DB_01"}]}, "after": {"member": [{"name": "Server_DB_01"}, {"name": "Server_DB_02"}]} } } [httpsd 6109] [api] PUT /api/v2/cmdb/firewall/addrgrp/Corporate_DMZ -> commit 200 OK [fcnfg] firewall addrgrp 'Corporate_DMZ' modified: checksum recalculated (0x9bf41a -> 0x9bf41b) [kernel] firewall policy cache re-evaluated for 48 policies referencing 'Corporate_DMZ'

Affected Firmware & Blast Radius Matrix

Component Vulnerable Builds Confirmed Clean Build Status & Workaround
Ansible Collection fortinet.fortios < 2.3.4 v2.3.4+ Upgrade collection or apply sort filter
FortiOS 7.2 7.2.1 – 7.2.5 7.2.6+ Canonical API member sorting enabled
FortiOS 7.4 7.4.0 7.4.1+ Native alphabetical sorting active

Platform Impact: Affects all enterprise environments managing firewall address objects and groups via Ansible automation pipelines.

Step 01: Free Verification CLI (Safe Read-Only)

Run these diagnostic commands to verify current address group member ordering, check configuration checksum stability, and monitor REST API mutations:

Diagnostic Commands

# 1. View firewall address groups and current member ordering
show firewall addrgrp

# 2. Check local system configuration checksum to verify commit drift
diagnose sys checkum fgt

# 3. View address group configuration checksum specifically
diagnose sys checkum cfg-system firewall.addrgrp

# 4. Monitor real-time REST API mutations to catch repeated unnecessary PUTs
diagnose debug application httpsd -1
diagnose debug enable

Remediation & Workaround Steps (Teaser Preview)

Review the complete idempotency restoration and collection upgrade guide inside the Ferrite interactive platform:

Step 02: Audit Ansible Playbook Group Declarations & Collection Version

Identify playbooks declaring unsorted member lists and verify local ansible-galaxy collection list versions.

🔒 Interactive CLI Available in Ferrite Runbook #12

Step 03: Implement Lexicographical Member Sorting Filter in Automation

Inject alphabetical Jinja2 sort filters into Ansible tasks to guarantee identical JSON payloads across executions.

🔒 Interactive CLI Available in Ferrite Runbook #12

Step 04: Verify Checksum Stabilization & Inhibit Redundant Re-Indexing

Execute test playbook runs to confirm changed=0 status and verify that policy caches remain undisturbed.

🔒 Interactive CLI Available in Ferrite Runbook #12
⚡ Ferrite Platform Superpowers

Execute the Complete Runbook with Live Browser Automation

Connect to your FortiGate via browser console (Web Serial) or jumpbox SSH bridge, verify configuration checksum stability in real time, generate automated playbook sanitization scripts, and generate TAC P3 evidence dossiers.

Live Browser Automation Direct terminal connection with real-time checksum tracking.
📟
1-Click Tera Term (.ttl) Instant script generation for verifying air-gapped appliances.
🛡️
Zero-Trust Scrubber Strips private IPs, admin credentials, and tokens locally.
📄
TAC Escalation Dossier Standardized evidence export with SHA-256 seal.

Frequently Asked Questions

What causes Bug 0891109?

The FortiOS API returns address group members sorted by internal memory index. Ansible compares this to the playbook's list, misinterprets the different sequence as an unauthorized change, and sends redundant update requests.

Does repeated address group updating cause network disruption?

While data forwarding continues, each update triggers CPU spikes from kernel policy re-evaluations and invalidates FortiManager synchronization checksums.

Which release permanently resolves Bug 0891109?

The fortinet.fortios Ansible Galaxy collection v2.3.4+ and FortiOS 7.2.6/7.4.1+ resolve the issue by enforcing alphabetical member sorting.