Skip to content

IEBH-458: Add audit logs for VMs#12

Merged
vmoshynskyi merged 1 commit intomainfrom
IEBH-458
Nov 14, 2025
Merged

IEBH-458: Add audit logs for VMs#12
vmoshynskyi merged 1 commit intomainfrom
IEBH-458

Conversation

@vmoshynskyi
Copy link
Member

  • Add audit logs for VMs.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive audit logging to VM user management operations in the authentication service, bumping the version from 2.2.29 to 2.2.30. The changes implement audit trails for critical VM user operations to improve system accountability and security monitoring.

Key changes:

  • Import and integrate AuditLog context manager for VM user operations
  • Wrap four VM user management functions with audit logging

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
pyproject.toml Version bump to 2.2.30
app/config.py Update VERSION constant to match pyproject.toml (2.2.30)
app/routers/vm_account_management.py Add AuditLog import and wrap VM user operations (find_user, create_user, reset_password, create_or_modify_user) with audit log context managers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py0884%89–90, 92, 96, 98–101
__main__.py040%7, 9, 11–12
config.py00100% 
logger.py00100% 
commons/notification
   __init__.py00100% 
commons/project_services
   __init__.py00100% 
commons/psql_services
   invitation.py0865%18–21, 31–34
   ldap_id.py0940%16–24
   permissions.py012414%21–24, 26–28, 33–38, 43–44, 47–52, 57–63, 68–79, 84–89, 94–99, 107–116, 121, 129–134, 136–137, 139–146, 151–158, 163–167, 174–182, 186–193, 197–200, 202–212
   user_event.py01379%33, 40–43, 64–67, 77, 80–82
components
   __init__.py00100% 
   exceptions.py01374%23, 30, 37, 42, 53, 57, 61, 69, 73, 77, 85, 89, 93
components/identity
   __init__.py00100% 
   crud.py00100% 
   dependencies.py0183%17
components/keycloak
   __init__.py00100% 
   client.py0297%33, 96
   dependencies.py0471%24–25, 33, 35
   models.py00100% 
models
   api_response.py0292%34–35
   base_models.py0386%33–35
   default_roles.py00100% 
   events.py0392%36, 124, 131
   external.py00100% 
   invitation.py0589%22, 44, 47, 56, 62
   ops_admin.py00100% 
   ops_user.py00100% 
   permissions.py01775%46, 63–64, 74–77, 79, 81–82, 94–95, 102–104, 106–107
   permissions_schema.py00100% 
   sql_events.py00100% 
   sql_invitation.py00100% 
   sql_ldap_id.py0477%21–24
   user_account_management.py00100% 
   user_create.py00100% 
resources
   error_handler.py0195%33
resources/keycloak_api
   ops_admin.py05553%86–88, 146, 154–158, 160, 183, 191–196, 214, 232–233, 241–243, 245, 260–261, 269–272, 289–296, 316, 356–359, 372–374, 388–389, 404, 418, 421–425
   ops_user.py01142%15–16, 22–24, 27–28, 31–32, 35–36
routers
   api_registry.py00100% 
   ops_admin.py05377%90, 105–107, 161–166, 200–201, 206–208, 237–239, 263–267, 269–274, 276, 295–297, 299–305, 307–311, 313, 388–390, 394, 403–405
   ops_user.py02686%98–99, 103–104, 144–146, 268–270, 273, 329–331, 401, 406, 408, 410, 432–434, 438, 440, 479–481
   user_account_management.py02085%82–83, 89–93, 125–127, 157–159, 161–163, 201–203, 235
   vm_account_management.py03560%109–111, 128, 130–132, 134, 143, 145–147, 155–156, 165, 167–168, 170–171, 176–178, 187, 189–194, 201, 203, 205, 207–209
routers/api_user_create
   api_user_create.py00100% 
routers/event
   event.py00100% 
routers/health
   health.py02143%23–28, 30–42, 52–53
routers/invitation
   external.py00100% 
   invitation.py02286%74, 78–87, 139–140, 147, 195–198, 234–237
   invitation_notify.py0294%46, 57
routers/permissions
   __init__.py00100% 
   casbin.py00100% 
   default_roles.py0681%44–49
   dependencies.py0473%25–27, 29
   permission_metadata.py02052%41, 43–46, 51–54, 61–67, 76–77, 83–84
   permissions.py01750%37, 39–40, 42–48, 50–55, 57
services/data_providers
   __init__.py00100% 
   freeipa_client.py06548%34–37, 40–50, 63–65, 72–73, 104–105, 107, 114–117, 127, 131–135, 169–176, 188–192, 199–206, 209, 213–215, 221–227
   identity_client.py00100% 
   keycloak_client.py02568%16, 20–21, 28–31, 76–77, 82–86, 92–93, 116–117, 144–145, 148–152
   ldap_client.py07042%22–33, 46–48, 104–106, 108–116, 131–132, 134–136, 138–140, 153–154, 159–167, 188–189, 195–200, 202–206, 216–220, 230–231, 240–241, 262–263
services/notifier_services
   email_service.py0384%45, 48, 59
TOTAL271767675% 

@vmoshynskyi vmoshynskyi merged commit 3d2df1a into main Nov 14, 2025
13 checks passed
@vmoshynskyi vmoshynskyi deleted the IEBH-458 branch November 14, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant