Розроблення системи управління логами доступу до даних із використанням Google BigQuery
Loading...
Date
Journal Title
Journal ISSN
Volume Title
Publisher
Національний університет "Львівська політехніка"
Abstract
Сьогодні багато компаній працюють з хмарними платформами, де
одночасно можуть бути активними десятки або навіть сотні співробітників. У
таких умовах стає важко відстежувати, хто і як використовує дані, отримує
доступ до них, а також контролювати витрати на аналітичні запити. Це особливо
актуально для сервісів на кшталт Google BigQuery, адже там оплата залежить від
того, скільки даних ти обробляєш. У випадках коли, система логування
налаштована неправильно або використовується тільки базовий аудит,
неможливо зрозуміти хто саме споживає ресурси, витрати стають
непередбачуваними, а іноді це може навіть створювати загрози для безпеки
даних [1].
Тема системи логування виникла з практичної потреби відстежувати, хто
саме виконує запити до BigQuery, що виконується, скільки коштує, і чи
відповідає активність політикам доступу. Ідея полягає в тому, щоб побудувати
інфраструктуру, яка дає змогу не лише збирати події доступу до даних, але й
оперативно реагувати на порушення: надсилати сповіщення, обмежувати доступ
або надавати зворотний зв'язок користувачеві [2].
У роботі створено повну систему для збору і аналізу логів. Її реалізовано,
використовуючи сервіси GCP. Спочатку налаштовно експорт логів з Cloud
Logging в BigQuery через Logging Sink – це дало змогу зберігати всі події в
одному місці і обробляти їх. Потім створено представлення на основі отриманих
логів, яке допомагає структурувати і агрегувати дані для зручного аналізу. Щоб
все це було зручно переглядати, створено дашборди в Looker Studio, який дає
змогу зручно відслідковувати зміни, які відбуваються в системі [3].
Окремою була задача автоматизації перевірок – написано Python–скрипти,
які працюють з Google IAM API і створюють систему щоденного контролю
витрат. Якщо хтось з користувачів перевищує встановлені фінансові ліміти,
система може автоматично заблокувати їм доступ [4]. Для автоматичного
запуску цих перевірок використано Cloud Composer (Airflow), який забезпечує
регулярне виконання скриптів за розкладом [5].
Об’єкт дослідження – система логування активності користувачів у
хмарному середовищі GCP.
Предмет дослідження – автоматизована обробка логів доступу до BigQuery
та моніторинг витрат на запити.
Мета дослідження – побудова інфраструктури для збору, обробки,
візуалізації та реакції на події, пов’язані з доступом до даних у BigQuery.
У результаті роботи реалізовано систему, яка щогодини або щодня
аналізує логи користувацької активності, формує звіти у візуальному інтерфейсі
та, у разі порушення встановлених правил, ініціює автоматичні дії. Створена
архітектура легко адаптується до змін навантаження і відповідає сучасним
вимогам до безпеки та прозорості обробки даних у хмарі. Систему можна
інтегрувати у більші корпоративні рішення або використати як шаблон для
подібних платформ у навчальному чи виробничому середовищі.
Today, many organizations operate on cloud platforms where dozens or even hundreds of employees can be active simultaneously. In such conditions, it becomes challenging to track who is accessing which data, how it is used, and to control spending on analytical queries. This is especially relevant for services like Google BigQuery, where billing is based on the amount of data processed. When logging systems are misconfigured or rely only on basic auditing, it becomes impossible to determine resource consumers, making costs unpredictable and potentially posing data security risks. The topic of log management emerged from the practical need to monitor who executes queries in BigQuery, what is being performed, how much it costs, and whether the activity complies with access policies. The goal was to build infrastructure that not only collects data access events but also allows timely reactions: sending alerts, restricting access, or notifying users. In this project, a complete system for log collection and analysis was developed using GCP services. First, logs were exported from Cloud Logging to BigQuery via a Logging Sink, enabling centralized storage and further processing. Then, views based on the logs were created to structure and aggregate data for easier analysis. Dashboards were built in Looker Studio to visualize system changes and activity trends. A particular focus was placed on automation. Python scripts were developed to work with the Google IAM API and provide daily budget control. If a user exceeds set financial limits, access can be automatically blocked. These scripts are scheduled and executed regularly using Cloud Composer (Airflow). The object of the study is the user activity logging system within the Google Cloud Platform (GCP) environment. The subject of the study is the automated processing of access logs in BigQuery and the monitoring of query–related costs. The purpose of the study is to develop infrastructure for collecting, processing, visualizing, and responding to events related to data access in BigQuery. As a result, a system was implemented that analyzes user activity logs hourly or daily, generates reports in a visual interface, and triggers automatic actions if predefined policies are violated. Developed architecture is easily scalable, meets modern cloud data security and transparency requirements, and can be integrated into larger corporate solutions or reused as a template for educational or production platforms.
Today, many organizations operate on cloud platforms where dozens or even hundreds of employees can be active simultaneously. In such conditions, it becomes challenging to track who is accessing which data, how it is used, and to control spending on analytical queries. This is especially relevant for services like Google BigQuery, where billing is based on the amount of data processed. When logging systems are misconfigured or rely only on basic auditing, it becomes impossible to determine resource consumers, making costs unpredictable and potentially posing data security risks. The topic of log management emerged from the practical need to monitor who executes queries in BigQuery, what is being performed, how much it costs, and whether the activity complies with access policies. The goal was to build infrastructure that not only collects data access events but also allows timely reactions: sending alerts, restricting access, or notifying users. In this project, a complete system for log collection and analysis was developed using GCP services. First, logs were exported from Cloud Logging to BigQuery via a Logging Sink, enabling centralized storage and further processing. Then, views based on the logs were created to structure and aggregate data for easier analysis. Dashboards were built in Looker Studio to visualize system changes and activity trends. A particular focus was placed on automation. Python scripts were developed to work with the Google IAM API and provide daily budget control. If a user exceeds set financial limits, access can be automatically blocked. These scripts are scheduled and executed regularly using Cloud Composer (Airflow). The object of the study is the user activity logging system within the Google Cloud Platform (GCP) environment. The subject of the study is the automated processing of access logs in BigQuery and the monitoring of query–related costs. The purpose of the study is to develop infrastructure for collecting, processing, visualizing, and responding to events related to data access in BigQuery. As a result, a system was implemented that analyzes user activity logs hourly or daily, generates reports in a visual interface, and triggers automatic actions if predefined policies are violated. Developed architecture is easily scalable, meets modern cloud data security and transparency requirements, and can be integrated into larger corporate solutions or reused as a template for educational or production platforms.
Description
Keywords
6.122.00.00, логування, BigQuery, Cloud Logging, Google Cloud
Platform, моніторинг, SQL–аналітика, Looker Studio, IAM API, бюджетування, автоматизація, Logging Sink, хмарна інфраструктура.
Перелік використаних джерел:
1. Barabanov, A., & Makrushin, D. (2021). Security Audit Logging in
Microservice–Based Systems: Survey of Architecture Patterns. Voprosy
kiberbezopasnosti, (2(42)), 71–80. https://doi.org/10.21681/2311–3456–2021
2–71–80
2. Ahmad, A., Saad, M., & Mohaisen, A. (2019). Secure and transparent audit logs
with BlockAudit. Journal of Network and Computer Applications, 145, 102406. https://doi.org/10.1016/j.jnca.2019.102406
3. Vervaet, A. (2021). MoniLog: An Automated Log–Based Anomaly Detection
System for Cloud Computing Infrastructures. У 2021 IEEE 37th International
Conference
on
Data
Engineering
(ICDE).
IEEE. https://doi.org/10.1109/icde51399.2021.00317
4. Monitoring, Logging, and Cost Estimating. (2019). У Google Cloud Certified
Associate
Cloud
Engineer Study
Guide (с. 425–462).
Wiley. https://doi.org/10.1002/9781119564409.ch18
5. Kanumuri, S., & Zeier, M. (2024). Cloud Cost Optimization. У Scaling Cloud
FinOps (с. 177–232). Apress. https://doi.org/10.1007/979–8–8688–0388–8_6, logging, BigQuery, Cloud Logging, Google Cloud Platform, monitoring, SQL analytics, Looker Studio, IAM API, budgeting, automation, Logging
Sink, cloud infrastructure.
List of sources used:
1. Barabanov, A., & Makrushin, D. (2021). Security Audit Logging in
Microservice–Based Systems: Survey of Architecture Patterns. Voprosy
kiberbezopasnosti, (2(42)), 71–80. https://doi.org/10.21681/2311–3456–2021
2–71–80
2. Ahmad, A., Saad, M., & Mohaisen, A. (2019). Secure and transparent audit logs
with BlockAudit. Journal of Network and Computer Applications, 145, 102406. https://doi.org/10.1016/j.jnca.2019.102406
3. Vervaet, A. (2021). MoniLog: An Automated Log–Based Anomaly Detection
System for Cloud Computing Infrastructures. У 2021 IEEE 37th International
Conference
on
Data
Engineering
(ICDE).
IEEE. https://doi.org/10.1109/icde51399.2021.00317
4. Monitoring, Logging, and Cost Estimating. (2019). У Google Cloud Certified
Associate
Cloud
Engineer Study
Guide (с. 425–462).
Wiley. https://doi.org/10.1002/9781119564409.ch18
5. Kanumuri, S., & Zeier, M. (2024). Cloud Cost Optimization. У Scaling Cloud
FinOps (с. 177–232). Apress. https://doi.org/10.1007/979–8–8688–0388–8_6
Citation
Морозинський М. В. Розроблення системи управління логами доступу до даних із використанням Google BigQuery : кваліфікаційна робота на здобуття освітнього ступеня магістр за спеціальністю „6.122.00.00 — Комп'ютерні науки“ / Максим Віталійович Морозинський. — Львів, 2024. — 75 с.