---
description: >-
  Provide an overview of user activities, including session invalidation and
  brute-force attacks.Help administrators track user behaviour and identify
  unauthorised activities.
---

# Reporting Module

Report tracks all actions performed by users within the system, where user sessions are invalidated for security reasons and if the user is attacked by brute-force attacks on user accounts .

Purpose and Benefits:

* Increased Security: By tracking user activities, administrators can quickly identify suspicious behaviour and take appropriate action.
* Admin Awareness: Admin will get to know if any unusual activities linked to their accounts, promoting proactive security practices.

Detailed Records: Maintaining detailed logs of user actions assists in compliance and auditing processes.

**Enable Events**

To enable user activity tracking in the reports section, follow these steps:

1. Go to Realm Settings in Admin UI and Navigate to the Events section

<figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2FoSR6bNM2TiaBUBLbMq1U%2Fimage.png?alt=media&#x26;token=4bf6a30a-486f-4254-ba56-71ee894cc1d4" alt=""><figcaption></figcaption></figure>

2. After navigating to the Events click on Save events to track the user records.

<figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2F7mDIN5tdIwsCQyS6Ywz2%2Fimage.png?alt=media&#x26;token=ecae6775-8a3c-4734-9809-0587b988e8cb" alt=""><figcaption></figcaption></figure>

Data Stored in Reports:&#x20;

Our reporting section helps monitor user activity and system behavior through key data points collected from various areas. These reports are designed to give quick insights, detect potential issues, and support better decision-making.

The main report types include:

* **Overview**: Displays key metrics using charts like line and bar graphs to show general trends and usage patterns.
* **User Activity**: Tracks user interactions such as logins and feature usage, helping identify active users and behaviors.
* **Session Invalidation**: Logs session termination events to help monitor session security and policy enforcement.
* **Brute Force Detection**: Detects multiple failed login attempts and potential brute force attacks for better security visibility.

1. **Overview Page:**

Presents a visual dashboard with line and bar charts showing key metrics such as login successes, login failures, and overall activity counts. Users can apply filters like date range or user roles to customize the data and gain deeper insights into system usage trends.

* Line Chart

<figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2FU7ecpYCuUVUXxBTtAOJa%2Fimage.png?alt=media&#x26;token=334d4f76-e383-449f-a2bc-93aee76edb59" alt=""><figcaption></figcaption></figure>

* Bar chart

<figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2FtXCT3sDXBtvhDUkTu9gc%2Fimage.png?alt=media&#x26;token=1fdfc031-f8c1-4a91-b4be-e5e54315c705" alt=""><figcaption></figcaption></figure>

2. **User Activity Report:**&#x20;

* Username: The name of the user performing the action.
* User ID: A unique identifier for the user within the system.
* Action Performed: Action taken by the user (e.g., login, logout, data access).
* Time and Date: Timestamp indicating when the action occurred.
* IP Address: The IP address from which the user accessed the system.
* Geolocation: The geographical location providing context for the user’s activity.

Note:  In the Action Taken section, we now include specific login methods. For example, if the user logs in using Push, TOTP, QR code, or other authentication methods, the corresponding action type will be displayed accordingly.

| Column Name   | Data Type   |
| ------------- | ----------- |
| Username      | String      |
| User ID       | UUID/String |
| Time and Date | DateTime    |
| IP Address    | String      |
| Action Type   | String      |
| Geolocation   | String      |

<figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2Fkx0uTz5T83j0anVN7ByE%2Fimage.png?alt=media&#x26;token=6db0c5bc-088a-4b60-9340-2e612f254c1c" alt=""><figcaption></figcaption></figure>

3. **Session Invalidation Report:**

* Username: The name of the user whose session was invalidated.
* User ID: Unique identifier for the user whose session is affected.
* Time and Date: Timestamp of when the session was invalidated.
* Reason: Details regarding the session invalidation event.
* IP Address: The IP address associated with the invalidated session.
* Geolocation: Location information related to the invalidated session.

<table><thead><tr><th>Column Name</th><th width="374">Data Type</th></tr></thead><tbody><tr><td>Username</td><td>String</td></tr><tr><td>User ID</td><td>UUID/String</td></tr><tr><td>Time and Date</td><td>DateTime</td></tr><tr><td>IP Address</td><td>String</td></tr><tr><td>Reason</td><td>String</td></tr><tr><td>Geolocation</td><td>String</td></tr></tbody></table>

<figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2Fy1TYsfGymyyxd3Noonsl%2FScreenshot%202025-04-10%20at%206.21.55%E2%80%AFPM.png?alt=media&#x26;token=1032649a-41a0-40e5-9d9b-ad7f3f0d3564" alt=""><figcaption></figcaption></figure>

4. **BruteForce Detection Report:**&#x20;

* Username: The name of the user targeted by the brute-force attack.
* User ID: Unique identifier for the user whose account is under attack.
* Time and Date: Timestamps for each failed login attempt.
* No of Failed Attempts: Track of failed attempts of a user can be performed.
* Action Taken: The action taken by the user after exceeding the number of failed login attempts (e.g., account lockout).
* IP Address: The IP address from which the brute-force attempts originated.
* Geolocation: Geographical information associated with the IP address of the attacker.

| Column Name           | Data Type   |
| --------------------- | ----------- |
| Username              | String      |
| User ID               | UUID/String |
| Time and Date         | DateTime    |
| No of Failed Attempts | String      |
| Action Taken          | String      |
| IP Address            | String      |
| Geolocation           | String      |

<figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2Fd8pb7cOqyfKLAuAA9Q3A%2FScreenshot%202025-04-10%20at%206.23.23%E2%80%AFPM.png?alt=media&#x26;token=6b997a35-be97-4cf3-bbe4-3e087272e095" alt=""><figcaption></figcaption></figure>

**Report Formats:**

To facilitate easy tracking and analysis of user’s activities, reports are generated in multiple formats, including:&#x20;

* PDF: Provides a printable format that is suitable for sharing and archiving.
* Excel: Allows for easy manipulation and analysis of data using spreadsheet tools.
* CSV: Offers a simple, text-based format that can be imported into various applications for further processing.

#### Page Routing (Steps to Create the Report Component) :&#x20;

* Create a Tab in Realm Settings: Add a new tab under Realm Settings to create a dedicated section for reports managing specific settings within the realm.
* Create a Report Component: Develop a new Report.tsx file that defines the Report component.
* Add a Tab Link: In PageNav.tsx, add a new tab link to navigate to the Report component.
* Define Report Routing: In route.tsx, create a constant route. Import the new Report component and define the route for it.
* Connect Report Tab: Ensure that the Report component connects with other tabs using RoutableTabs.

#### Report Section :&#x20;

* We need to create sections to store relevant data in reports, so that when any respective events occur, the corresponding field data is stored in the appropriate sections:&#x20;

1. User Activity Report:  In the User Activity Report, we store user activity data, including the username, user ID, IP address, time and date, action type, and geolocation.
2. Session invalidation Report: The Session Invalidation Report captures information related to session invalidations. This includes the username, user ID, IP address, time and date, action type, and reason for invalidation.
3. BruteForce Attack Report: In the Brute Force Attack Report, we document details about detected attacks, such as the username, user ID, IP address, time and date, action type, and action taken.

\
This ensures that when a user event occurs, the corresponding user data is stored in these sections.

#### IP Address :&#x20;

* When an event occurs, ZTrust stores the IP address from the user's location, allowing the admin to easily identify where the event took place.
* Previously, it was using the server's IP address; however, after making these changes, we are now able to capture the actual IP address from which the event originated.

#### Steps to Retrieve the Actual Source IP Address in ZTrust :&#x20;



* Update Ingress Annotations: If ZTrust is deployed on Kubernetes and is reachable via an ingress endpoint, add the following annotation to the ingress:

“nginx.ingress.kubernetes.io/real-ip-header: X-Forwarded-For”



* Modify Ingress Controller Service: Edit the ingress controller service for the same ingress and include the following under the "Spec:" section:

“externalTrafficPolicy: Local”



By implementing these changes, the actual IP address will be forwarded to ZTrust, allowing for accurate tracking of user locations.

#### Download Report :&#x20;

Reports can be downloaded in three formats: PDF, Excel, and CSV. We utilize JasperReports to generate these formats, ensuring that the data is accurately formatted and saved in the chosen option.

<figure><img src="https://1778922777-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3EUK5AUZv0UVaI5S0CTM%2Fuploads%2FBSm7p8DXx1csT6OCGVaN%2FScreenshot%202025-04-10%20at%206.14.16%E2%80%AFPM.png?alt=media&#x26;token=058ab186-8972-43b3-a613-941122c247dd" alt=""><figcaption></figcaption></figure>

“Note:  When storing the geolocation, ensure that your device has location services turned on so that it can be saved in the geolocation section.Additionally, remember to enable the "Save Events" under Realm Settings option to track user data effectively in reports.”

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXeoPBC8v652L4Us65VLMqfr481WSCaDzmo-BuSQjD5qp3Hictryuptw_ZCoUReEUBckdfkVyqOfYMPEJJLPK0pPe_wPQ3Q81LTj1EMNSV3FtS9nXCVxCJs_SpV1D_zMp4bJ9wYf55Z6XanaQgV_jzqidyK3OZ__r1-CLzsbLTLqydU8ko2uyQ?key=trHzRgGTD4ANqZgrt456QA" alt=""><figcaption></figcaption></figure>

\
