فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

docs(holoo): gate dedicated read-only identity rollout on approval

Davood Mehraban committed Nov 22, 2026 at 22:16 UTC 81c54c32a021b79a5973413938451fcb5eee6c9c
2 files changed +44
docs/holoo-lab-readonly-identity-plan.md new
+32
@@ -0,0 +1,32 @@
1 +# Holoo disposable LAB: dedicated read-only SQL identity — execution HOLD
2 +
3 +Status: **DESIGN ONLY / NO-GO**. This document is not authorization to run DDL, GRANT, DENY, CREATE LOGIN, or to change any Holoo database. Do not run against Holoo1, Holoo6, or any production/restore reference.
4 +
5 +## Scope and prerequisites
6 +
7 +- SQL instance: `ARAM\TNC` (SQL Server 2008 R2 Express); sole target database: `HolooBackup_050808_LAB_20261110`.
8 +- Preserve the existing `ARAM\Davood` owner login and all existing Holoo permissions unchanged.
9 +- Provision a **dedicated non-admin Windows identity** with a documented owner and secure credential management. The current scripts use Integrated Security; changing a connection string alone cannot change the Windows security token. Run the process under the dedicated identity or use a separately reviewed credential broker.
10 +- Before any provisioning: explicit approval, verified recoverable LAB backup, inventory of existing server/database principals and grants, and a tested rollback. Record operator, time, evidence, and change ticket.
11 +- Verify this identity is not in `sysadmin`, `securityadmin`, `db_owner`, `db_datawriter`, `db_ddladmin`, or other inherited server/database roles with elevated capabilities; no `CONTROL SERVER`, `CONTROL DATABASE`, `ALTER`, `EXECUTE`, `IMPERSONATE`, or ownership chaining privilege that would allow mutation.
12 +- SQL Server 2008 R2 does not provide a reliable security boundary merely by setting `ApplicationIntent=ReadOnly`.
13 +
14 +## Proposed permissions (not executable commands)
15 +
16 +1. Create/map only the dedicated identity in the disposable LAB database, with no server-wide administrative roles or default broad database roles.
17 +2. Grant the minimum `CONNECT` and `SELECT` on `dbo.FACTURE`, `dbo.FACTART`, and `dbo.SANAD` only; do not grant `db_datareader` broadly.
18 +3. Inspect all effective permissions and inherited group memberships, including public, guest, Windows groups, database ownership, and server roles. The existing gate tests common roles and object DML, but is not a complete SQL Server privilege proof.
19 +4. Execute permission audit and all three fixed counts under the **same dedicated Windows identity**. Compare against a fresh read-only structural audit; record login and database user evidence.
20 +5. Perform negative tests for DML/DDL only in a separately approved isolated fixture, never against live Holoo or the verified LAB data. Prefer inspection of effective permissions without issuing writes.
21 +6. Keep the production write gate NO-GO; read-only acceptance does not imply invoice-write authorization.
22 +
23 +## Rollback / abort criteria
24 +
25 +- Before change, record principal/grant snapshots and verify the LAB restore point. Abort if snapshot/backup or approval is missing.
26 +- Rollback is scoped to removing only newly introduced LAB user grants and the newly introduced dedicated principal after confirming no other dependency. Never revoke permissions from `ARAM\Davood` or other existing identities.
27 +- Abort on any elevated inherited role, unexpected database, inconsistent counts, unverified principal, or permission audit `BLOCKED`. Preserve audit logs and do not automatically retry with an admin identity.
28 +
29 +## Current evidence
30 +
31 +- Current `ARAM\Davood` maps to `dbo`, has `db_owner` and object DML privileges; the read-only gate correctly blocks it.
32 +- The dedicated identity has **not** been provisioned or tested. SQL writes and permission changes performed in this phase: **zero**.
tests/holoo-lab-identity-plan.test.mjs new
+12
@@ -0,0 +1,12 @@
1 +import test from 'node:test';
2 +import assert from 'node:assert/strict';
3 +import { readFileSync } from 'node:fs';
4 +import { fileURLToPath } from 'node:url';
5 +const path=fileURLToPath(new URL('../docs/holoo-lab-readonly-identity-plan.md',import.meta.url));
6 +test('identity rollout remains approval-gated, isolated, and reversible',()=>{
7 + const plan=readFileSync(path,'utf8');
8 + for(const required of ['DESIGN ONLY / NO-GO','HolooBackup_050808_LAB_20261110','ARAM\\TNC','Integrated Security','explicit approval','rollback','ARAM\\Davood','same dedicated Windows identity','production write gate NO-GO']) assert.ok(plan.includes(required),required);
9 + assert.ok(plan.includes('**not** been provisioned or tested'));
10 +});
11 +
12 +