Skip to content

[PM-41866] [server] add event logging for attachment downloads - #8190

Open
vlad-trofimov wants to merge 1 commit into
bitwarden:mainfrom
vlad-trofimov:main
Open

[PM-41866] [server] add event logging for attachment downloads#8190
vlad-trofimov wants to merge 1 commit into
bitwarden:mainfrom
vlad-trofimov:main

Conversation

@vlad-trofimov

Copy link
Copy Markdown

🎟️ Tracking

This is related to https://bitwarden.atlassian.net/browse/PFI-824

📔 Objective

Attachment interactions on vault items can be a critical action in regulated environments where organizations need a full audit trail of who accessed sensitive files and when. Today, Cipher_AttachmentCreated (1103) and Cipher_AttachmentDeleted (1104) are logged, but downloads are not. This leaves a gap in the event history for compliance reviews. This PR introduces a new event, Cipher_AttachmentDownloaded (1133), emitted server-side from CipherService.GetAttachmentDownloadDataAsync whenever a user requests the signed download URL for an attachment.
Because the server issues the URL, the event cannot be bypassed by a modified client - distinguishing it from client-reported Cipher_Client* events. Attachment metadata already flows on sync, so this signal is limited to genuine user-initiated download actions and won't inflate the event table with sync noise.

📸 Screenshots

Screenshot 2026-08-11 at 12 36 54 PM

@vlad-trofimov
vlad-trofimov requested review from a team as code owners August 11, 2026 19:39
@bitwarden-bot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We've added this to our internal tracking system for review.
ID: PM-41866
Link: https://bitwarden.atlassian.net/browse/PM-41866

Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process.

@bitwarden-bot bitwarden-bot changed the title [server] add event logging for attachment downloads [PM-41866] [server] add event logging for attachment downloads Aug 11, 2026
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.65%. Comparing base (6244dfc) to head (98e284e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8190      +/-   ##
==========================================
- Coverage   63.89%   63.65%   -0.25%     
==========================================
  Files        2359     2366       +7     
  Lines      102319   102728     +409     
  Branches     9240     9320      +80     
==========================================
+ Hits        65378    65388      +10     
- Misses      34714    35113     +399     
  Partials     2227     2227              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants