DATA SECURITY IN DISTRIBUTED ARCHITECTURES: IMPLEMENTING NETWORK POLICIES FOR CQRS APIS IN KUBERNETES
Abstract
The transition to microservices architectures and container orchestration by Kubernetes has introduced security challenges due to the native permissiveness of internal East-West traffic. In systems adopting the Command Query Responsibility Segregation (CQRS) pattern, the lack of granular controls in the internal network allows vulnerabilities in the query layer to be exploited to enable unimpeded lateral movement towards transactional command repositories. This work aims to implement and validate the use of native Kubernetes Network Policies to ensure the strict segregation of network flows in CQRS APIs, based on the Zero Trust security principle. The methodology was based on an experimental approach with the construction of a Proof of Concept (PoC) containing isolated read and write services. Declarative Network Policies operating under the Default Deny principle and supported by granular label selectors were configured using the Calico CNI plugin. Empirical connectivity tests revealed that, in the unrestricted environment, direct lateral access to the relational database was granted. In contrast, the application of the isolation Network Policy effectively mitigated the simulated attack at layers 3 and 4 of the OSI model, resulting in packet drops (Connection Timeout), while the legitimate data flow remained fully operational. It is concluded that Network Policies constitute an effective defense-in-depth mechanism for isolating lateral traffic and protecting critical data in distributed infrastructures, although performance under load was not evaluated in this study.
Author Biographies
Undergraduate student in Information Systems at the University of Araraquara (UNIARA).
PhD in Software Engineering from the University of São Paulo (USP). Professor at the University of Araraquara (UNIARA).
PhD in Food and Nutrition from São Paulo State University (UNESP). Professor at the University of Araraquara (UNIARA).
References
BERNSTEIN, David. Containers and Cloud: From LXC to Docker to Kubernetes. IEEE Cloud Computing, v. 1, n. 3, p. 81-84, 2014. DOI: https://doi.org/10.1109/MCC.2014.51
BUDIGIRI, Gerald; BAUMANN, Christoph; MÜHLBERG, Jan Tobias; TRUYEN, Eddy; JOOSEN, Wouter. Network Policies in Kubernetes: Performance Evaluation and Security Analysis. In: 2021 Joint European Conference on Networks and Communications & 6G Summit (EuCNC/6G Summit). Porto: IEEE, 2021. p. 407-412. DOI: https://doi.org/10.1109/EuCNC/6GSummit51104.2021.9482526
BURNS, Brendan; GRANT, Brian; OPPENHEIMER, David; BREWER, Eric; WILKES, John. Borg, Omega, and Kubernetes. Communications of the ACM, v. 59, n. 5, p. 50-57, 2016. DOI: https://doi.org/10.1145/2890784
CLOUD NATIVE COMPUTING FOUNDATION (CNCF). Network Policies. 2023. Disponível em: https://kubernetes.io/docs/concepts/services-networking/network-policies/ Acesso em: 14 abr. 2026.
DI FRANCESCO, Paolo; MALAVOLTA, Ivano; LAGO, Patricia. Research on Architecting Microservices: Trends, Focus, and Potential for Industrial Adoption. In: 2017 IEEE International Conference on Software Architecture (ICSA). Gothenburg: IEEE, 2017. p. 21-30. DOI: https://doi.org/10.1109/ICSA.2017.24
EVANS, Eric. Domain-Driven Design: Tackling Complexity in the Heart of Software. Boston: Addison-Wesley, 2003.
FOWLER, Martin. CQRS. 2010. Disponível em: https://martinfowler.com/bliki/CQRS.html Acesso em: 14 abr. 2026.
GIL, Antônio Carlos. Como Elaborar Projetos de Pesquisa. 6. ed. São Paulo: Atlas, 2017.
HIGHTOWER, Kelsey; BURNS, Brendan; BEDA, Joe. Kubernetes: Up and Running: Dive into the Future of Infrastructure. 2. ed. Sebastopol: O’Reilly Media, 2019.
KINDERVAG, John. No More Chewy Centers: Introducing the Zero Trust Model of Information Security. Cambridge: Forrester Research, 2010.
KUROSE, James F.; ROSS, Keith W. Redes de Computadores e a Internet: uma abordagem top-down. 8. ed. São Paulo: Pearson, 2021.
NATIONAL INSTITUTE OF STANDARDS AND TECHNOLOGY (NIST). Special Publication 800-190: Application Container Security Guide. Gaithersburg: NIST, 2017. Disponível em: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-190.pdf Acesso em: 14 abr. 2026.
NEWMAN, Sam. Building Microservices: Designing Fine-Grained Systems. 2. ed. Sebastopol: O’Reilly Media, 2021.
OWASP FOUNDATION. OWASP API Security Top 10. 2023. Disponível em: https://owasp.org/www-project-api-security/ Acesso em: 14 abr. 2026.
PAHL, Claus; BROGI, Antonio; SOLDANI, Jacopo; JAMSHIDI, Pooyan. Cloud Container Technologies: A State-of-the-Art Review. IEEE Transactions on Cloud Computing, v. 7, n. 3, p. 677-692, 2019. DOI: https://doi.org/10.1109/TCC.2017.2702586
PRODANOV, Cleber Cristiano; FREITAS, Ernani Cesar de. Metodologia do Trabalho Científico: métodos e técnicas da pesquisa e do trabalho acadêmico. 2. ed. Novo Hamburgo: Feevale, 2013.
RICE, Liz. Container Security: Fundamental Technology Concepts that Protect Containerized Applications. 1. ed. Sebastopol: O’Reilly Media, 2020.
RICHARDSON, Chris. Microservices Patterns: With examples in Java. 1. ed. Shelter Island: Manning Publications, 2018.
ROSE, Scott; BORCHERT, Oliver; MITCHELL, Stu; CONNELLY, Sean. Special Publication 800-207: Zero Trust Architecture. Gaithersburg: NIST, 2020. Disponível em: https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-207.pdf Acesso em: 14 abr. 2026.
SULTAN, Sari; AHMAD, Imtiaz; DIMITRIOU, Tassos. Container Security: Issues, Challenges, and the Road Ahead. IEEE Access, v. 7, p. 52976-52996, 2019. DOI: https://doi.org/10.1109/ACCESS.2019.2911732
SYED, Naeem Firdous; SHAH, Syed W.; SHAGHAGHI, Arash; ANWAR, Adnan; BAIG, Zubair; DOSS, Robin. Zero Trust Architecture (ZTA): A Comprehensive Survey. IEEE Access, v. 10, p. 57143-57179, 2022. DOI: https://doi.org/10.1109/ACCESS.2022.3174679
TANENBAUM, Andrew S.; WETHERALL, David J. Redes de Computadores. 5. ed. São Paulo: Pearson Prentice Hall, 2011.
TROELSEN, Andrew; JAPIKSE, Philip. Pro C# 10 with .NET 6: Foundational Principles and Practices in Programming. 11. ed. Berkeley: Apress, 2022. DOI: https://doi.org/10.1007/978-1-4842-7869-7
VEHENT, Julien. Securing DevOps: Security in the Cloud. Shelter Island: Manning Publications, 2018.
VERMA, Abhishek; PEDROSA, Luis; KORUPOLU, Madhukar; OPPENHEIMER, David; TUNE, Eric; WILKES, John. Large-scale cluster management at Google with Borg. In: Proceedings of the Tenth European Conference on Computer Systems (EuroSys ’15). Bordeaux: ACM, 2015. p. 1-17. DOI: https://doi.org/10.1145/2741948.2741964
YOUNG, Gregory. CQRS Documents. 2010. Disponível em: https://cqrs.wordpress.com/documents/ Acesso em: 14 abr. 2026.
