Audit Trail si Logging - sebiboga/testlink-upgraded GitHub Wiki

Audit Trail ศ™i Activity Logging ๐Ÿ“‹

Ce este Audit Trail?

Audit Trail este un jurnal complet al FIECฤ‚REI acศ›iuni รฎn TestLink:

Audit Trail = Complete Action Log

Logheazฤƒ:
โ”œโ”€ Cine a fฤƒcut actiunea (User)
โ”œโ”€ Ce actiune a fost (Action)
โ”œโ”€ Pe ce a fost (Entity: Test, Plan, Requirement, etc)
โ”œโ”€ Cรขnd a fost (Timestamp)
โ”œโ”€ Ce s-a schimbat (Before/After values)
โ”œโ”€ Status (Success/Failure)
โ””โ”€ Details (IP, browser, etc)

De ce E Important?

Use Cases:

1. COMPLIANCE & AUDIT
   โ”œโ”€ "Cine a ศ™ters cerinศ›a REQ-050?"
   โ”œโ”€ "Cรขnd a fost creat bug-ul BUG-2024-0045?"
   โ””โ”€ Track responsibility

2. TROUBLESHOOTING
   โ”œโ”€ "Ce s-a schimbat รฎn ultimele 2 ore?"
   โ”œโ”€ "De ce test-ul nu mai merge?"
   โ””โ”€ Trace back changes

3. SECURITY
   โ”œโ”€ "Cine a accesat secrets/passwords?"
   โ”œโ”€ "Cine a modificat roluri?"
   โ””โ”€ Detect unauthorized access

4. ACCOUNTABILITY
   โ”œโ”€ "Cine a schimbat prioritatea?"
   โ”œโ”€ Track ownership
   โ””โ”€ Responsibility matrix

Ce Se Logheazฤƒ?

User & Role Actions

Logged:
โ”œโ”€ User created/deleted
โ”œโ”€ Password changed
โ”œโ”€ Role assigned/changed
โ”œโ”€ Permissions modified
โ””โ”€ Login attempts (success/failure)

Project Actions

Logged:
โ”œโ”€ Project created/edited/deleted
โ”œโ”€ Features enabled/disabled
โ”œโ”€ Build created/edited
โ”œโ”€ Platform added/removed
โ”œโ”€ Settings changed
โ””โ”€ Users added/removed from project

Test Case Actions

Logged:
โ”œโ”€ Test case created/edited/deleted
โ”œโ”€ Version created
โ”œโ”€ Linked to requirement/bug
โ”œโ”€ Status changed
โ”œโ”€ Priority changed
โ””โ”€ Assigned to tester

Test Plan & Execution

Logged:
โ”œโ”€ Test plan created/edited
โ”œโ”€ Test case added/removed from plan
โ”œโ”€ Test execution started
โ”œโ”€ Results recorded (PASS/FAIL/BLOCKED)
โ”œโ”€ Bug reported
โ”œโ”€ Notes added
โ”œโ”€ Re-execution on new build
โ””โ”€ Tester assignments

Requirement Actions

Logged:
โ”œโ”€ Requirement created/edited/deleted
โ”œโ”€ Status changed (Draft โ†’ Approved โ†’ Tested)
โ”œโ”€ Version created
โ”œโ”€ Test case linked/unlinked
โ”œโ”€ Coverage changed
โ””โ”€ Stakeholder updates

Integration Actions

Logged:
โ”œโ”€ Bug created in JIRA/Mantis/GitHub
โ”œโ”€ Issue linked with test
โ”œโ”€ Status synced
โ”œโ”€ Comments/notes added
โ””โ”€ Issue lifecycle tracked

Cum Se Acceseazฤƒ Audit Trail?

Metoda 1: Global Audit Log

Path: Administrare โ†’ Audit Trail / Activity Log

Vizualizezi: TOATฤ‚ activitatea din sistem
โ”œโ”€ Filtru by User
โ”œโ”€ Filtru by Entity (Test, Plan, Requirement, etc)
โ”œโ”€ Filtru by Action (Create, Edit, Delete)
โ”œโ”€ Filtru by Date Range
โ””โ”€ Search by keyword

Metoda 2: Entity-Level Audit Trail

Fiecare entitate are propriul audit log:

Test Case TC-050:
โ”œโ”€ Click pe "History" tab
โ””โ”€ Vezi toate modificฤƒrile pentru TC-050

Requirement REQ-201:
โ”œโ”€ Click pe "Audit Trail"
โ””โ”€ Vezi toศ›i utilizatorii care au modificat

Bug BUG-2024-0045:
โ”œโ”€ Click pe "Activity Log"
โ””โ”€ Vezi timeline complet

Metoda 3: User Activity Report

Administrare โ†’ User Activity Report

Raport pentru fiecare user:
โ”œโ”€ Actions performed this week/month
โ”œโ”€ Most active hours
โ”œโ”€ Last login
โ”œโ”€ Failed login attempts
โ””โ”€ Suspicious activity alerts

Exemplu: Audit Trail Entry

โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
AUDIT LOG ENTRY #45892
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Timestamp: 2024-02-12 14:23:45
User: maria.ionescu
Action: TEST_CASE_CREATED
Entity Type: Test Case
Entity ID: TC-050
Entity Name: Login cu email ศ™i parolฤƒ valide

Details:
โ”œโ”€ Title: "Login cu email ศ™i parolฤƒ valide"
โ”œโ”€ Prioritete: Critical
โ”œโ”€ Type: Functional
โ”œโ”€ Status: Ready
โ””โ”€ Linked Requirements: REQ-001, REQ-002

Changes Made:
โ”œโ”€ Created new test case
โ”œโ”€ Added 5 execution steps
โ”œโ”€ Set preconditions
โ””โ”€ Created version v1

IP Address: 192.168.1.100
Browser: Chrome 120 (Windows 10)
Session ID: sess_abc123def456

Status: SUCCESS
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

AUDIT LOG ENTRY #45893
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Timestamp: 2024-02-12 14:35:12
User: ion.popescu
Action: TEST_CASE_EXECUTION
Entity Type: Test Case
Entity ID: TC-050
Build: v1.5.0 RC2
Platform: Windows 10 + Chrome

Results:
โ”œโ”€ Status: PASS โœ…
โ”œโ”€ Duration: 5 minutes
โ”œโ”€ Platform: Windows 10 + Chrome 120
โ””โ”€ Notes: "Test completed successfully"

Changes Made:
โ”œโ”€ Recorded PASS result
โ”œโ”€ Set timestamp
โ”œโ”€ Saved metrics
โ””โ”€ Updated coverage

Status: SUCCESS
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

AUDIT LOG ENTRY #45894
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Timestamp: 2024-02-12 15:02:18
User: alexandra.dumitrescu
Action: REQUIREMENT_STATUS_CHANGED
Entity Type: Requirement
Entity ID: REQ-201
Entity Name: Transfer Bani รฎntre Conturi

Changes:
โ”œโ”€ Old Status: Draft
โ”œโ”€ New Status: Approved
โ”œโ”€ Changed by: alexandra.dumitrescu
โ”œโ”€ Reason: "All stakeholders approved"

Linked Tests:
โ”œโ”€ TC-050: PASS
โ”œโ”€ TC-051: PASS
โ”œโ”€ TC-052: BLOCKED (waiting fix)

Status: SUCCESS
โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Filtrare Audit Logs

Search Options:

1. By User:
   โ”œโ”€ "maria.ionescu"
   โ””โ”€ "All actions by Maria"

2. By Action Type:
   โ”œโ”€ TEST_CASE_CREATED
   โ”œโ”€ TEST_CASE_EXECUTED
   โ”œโ”€ REQUIREMENT_CHANGED
   โ”œโ”€ BUG_CREATED
   โ””โ”€ USER_LOGGED_IN

3. By Date Range:
   โ”œโ”€ Last 24 hours
   โ”œโ”€ Last 7 days
   โ”œโ”€ Last 30 days
   โ””โ”€ Custom range

4. By Entity:
   โ”œโ”€ Test Case: TC-050
   โ”œโ”€ Requirement: REQ-201
   โ”œโ”€ Project: Banking v1.5
   โ””โ”€ User: maria.ionescu

