USB check-in / check-out audit, as a report rather than a paged list
CMMC removable-media tracking is an audit obligation, and answering "who had this drive, and when" meant paging through the check-in/out list by hand. GET /api/usb/reports/audit returns the events - a take and a return are separate rows, because a count cannot answer the question an audit actually asks - with summary figures riding along for the people who only want the shape of it, and a CSV for the people who want it in a spreadsheet. The window is named rather than a day count: today, last month, six months, a year, all time. Nobody should have to work out that a year is 365. Both directory modes answer in one voice. The external path reads the cmmc_usb checkinoutlog; self-hosted expands one usbcheckouts row into its two ends, so a returned drive is distinguishable from one still out, and the window filter runs in SQL against either end of the loan - a drive taken before the window and returned inside it is a check-in the window has to show. Rows come back from the mode-specific half; the CSV, the summary and the response shape are built once in the route. Ordering is total in both modes. Timestamp alone ties for two events in the same second, and the same query then returns them in a different order each run, which reads as the log being unstable.
This commit is contained in:
12
CHANGELOG.md
12
CHANGELOG.md
@@ -12,6 +12,18 @@ ADR-007 and ADR-002.
|
||||
|
||||
### Added
|
||||
|
||||
- **USB check-in / check-out audit report.** CMMC removable-media tracking is an
|
||||
audit obligation and there was no report for it - answering "who had this
|
||||
drive, and when" meant paging through the check-in/out list by hand. The
|
||||
window is named rather than a day count: today, last month, six months, a
|
||||
year, or all time. Events rather than totals, because that is the question an
|
||||
audit actually asks, with a CSV export for the people who want it in a
|
||||
spreadsheet. Works against the external `cmmc_usb` log or the self-hosted
|
||||
tables; in self-hosted mode one stored loan expands into a take and a return,
|
||||
so a returned drive is distinguishable from one still out.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **USB kiosk: check a drive out and back in without a login.** The people who
|
||||
actually take USB drives are standing at the cabinet, and most of them have no
|
||||
ShopDB account - so check-out and check-in were gated behind a login that was
|
||||
|
||||
Reference in New Issue
Block a user