Management HA Out of Sync with an Over-Privileged API Account
Bluebird Retail runs an R81.20 management HA pair, primary mgmt-a and secondary mgmt-b. After a jumbo hotfix was installed on mgmt-a during a change window, mgmt-b shows "Out of sync" in SmartConsole and has not replicated for 41 days; the last successful policy install to the branch gateway was 12 days ago. In parallel, an automation team uses the Management API with an account holding "Superuser (Read/Write all)", and it publishes and installs policy to the branch gateway twice a day, which is why rule changes sometimes appear without a recorded change request. A managed service provider contractor needs to read logs and objects for one of the two domains hosted on the same server, but must not be able to change anything. Yesterday an administrator received "Operation failed: the database is locked by another session" while trying to publish, and the change window closed. The next window is in 48 hours, and the auditors want the HA pair healthy and the API access narrowed by then.
1. How would you restore management HA within 48 hours, and why would promoting mgmt-b be the wrong move?
Read the worked answer
Why not promote mgmt-b. It has been out of sync for 41 days, while policy was installed 12 days ago and the API account has been making daily changes. mgmt-b therefore holds a stale database. Promoting it would roll back roughly a month of object and rule changes and would leave mgmt-a as the stale node. The clean-looking option is the destructive one here.
Safe sequence in the window.
- Verify mgmt-a is healthy:
cphaprob statandcpstat mg, disk space on$FWDIRand/var/log, and no pending verification warnings. - Take a verified backup and an export of mgmt-a, and test that the export completes; keep both off-box.
- Confirm mgmt-b's version and jumbo level match mgmt-a. If they diverge, align them first – a version mismatch is a common root cause of the 41-day gap.
- Rebuild mgmt-b from the mgmt-a export (or re-initialize it as a secondary via
cpconfig), then re-establish SIC and let replication catch up. - Check HA state again and run a test policy install to a non-critical target before touching the branch gateway.
Watch-outs. Do not restore mgmt-b from its own old backup; do not run an export while a publish is in flight; and keep mgmt-a running throughout, since re-initializing the secondary does not require stopping the primary.
2. Redesign the API account and the contractor access. What permission profile would you build, and what would you verify before handing it over?
Read the worked answer
Replace Superuser with a purpose-built profile.
- For the automation account: a permission profile limited to the branch domain, allowing object and rule editing plus policy install, and read-only everywhere else. Remove "Read/Write all". If the automation only needs to publish at a fixed time, consider dropping install rights entirely and letting a human install.
- Scope the administrator to the relevant domain so a mistake cannot reach the other tenant.
- Use key or certificate-based authentication with a defined rotation, not a shared password, and give the account an owner in the object comment.
- For the contractor: a read-only profile that includes log and object read (Monitoring plus read-only policy view), assigned to the single domain. Do not give Superuser, and do not rely on the account being "trusted" – API calls do not bypass permissions, so a correct profile is real protection.
Verify before handover. Log in as each account and attempt a forbidden action (publish a rule, edit an object) to confirm the denial; check that the contractor cannot see the other domain; confirm the audit log records the API actions with the account name; and confirm session behaviour – the "database is locked" error is the automation and the GUI publishing at the same time, so stagger the automation's publish to a scheduled window and make it the only publisher at that moment.
3. The auditors ask how you will prevent a repeat of both problems. Propose controls that would have caught each one earlier.
Read the worked answer
For the HA drift.
- Alert on HA state: a daily check of
cphaprob stat/cpstat mgon both nodes, with the result shipped to the monitoring system, would have caught the state change within a day instead of 41. - Make jumbo hotfix installation a paired change: patch the secondary first, verify replication, then the primary, with the HA check in the change's exit criteria.
- Track replication lag as a metric, and treat any lag older than 24 hours as an incident, not a backlog item.
For the API over-privilege.
- Default to least privilege: no new automation account gets Read/Write all; a permission profile is part of the request ticket.
- Correlate every policy install with a change record. If an install arrives with no matching change, it raises an alert – this is exactly the gap that let changes appear "without a recorded change request".
- Review admin accounts and their profiles quarterly, including API keys, with an explicit expiry.
- Keep publish as a controlled step: one publisher at a time, and the "database is locked" error treated as a signal that two actors are racing, not as an inconvenience to click past.
Report to the auditors. State the detection time before and after each control. "We added an alert" is weak; "drift is now detected within one day and paged to the on-call engineer" is auditable.