5. Keyword Search:
   โ”œโ”€ "password"
   โ”œโ”€ "delete"
   โ”œโ”€ "BUG-2024-0045"
   โ””โ”€ "failed"

Exemplu Filtrare:

Filtrare: 
โ”œโ”€ Entity: Test Case TC-050
โ”œโ”€ Date: Last 7 days
โ”œโ”€ Action: ALL

Rezultat:
โ”œโ”€ 2024-02-12 14:23: Created by maria
โ”œโ”€ 2024-02-12 14:35: Executed by ion โ†’ PASS
โ”œโ”€ 2024-02-12 15:10: Linked to REQ-201 by alexandra
โ””โ”€ 2024-02-13 09:00: Re-executed by vasile โ†’ PASS

Export & Reports

Export Audit Log:

Audit Trail โ†’ Export

Options:
โ”œโ”€ Format: PDF / Excel / CSV
โ”œโ”€ Date Range: Custom
โ”œโ”€ Include: All fields / Selected only
โ””โ”€ Download

Compliance Reports:

Administrare โ†’ Compliance Reports

Options:
โ”œโ”€ Access Log (who accessed what)
โ”œโ”€ Change Log (what was modified)
โ”œโ”€ User Activity (per user)
โ”œโ”€ Failed Actions (errors/blocks)
โ””โ”€ Sensitive Operations (deletes, permission changes)

Security & Privacy

Who Can View Audit Logs?

Admin: โœ… View ALL audit logs
Manager: โœ… View project-level logs
Tester: โŒ Limited (own executions only)
Viewer: โŒ No access

Sensitive Data in Logs:

Logged BUT Masked:
โ”œโ”€ Passwords: Never logged
โ”œโ”€ API Keys: Logged but masked (show only last 4 chars)
โ”œโ”€ Secrets: Logged but encrypted
โ””โ”€ Personal Data: Following GDPR rules

Retention Policy:

Audit Log Retention:

1 Year: Full detail logs
โ”œโ”€ All actions with timestamps
โ”œโ”€ User info
โ”œโ”€ IP addresses
โ””โ”€ Complete change history

1-7 Years: Archived logs
โ”œโ”€ Summary only
โ”œโ”€ User/Entity info
โ””โ”€ Reduced detail

7+ Years: Deleted
โ””โ”€ Per compliance rules

Real-World Example: Investigating Issue

SCENARIO: Bug introduced in v1.5.0 RC1, not in v1.4.0

INVESTIGATION:

Step 1: Find what changed
โ”œโ”€ Audit Trail โ†’ Entity: Test Case TC-050
โ”œโ”€ Date: 2024-02-08 to 2024-02-10
โ””โ”€ Found: "TC-050 updated by ion.popescu on 2024-02-08"

Step 2: See what changed
โ”œโ”€ Audit Entry shows: "Step 2 changed from X to Y"
โ””โ”€ Old value โ†’ New value

Step 3: Check when test executed with new version
โ”œโ”€ Test Execution on 2024-02-10 with v1.5.0 RC1
โ”œโ”€ Result: FAIL (was PASS before)
โ””โ”€ Platform: Windows 10 + Chrome

Step 4: Link to bug report
โ”œโ”€ Bug reported: 2024-02-10 14:35
โ”œโ”€ Related to: TC-050 failure
โ””โ”€ Cause: Step change by ion.popescu

CONCLUSION:
โ””โ”€ ion's change on 2024-02-08 broke TC-050 in v1.5.0
โ””โ”€ Needs investigation + fix

Best Practices

โœ… DO:

  • Review audit logs regularly (daily/weekly)
  • Archive old logs (compliance requirement)
  • Monitor sensitive operations (deletes, permission changes)
  • Investigate failed actions
  • Use logs for compliance audits
  • Alert on suspicious activity

โŒ DON'T:

  • Ignore audit logs
  • Delete audit logs
  • Disable logging
  • Share logs with unauthorized users
  • Use logs for finger-pointing

Audit Trail: Essential pentru compliance ศ™i troubleshooting! ๐ŸŽฏ