madankgit opened a new issue, #38187:
URL: https://github.com/apache/superset/issues/38187

   ### Bug description
   
   While querying user-level auditing using the logs table, we observed that 
dashboard_id and slice_id are NULL.
   
   For REST API-based actions such as:
   
   - DashboardRestApi.put
   - DashboardRestApi.delete
   - ChartRestApi.put
   - ChartRestApi.post
   - ChartRestApi.delete  etc.,,
   
   the corresponding object identifiers are not being populated in the logs 
table.
   
   Although the action column correctly records the type of operation 
performed, the related object IDs remain NULL. As a result, it is not possible 
to determine which specific dashboard or chart was modified.
   
   ``` 
   SELECT 
       l.id AS log_id, 
       u.username AS user,
       l.action AS action_type,
       l.dashboard_id,
       l.slice_id,
       l.dttm AS timestamp
   FROM logs l
   LEFT JOIN ab_user u ON l.user_id = u.id
   
   ```
   
   <b></b>
   **Database Connection Used**
   
   - Metadata Database: PostgreSQL
   - Purpose: Stores Superset metadata including dashboards, charts, users, 
roles, and logs
   - Table Referenced: logs
   - Access Method: Direct SQL query against the Superset metadata database
   
   
   <img width="1886" height="812" alt="Image" 
src="https://github.com/user-attachments/assets/5f94cd8a-d414-4b2e-a43b-976df3843910";
 />
   
   <b></b>
   **Observed Behavior**
   
   - User actions are logged correctly.
   - dashboard_id and slice_id columns are NULL for dashboard/chart 
modification actions.
   - There is no alternative structured reference in the logs table to identify 
the affected object.
   
   <b></b>
   **Expected Behavior**
   
   - dashboard_id should be populated for dashboard-related changes.
   - slice_id should be populated for chart-related changes.
   - Alternatively, object identifiers should be logged in a structured format 
to support audit reporting.
   
   <img width="688" height="178" alt="Image" 
src="https://github.com/user-attachments/assets/0061d9d4-cafa-416c-bf27-fef63716e644";
 />
   
   <b></b>
   **Impact**
   
   This limits the ability to implement proper:
   - User-level audit tracking
   - Compliance reporting
   - Change history tracking
   - Governance and traceability controls
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [ ] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [ ] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [ ] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to