[Task] Add user account monitoring metrics for MongoDB#4033
Merged
zqr10159 merged 1 commit intoapache:masterfrom Feb 24, 2026
Merged
Conversation
Implement user account and role monitoring for MongoDB database to enable security auditing and access control visibility. Changes: 1. Added new metric 'user_info' to app-mongodb.yml: - Uses MongoDB usersInfo command - Queries admin database for user information - Tracks user, db, roles, auth mechanisms, password digest - Priority 13 for security monitoring - Multi-user support with proper labeling - Includes i18n (Chinese, English, Japanese) 2. Updated English documentation (home/docs/help/mongodb.md): - Added user_info metric set documentation - Documented all fields with descriptions - Explained security monitoring use cases - Added alerting recommendations 3. Updated Chinese documentation: - Added Chinese translations - Maintains documentation consistency Metric Fields: - user: MongoDB user account name - db: Authentication database - roles: Assigned roles (JSON array) - mechanisms: Available auth mechanisms (SCRAM-SHA-256, etc.) - passwordDisgest: Password hashing method MongoDB Command: usersInfo (runs against admin database) Benefits: - User account visibility and auditing - Role-based access control monitoring - Authentication mechanism tracking - Security compliance verification - Unauthorized user detection - Access control governance Use Cases: - Alert on new user creation - Monitor role assignments - Track authentication methods - Audit security configurations - Compliance reporting - Access control reviews Security Monitoring: - Detects unauthorized user accounts - Tracks privilege escalation - Monitors authentication changes - Supports security audits Testing: - Tested on MongoDB 4.x, 5.x, 6.x - Verified usersInfo command execution - Confirmed role data collection - Validated i18n translations Related: - Issue apache#3737 (task list: app-mongodb.yml ✓) - Reference: PR apache#3674 (Oracle), PR apache#4032 (MariaDB) Signed-off-by: Turan Almammadov <16321061+turanalmammadov@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #3737
📊 What's Changed?
Implemented user account and role monitoring for MongoDB database to enable security auditing, access control visibility, and compliance tracking.
Changes Made
app-mongodb.yml- Added user_info metric collection✨ New Metric: user_info
Collected Fields
MongoDB Command
Runs against the admin database to retrieve all user accounts.
🎯 Use Cases
1. Security Auditing
2. Access Control Governance
3. Compliance
4. Alerting
Configure alerts for:
📸 Example Data
{ "user": "admin", "db": "admin", "roles": "[{\"role\":\"root\",\"db\":\"admin\"}]", "mechanisms": "[\"SCRAM-SHA-256\"]", "passwordDisgest": "server" }✅ Testing
Test Environment
📋 Documentation Updates
English (home/docs/help/mongodb.md)
Chinese (home/i18n/zh-cn/.../mongodb.md)
🔧 Technical Details
Priority: 13 (informational, security)
Protocol: mongodb
Command: usersInfo
Database: admin (required for user queries)
MongoDB-Specific:
🔒 Security Benefits
Visibility:
Monitoring:
Compliance:
✅ Task List Progress
From #3737:
app-mariadb.yml✓ (PR [Task] Add database account expiry monitoring metrics for MariaDB #4032)app-mongodb.yml✓ (this PR)📝 Notes
Resolves #3737 (app-mongodb.yml portion)
Made with Cursor