Box 'Abnormal user activity' rule (1139230c) can never raise an alert
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 70/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- yaml
- Lĩnh vực
- security
Hướng nghiên cứu
Đọc khối query: trong Solutions/Box/Analytic Rules/BoxAbnormalUserActivity.yaml (id 1139230c) và so sánh với bốn lỗi được liệt kê; KQL được đề xuất trong issue là một phần thay thế trực tiếp được khóa theo SrcUserUpn với baseline 14 ngày. Chạy lại đoạn BoxEvents tổng hợp từ báo cáo để xác nhận rằng người dùng burst được trả về và rằng những người dùng hoạt động mạnh ổn định thì không. Hoàn thành nghĩa là quy tắc đã cập nhật vượt qua kiểm tra KQL và kiểm tra lược đồ phát hiện của repo tại máy cục bộ. Lưu ý rằng người báo cáo đã đề nghị mở một PR, vì vậy hãy kiểm tra với họ trước khi bắt đầu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
The analytic rule Solutions/Box/Analytic Rules/BoxAbnormalUserActivity.yaml (id 1139230c-cf10-45db-b616-fed0d1415c05) can't raise an alert on any data:
- The baseline counts rows after the union (1 or 2 per user) instead of adding up events, then divides by 29 using whole numbers. The daily average is always 0, so
where EventsPerDay > TotalEventsHis never true. - The "last hour" parts have no time filter, so they count all 14 days. Both use
SourceName, which is the file or folder acted on, not the user. join ... on kwithk = 1on every row keeps only one user from the left side.- The comparison points the wrong way. With the counting fixed, it would alert on users who are quieter than usual, not on spikes.
To Reproduce
Paste this in front of the rule query in Log Analytics. It's one user with one event an hour for two weeks, then 500 events in the last hour. The rule returns nothing.
let BoxEvents = union
(range h from 2 to 335 step 1
| project EventEndTime = ago(1h * h), SrcUserName = 'Alice', SrcUserUpn = '[email protected]', SourceName = 'Roadmap.docx'),
(range i from 1 to 500 step 1
| project EventEndTime = ago(1m * (i % 50)), SrcUserName = 'Alice', SrcUserUpn = '[email protected]', SourceName = strcat('export-', i, '.csv'));
Expected behavior
An alert when a user's activity in the last hour is far above their usual level.
Suggested fix
This version compares each user's events in the last hour with their average over the previous 14 days, counting only hours in which they were active. It alerts when the last hour has at least 50 events and is more than three standard deviations above that average. It identifies the account by login rather than display name.
let lookback = 14d;
let recent = 1h;
let min_events = 50;
let baseline = BoxEvents
| where EventEndTime between (ago(lookback) .. ago(recent))
| where isnotempty(SrcUserUpn)
| summarize Events = count() by SrcUserUpn, bin(EventEndTime, 1h)
| summarize BaseAvg = avg(Events), BaseStdev = stdev(Events) by SrcUserUpn;
BoxEvents
| where EventEndTime > ago(recent)
| where isnotempty(SrcUserUpn)
| summarize EventsLastHour = count(), SrcUserName = take_any(SrcUserName) by SrcUserUpn
| join kind=leftouter baseline on SrcUserUpn
| extend BaseAvg = coalesce(BaseAvg, 0.0), BaseStdev = coalesce(BaseStdev, 0.0)
| where EventsLastHour >= min_events and EventsLastHour > BaseAvg + 3 * BaseStdev
| extend AccountName = tostring(split(SrcUserUpn, '@')[0]), UPNSuffix = tostring(split(SrcUserUpn, '@')[1])
| project SrcUserUpn, SrcUserName, AccountName, UPNSuffix, EventsLastHour, AvgEventsActiveHour = round(BaseAvg, 2)
I don't have a Sentinel workspace with Box data, so I tested it on the Kusto emulator with the solution's BoxEvents parser, using synthetic events:
- With the snippet above, it returns the user.
- A user with a normal baseline who downloads 500 files in an hour gets an alert.
- Three heavy users (40 to 200 events an hour, varying between half and one and a half times their usual rate), replayed at each hourly run over a week, got no alerts, both with a full 14 days of history and with less.
- It gives the same results whether the data is in
BoxEventsV2_CL,BoxEvents_CL, or both. - It passes the repo's KQL validation, detection schema and non-ASCII checks locally.
Expect some alerts for legitimate bulk activity: a first Box Drive sync, migrations, integration or service accounts, and new users with no history. The thresholds are a best guess without real Box data.
Happy to open a PR with this change if that would help.
- Ngôn ngữ chính
- HTML
- Star
- 6.3k
- Fork
- 3.9k
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 190
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/Azure-Sentinel
-
[Microsoft Exchange Security - Exchange On-Premises] Collector 8.0.0.0: [int] cast on MaximalSentinelPacketSizeMb causes rejected segments with Log Ingestion APICó thể đã có người làm @v-kasghosh đã nhận 5 ngày trước. Đang mởSolution
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Azure/Azure-Sentinel#15613 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
AI Agents - Orphaned Agents Query: False Positives Due to Missing IdentityInfo RecordsCó thể đã có người làm @v-utpalkumar đã nhận 4 ngày trước. Đang mởHunting
Azure/Azure-Sentinel#15637 · 1 bình luận · 2 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Microsoft Exchange Security - Exchange On-Premises] Documentation and minor issues found during migration to collector 8.0.0.0Có thể đã có người làm @v-kasghosh đã nhận 5 ngày trước. Đang mởSolution
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
Azure/Azure-Sentinel#15615 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Microsoft Exchange Security - Exchange On-Premises] IIS-IoCs instance fails with HTTP 400 after migration to Azure Monitor (stream Custom-ESIIISIoCs missing from connector DCR)Có thể đã có người làm @v-kasghosh đã nhận 5 ngày trước. Đang mởSolution
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 54/100
Azure/Azure-Sentinel#15614 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Microsoft Exchange Security - Exchange On-Premises] IIS-IoCs "CVE0DAY-Autodiscover" check always fails (unquoted date + unexpanded %SystemDrive%)Có thể đã có người làm @v-kasghosh đã nhận 5 ngày trước. Đang mởSolution
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
Azure/Azure-Sentinel#15612 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của Azure/Azure-Sentinel
Issue tương tự
-
module/jwt Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ballerina-platform/ballerina-library#9714 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Update: HTTP Headers Cheat SheetĐang mởACK_WAITING HELP_WANTED UPDATE_CS
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
OWASP/CheatSheetSeries#2977 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
affects-8.5 component/session severity/moderate sig/transaction type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày