By the end of this chapter, you will be able to:
These skills help you keep databases safe and secure, which is crucial for protecting important information in any organization.
Monitoring database security is a critical task for cyber security professionals, especially in Kenya where data breaches can have severe implications for privacy, operational continuity, and regulatory compliance. Effective monitoring helps detect unauthorized access, insider threats, and system anomalies early, reducing the risk of data loss or corruption. This chapter explores key techniques used to monitor databases, equipping professionals with tools to safeguard sensitive information in diverse sectors such as banking, healthcare, county government, and education.
Database monitoring techniques provide systematic ways to observe and analyze database activities. These techniques help security teams maintain the integrity, confidentiality, and availability of data stored in database systems. Kenyan institutions like the National Hospital Insurance Fund (NHIF) and county governments use these methods to comply with data protection laws such as the Data Protection Act 2019 and to protect citizen data from cyber threats.
Transaction auditing focuses on recording and analyzing database transactions to detect suspicious or unauthorized activities. This technique is essential in environments where financial or personal data transactions occur frequently, such as banks or insurance companies.
Transaction auditing involves tracking all operations that alter database contents, such as INSERT, UPDATE, and DELETE commands. The primary objectives include ensuring accountability by recording who did what and when, detecting fraudulent activities, and supporting forensic investigations after security incidents.
Implementing transaction auditing in Kenya faces challenges such as limited skilled personnel to configure complex audit policies, inadequate infrastructure in county government offices, and balancing audit comprehensiveness with system performance to avoid slowing critical services.
Privileged users, such as database administrators and system architects, have elevated access rights that can be exploited either accidentally or maliciously. Monitoring their activities is crucial to prevent internal threats and misuse.
Privileged users manage database configurations, user access controls, and perform maintenance tasks. Their broad access enables them to bypass standard security controls, making their monitoring vital to detect unauthorized data access or manipulation.
In many Kenyan organizations, a lack of segregation of duties means one person may have excessive privileges, complicating auditing efforts. Additionally, resistance from privileged users fearing scrutiny can hinder implementation of monitoring controls.
Log-based auditing collects and analyzes database logs generated by the system during operations. These logs contain valuable information about user activities, system errors, and security events.
Many Kenyan entities face challenges such as insufficient log storage capacity, lack of centralized log management, and inadequate expertise to analyze complex logs. Integrating log management solutions with existing security infrastructure remains a hurdle.
Trigger-based auditing utilizes database triggers, procedural code automatically executed in response to specific events, to monitor and record activities in real time.
Database triggers are attached to tables or views to initiate auditing actions whenever data is inserted, updated, or deleted. This approach allows for customized monitoring tailored to specific organizational needs.
Triggers can introduce performance overhead if poorly designed, especially in high-transaction environments like retail banking systems. Improperly configured triggers may cause unintended side effects such as deadlocks or incomplete audits.
Create a free account to open more of this chapter.
Free: practical guides, quick cards, workplace scenarios and more.
Create a free accountThis chapter explored various database monitoring techniques essential for maintaining database security, including transaction auditing, privileged user auditing, log-based auditing, and trigger-based auditing. Each method provides a unique approach to tracking and analyzing database activities to detect unauthorized or suspicious actions. The chapter also covered the use of specialized tools that facilitate continuous monitoring and real-time analysis of database operations, enhancing the ability to respond swiftly to potential threats. Conducting security mitigation was emphasized as a critical step in protecting database integrity, involving the review and strengthening of access controls to limit exposure. Strategies for containing and neutralizing threats were discussed to reduce the impact of security breaches effectively. Additionally, the importance of applying security patches and updates was highlighted as a proactive measure to close vulnerabilities and improve the overall resilience of the database environment. Together, these components form a comprehensive approach to monitoring and securing databases against evolving cyber threats.
Type: Individual
| Tools & Equipment | Materials |
|---|---|
| Laptop with Microsoft SQL Server Management Studio (SSMS) installed | Sample SQL Server database backup file |
| Database monitoring tools (SQL Server Profiler, Extended Events) | Access credentials with monitoring privileges |
| S/N | Item | Quantity |
|---|---|---|
| 1 | Laptop with Microsoft SQL Server Management Studio (SSMS) installed | 1 Pc per Candidate |
| 2 | Sample SQL Server database backup file (AdventureWorks or equivalent) | 1 Pc per Candidate |
| 3 | Network connection to the SQL Server instance | 1 Pc per Candidate |
| 4 | Database monitoring tools (SQL Server Profiler, Extended Events, or third-party monitoring tool) | 1 Pc per Candidate |
| 5 | Access credentials with monitoring privileges | 1 set per Candidate |
| Items to be Evaluated | Marks Available | Marks Obtained | Comments |
|---|---|---|---|
| TASK 1: Setup and Configure Database Monitoring | |||
| Opened SQL Server Management Studio and connected to the correct SQL Server instance (Award 2 marks for successful connection with correct credentials) | 2 | ||
| Restored or attached the provided sample database to the server (Award 3 marks for restoring or attaching the database without errors) | 3 | ||
| Selected and launched appropriate database monitoring tools (SQL Server Profiler or Extended Events) (Award 2 marks for launching and selecting correct monitoring tool) | 2 | ||
| Configured monitoring filters to capture login/logout events, query executions, and security-related events (Award 5 marks for correctly setting event filters capturing required activities) | 5 | ||
| Started the monitoring session and confirmed data capture is active (Award 3 marks for successfully starting session and confirming event capture) | 3 | ||
| Monitored database activities for at least 30 minutes, ensuring continuous data collection (Award 4 marks for monitoring duration and continuous capture) | 4 | ||
| Stopped and saved the monitoring session output to a file with an appropriate name (Award 3 marks for stopping session and saving output correctly) | 3 | ||
| Sub-Total | 22 | ||
| TASK 2: Analyze and Report on Monitored Data | |||
| Opened the saved monitoring session file for analysis (Award 2 marks for opening the saved monitoring data file) | 2 | ||
| Identified and documented at least three significant database activities (e.g. failed logins, long-running queries, permission changes) (Award 5 marks for identifying and documenting relevant activities) | 5 | ||
| Generated a brief report summarizing the monitored activities and any security concerns (Award 5 marks for creating a clear, concise monitoring report) | 5 | ||
| Sub-Total | 12 | ||
| PRODUCT CHECKLIST | |||
| Monitoring session output file is saved and accessible with correct file format and naming convention (Award 5 marks if file is correctly saved and named per instructions) | 5 | ||
| Monitoring report includes accurate and relevant analysis of captured database activities (Award 6 marks for clear, relevant, and professional report content) | 6 | ||
| Sub-Total | 11 | ||
| GRAND TOTAL | 45 | ||
Type: Individual
| Tools & Equipment | Materials |
|---|---|
| Laptop with SQL Server Management Studio installed | Sample customer database backup file (CustomerDB.bak) |
| Database auditing script template |
| S/N | Item | Quantity |
|---|---|---|
| 1 | Laptop with SQL Server Management Studio installed | 1 Pc per Candidate |
| 2 | Sample customer database backup file (CustomerDB.bak) | 1 Pc per Candidate |
| 3 | Database auditing script template | 1 Pc per Candidate |
| Items to be Evaluated | Marks Available | Marks Obtained | Comments |
|---|---|---|---|
| TASK 1: Restore and prepare the CustomerDB database | |||
| Restored CustomerDB database from the provided backup file (Award 2 marks for successful restoration with no errors) | 2 | ||
| Verified database is accessible and tables are intact (Award 1 mark for confirming database and table availability) | 1 | ||
| Sub-Total | 3 | ||
| TASK 2: Create transaction auditing procedures | |||
| Created audit table to log transaction details (operation type, user, timestamp, affected table) (Award 4 marks for correct fields and data types in audit table) | 4 | ||
| Created triggers on CustomerDB tables to capture INSERT, UPDATE, DELETE operations (Award 6 marks for correct trigger syntax and logic for all three operations) | 6 | ||
| Saved and compiled auditing procedures without syntax errors (Award 2 marks for error-free saving and compiling) | 2 | ||
| Sub-Total | 12 | ||
| TASK 3: Execute and test transaction auditing | |||
| Performed test transactions: INSERT, UPDATE, DELETE on CustomerDB tables (Award 3 marks for performing all three test operations) | 3 | ||
| Queried audit table to verify all transactions were logged correctly (Award 4 marks for correct audit entries with accurate details) | 4 | ||
| Sub-Total | 7 | ||
| PRODUCT CHECKLIST | |||
| Audit table contains correct fields and data types as per specification (Award 3 marks for audit table structure matching requirements) | 3 | ||
| Triggers correctly log all INSERT, UPDATE, DELETE operations with user and timestamp (Award 8 marks for full and accurate transaction logging) | 8 | ||
| Audit log entries match the test transactions performed (Award 7 marks for audit entries matching test data) | 7 | ||
| Sub-Total | 18 | ||
| GRAND TOTAL | 40 | ||
At the start of this chapter we promised you would be able to:
Tick each one you can genuinely do.
Sample simulation — try how the simulator works. A version built for this chapter's practical is coming.
Prepare Kenyan PilauLocked ▸Free: practical guides, quick cards, workplace scenarios and more.
Now — are you there yet?
You're competent when you can confidently do 50% or more of what this chapter promised.
Sign in to record how you're doing.