October 26, 2026
Massive accesses and implications in the usage policy of the Menor Preço RS application
Rodrigo Pereira Magalhães; André Luis Ramos Sanches
DOI: 10.22167/2675-6528-202603426
Article derived from a Course Conclusion Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege for textual synthesis and organization.
Summary
The modernization of public services has expanded the use of digital platforms, creating opportunities and risks, especially regarding the deviation of purpose associated with large-scale queries and massive information extraction. The work assessed the need to update the usage policy of the Menor Preço RS application. 17,652,363 application log records were analyzed, focusing on 16,257,190 GTIN searches, in the period from September 3 to October 2, 2025. Data Science and Analytics techniques were used, including k-means clustering, descriptive statistics, and ANOVA, in addition to cadastral enrichment and analysis of access patterns, IP, and geolocation. An intensive use cluster was identified, composed of 2,997 CPF numbers, responsible for 94.36% of GTIN queries, with a regular and persistent pattern. Systematic violation of the current policy and the use of 95 CPF numbers from deceased individuals were observed, indicating third-party use. It was concluded that the policy needs to be modified to allow massive extraction by internal functionality, with authentication and limits, ensuring universal, controlled, and auditable access. The study demonstrated the application of exploratory analysis techniques to characterize usage patterns and support risk assessment.
Keywords: Automated access; Clusterization (k-means); GTIN; Access logs.
1. Introduction
The digital transformation of public services has driven the production and dissemination of large volumes of data, reflecting the use and behavior of users on electronic platforms. From a big data perspective, this abundance of information offers significant analytical opportunities, but also requires rigorous governance and controls to mitigate risks and ensure the proper use of systems (Mayer-Schönberger and Cukier, 2013). The application of Data Science techniques for the systematic analysis of these records is fundamental to converting massive data into insights that support institutional decision-making.
In this context, the Menor Preço RS application was developed as a public policy in Rio Grande do Sul, aiming to foster fiscal citizenship and fair competition. It allows consumers to check product prices in commercial establishments, based on data from electronic fiscal documents. Each interaction in the application generates an access log record, which includes the user’s CPF, date, time, location (latitude and longitude), IP address, and the search identifier.
An initial exploratory analysis of these logs revealed atypical behavior in GTIN queries, with the generation of millions of records, which raised questions about the compatibility of this usage pattern with the application’s policy. Massive and unaudited access, performed outside the standard interface, can distort the original purpose of the tool. Such a scenario can favor the asymmetric appropriation of information and induce competitive imbalances, transforming an instrument of transparency into input for private strategies of competitive advantage.
Given these indications, access logs represent the main empirical evidence for the study. As there are no pre-existing labels to distinguish legitimate from illegitimate usage profiles, the research resorts to exploratory and unsupervised methods, such as clustering, to segment behaviors based on their observed characteristics (Han et al., 2012). Clustering is suitable for grouping users by similarity and identifying discrepant groups, whose intensive patterns may indicate automated use (Doran and Gokhale, 2011). The distinction between automated traffic and legitimate human interactions, which may exhibit similar characteristics, remains a relevant challenge (Herley, 2022).
The persistence of a usage pattern that deviates from the application’s original purpose, coupled with the risk that the current policy may be circumvented by motivated agents, justifies the need for an in-depth evaluation. This work contributes by demonstrating the application of exploratory analysis techniques to characterize usage patterns and support the assessment of risks related to the deviation of purpose arising from massive queries. Given this scenario, the general objective of the present work was to verify the need to update the usage policy of the Menor Preço RS application, based on an exploratory analysis of access logs in the period from September 3, 2025, to October 2, 2025. As a development of the general objective, the specific objectives were established to characterize query patterns and intensity; identify and segregate possible massive accesses through cluster analysis; analyze relationships between CPFs and queried products; and produce analytical subsidies for institutional recommendations.
2. Material and Methods
The methodological design of the present study was guided by the extraction of empirical evidence from the access logs of users of the Menor Preço RS application. The research is classified as applied, aiming at the production of useful subsidies for institutional decision-making. A quantitative approach was adopted, based on the construction of objective metrics. The study also has an exploratory character, as the phenomenon investigated did not present a prior delimitation or labeling to distinguish regular from undue accesses. Given this characteristic, unsupervised techniques were employed, with emphasis on clustering, in order to organize user heterogeneity and group similar profiles, highlighting discrepant behaviors based on indicators of volume, frequency, and temporal regularity.
The empirical object of the study consisted of the use of the Menor Preço RS application, operated and examined through access records, or logs, generated during its use. These records supported the analysis of the evidence produced. The application was developed within the scope of the Rio Grande do Sul State Revenue, as part of the Fiscal Citizenship Program, established by State Law nº 14.020/2012 (Rio Grande do Sul, 2012). Citizen participation occurs through activation on the Fiscal Citizenship Portal and the indication of the CPF on the fiscal note, whose data feeds the application for price inquiries.
The main data source consisted of search logs generated by queries to the Menor Preço RS application, made available for the period from September 03, 2025, to October 02, 2025. A total of 17,652,363 queries were recorded, of which 1,395,173 were by product description and 16,257,190 by GTIN code. To complement the analysis, cross-referencing was performed with auxiliary tables: b-Cadastros, containing registration information from the Federal Revenue Service (BRASIL, 2021), and a GTIN-NCM relationship table, to group products by merchandise class. The auxiliary tables referred to the period from January 01, 2025, to October 31, 2025. In compliance with fiscal secrecy and the LGPD, user identification data were anonymized.
The computational environment used for data processing was Greenplum, a database with a distributed architecture, optimized for analytical workloads and parallel processing (BROADCOM, 2025; PIVETZ et al., 2012). This infrastructure is hosted in PROCERGS datacenters. The queries for data extraction, preparation, and consolidation were executed in Greenplum, using DBeaver as the access client (DBEAVER, 2025; ELMASRI; NAVATHE, 2016). The Analytical Base (ABT) was built from the integration of search logs with auxiliary tables, through standardization and cross-referencing. The selected variables included query identifiers, search type, temporal data, geolocation, IP address, registration status, date of birth, state of residence, year of death, and product tax categories.
For external processing and subsequent analyses, the Python language (version 3.13) was employed. The ecosystem of libraries used included pandas and numpy for data manipulation, scipy and statsmodels for statistical routines, scikit-learn for clustering, and matplotlib, seaborn, and plotly for visualization. The pingouin package was also used to support statistical tests (HUNTER, 2007; MCKINNEY, 2010; OLIPHANT, 2015; PANDAS DEVELOPMENT TEAM, n.d.; PLOTLY TECHNOLOGIES INC., 2015; PYTHON SOFTWARE FOUNDATION, n.d.; SCIKIT-LEARN DEVELOPERS, n.d.; VALLAT, 2018; WASKOM, 2021; HARRIS et al., 2020; PEDREGOSA et al., 2011; SEABOLD; PERKTOLD, 2010; VIRTANEN et al., 2020).
For clustering, behavioral metrics were constructed at the CPF level: the average time between accesses, the total number of accesses, and the quantity of days with at least one access (HERLEY, 2022; CHANDOLA et al., 2009). The variables were standardized using the z-score to equalize their scales (Favero and Belfiore, 2024; Kaufman and Rousseeuw, 2005). The definition of the number of clusters (k) was performed by joint analysis of the elbow method and the silhouette coefficient, which indicated greater suitability for k=3. The non-hierarchical k-means method was applied to group the observations, minimizing intra-cluster variability. Internal validation of the groupings was conducted by descriptive statistical analysis and analysis of variance (ANOVA), using the F-test (Johnson and Wichern, 2007).
3. Results and Discussion
The exploratory analysis of the access logs of the Menor Preço RS application revealed a significant change in the usage pattern, especially in queries by Global Trade Item Number (GTIN) code. Historically, product description searches surpassed those by GTIN, an expected behavior given human interaction with the application. However, from mid-July 2025, a sharp inflection was observed, with GTIN queries showing expressive growth. This increase was on the order of 2,500% compared to previous levels, indicating a deviation from the conventional use of the platform.
In the period from September 3rd to October 2nd, 2025, the total number of records analyzed was 17,652,363 queries, of which 16,257,190 referred to GTIN searches. This massive volume of GTIN queries, which exceeded one million daily accesses in mid-July, strongly contrasts with the average of approximately 22,000 daily accesses observed previously. Such atypical behavior suggests the occurrence of massive data extraction, possibly through “scripts” or “bots”, in disagreement with the application’s current usage policy.
The application’s usage policy, as per items 7 and 8 of Annex 1, establishes that the platform is not intended for massive research and provides for temporary or permanent blocks for users who exceed query limits. To give effect to these guidelines, the State Revenue Service has defined objective access restriction criteria: 150 accesses in 5 minutes result in a 1-hour block, and 400 accesses on the same day impose a 1-day block, with conversion to permanent after 10 repeat offenses.
The history of blocked CPFs throughout 2025 showed a significant increase in July, concomitant with the rise in GTIN queries. The monthly average of blockages was approximately 40 occurrences, but in July this number reached 523, an increase of about 1,200%. This peak indicates that the agents responsible for mass queries encountered the limits established by institutional rules, confirming the attempt at intensive use that exceeded the parameters of legitimate use.
In the subsequent months, however, a decrease in the number of blocks was observed, which fell to 313 in August, 92 in September, and 29 in October, while the volume of accesses per GTIN remained high. This decoupling is a relevant finding, as it suggests an adaptation of the access pattern. The agents, as far as can be determined, learned the restriction threshold and reconfigured the query rhythm to operate below the established limits, maintaining a volume of accesses significantly higher than what the application was accustomed to processing.
This agent adaptability, which adjusted the rate and access patterns to reduce misuse signaling, is a phenomenon predicted in the literature of automated traffic and anomaly detection (Chandola et al., 2009). Such behavior makes it difficult to distinguish between moderate automation and intense human use, bringing atypical usage metrics closer to those of a very active human user. This observation reinforces the need for a more robust policy, which is not based solely on volume and time thresholds.
The application of the k-means algorithm, with k = 3, segmented the database into three distinct groups of CPFs, allowing the characterization of different usage patterns. The analysis of variance (ANOVA) confirmed that the behavioral variables (average time between accesses, number of days with access, and total number of queries) presented statistically distinct means among the clusters, indicating their ability to discriminate the groupings (Johnson and Wichern, 2007).
Cluster 0, named “Intensive Use”, was the main focus of the analysis, as it concentrated the most atypical patterns. This group comprised 2,997 Individual Taxpayer Registrations, representing 18% of the total users, but was responsible for 94.36% of GTIN queries, totaling 15,331,236 accesses. The average number of queries per Individual Taxpayer Registration in this cluster was 5,115.53, distributed over an average of 29.17 days, with an average interval of only 3.42 minutes between accesses, indicating extremely frequent and persistent use.
In contrast, Cluster 1, named “Reduced Use”, included 508 Individual Taxpayer Registrations (3% of the total), accounting for only 0.03% of queries (4,534 accesses). Users in this cluster performed an average of 8.93 queries per Individual Taxpayer Registration, over 2.30 days, with average intervals of 304.77 minutes between accesses, characterizing occasional and spaced use. Cluster 2, “Moderate Use”, was the largest group, with 12,755 Individual Taxpayer Registrations (78%), and contributed 5.62% of queries (912,616 accesses), presenting an average of 71.55 queries per Individual Taxpayer Registration over 4.32 days, with average intervals of 21.55 minutes.
The concentration of 94.36% of queries in only 18% of CPFs (Cluster 0) is a strong indicator of exceptional and atypical behavior, compatible with anomaly detection in log databases (Chandola et al., 2009). This high concentration, combined with persistence and short intervals between accesses, suggests automated or coordinated use, which deviates from the expected human usage pattern for a price query application.
The interpretive validation of Cluster 0 was reinforced by additional behavioral evidence. The hourly distribution of accesses revealed that 91.68% of atypical accesses (14,055,409 records) occurred between 11 PM and 5 AM, a period of low activity for human users. This nocturnal concentration is highly compatible with automated routines, which frequently operate during times of lower resource competition, minimizing the risk of service unavailability (Chandola et al., 2009).
The analysis of IP addresses associated with atypical accesses demonstrated that 99.5% of these queries did not originate from common residential connections. Instead, the accesses were concentrated in networks belonging to internet infrastructure companies, such as hosting services, “cloud computing”, and “data centers”. These environments, identified by “Autonomous System” (AS) numbers, are typical for the execution of scripts and robots, and not for the daily browsing of end-users (Doran and Gokhale, 2011; Herley, 2022).
The comparison between the geolocation of accesses and the federation unit of residence of the CPFs in Cluster 0 also revealed inconsistencies. Approximately sixty pairs of coordinates concentrated 99.8% of accesses in cities in Rio Grande do Sul, although 99.27% of the CPFs had their domicile outside the state. This standardization of location, possibly through “mock location” or fixed coordinates, reduces the plausibility of organic independent behavior and strengthens the interpretation of a centralized agent or a coordinated set operating the accesses.
The cadastral enrichment of the Cluster 0 CPFs, carried out from b-Cadastros, was crucial for identifying inconsistencies. 95 cases were found of CPFs whose holders were listed as deceased on the access date, clearly indicating third-party use. This evidence has direct implications for the design of controls and reinforces the usefulness of integrating shared registries in access audit processes, as suggested by the Receita Federal do Brasil (BRASIL, RFB, 2021).
Regarding the business link, the results indicated that 84% of the CPFs used in Cluster 0 did not have a single active company registered in their name. This finding contradicts the initial expectation that massive queries could be for market monitoring by companies. The absence of a business link reinforces the hypothesis that the use is not for legitimate commercial purposes directly associated with the CPF holder, but rather for data extraction by third parties.
The main product categories researched in atypical accesses included high-turnover and price-sensitive goods, such as bakery products, laundry preparations, waters, medicines, pasta, and dairy products. This profile of researched items supports the market monitoring hypothesis, connecting the technical finding to the risk of data commercialization and competitive intelligence, which is a central element to justify the policy update and the reinforcement of anti-fraud mechanisms.
In summary, the set of evidence from exploratory analysis and clustering demonstrates that the observed access pattern was not restricted to an organic increase in demand, but included a highly concentrated, persistent behavior technically compatible with automation. The existing policy, based solely on volume thresholds and a temporal window, proved partially effective by generating a peak in blocks in July, but was susceptible to agent adaptation. This corroborates the need for a policy update that incorporates behavioral signals that are more difficult to circumvent, based on a multi-criteria approach for detecting automated traffic and anomalies, as recommended by the literature (Chandola et al., 2009).
4. Conclusion
This work sought to verify the need to update the usage policy of the Menor Preço RS application, through an exploratory analysis of access logs in the period from September 3rd to October 2nd, 2025. An expressive increase in GTIN queries was verified, on the order of 2,500% compared to previous periods, indicating a deviation from the conventional use of the platform. K-means clustering identified a group of intensive use, composed of 2,997 individual taxpayer registries (CPFs), responsible for more than 94% of GTIN queries, with a regular and persistent pattern. It was observed that the majority of these accesses occurred during nighttime hours, originated from internet infrastructure networks, and presented geolocation and registration inconsistencies, including the use of 95 CPFs from deceased holders. Such findings, added to the absence of a business link for 84% of the CPFs in the intensive cluster and the profile of products researched (high-turnover goods), suggest automated and coordinated behavior, compatible with market monitoring and massive data extraction, in disagreement with the current policy.
The current policy, based on volume and time thresholds, proved partially effective in generating initial blocks, but was susceptible to agent adaptation, as they adjusted their access patterns to operate below the limits. Therefore, the study’s main contribution lies in demonstrating the application of Data Science techniques to characterize usage patterns and support the assessment of risks related to misuse. It is recommended to modify the policy to allow massive data extraction by internal functionality, with defined authentication and limits, ensuring universal, controlled, and auditable access, with the initial implementation of authentication via the .gov.br platform. As a limitation, the study did not aim to attribute intent or identify the responsible agents. For future studies, it is suggested to conduct a longitudinal evaluation of the implementation of these measures to verify their impacts on citizen platform usage.
Bibliographic References
Doran, D.; Gokhale, S. S. 2011. Web robot detection techniques: overview and limitations. Data Mining and Knowledge Discovery 22: 183–210. DOI: 10.1007/s10618-010-0180-z. Disponível em: <https://doi.org/10.1007/s10618-010-0180-z\>. Acesso em: 22 dez. 2025.
Han, J.; Kamber, M.; Pei, J. 2012. Data mining: concepts and techniques. 3. ed. Morgan Kaufmann, Waltham, MA, EUA.
Herley, C. 2022. Automated Detection of Automated Traffic. In: USENIX Security Symposium (USENIX Security 22), 2022, Boston, MA, EUA. Anais do USENIX Security Symposium (USENIX Security 2022). p. 1615–1632. Disponível em: https://www.usenix.org/conference/usenixsecurity22/presentation/herley. Acesso em: 22 dez. 2025.
Mayer-Schönberger, V.; Cukier, K. 2013. Big data: a revolution that will transform how we live, work, and think. Houghton Mifflin Harcourt, Boston, MA, EUA.
Rio Grande do Sul. 2012. Law nº 14.020, of June 25, 20
Article originating from the Final Course Project of the Specialization in Data Science and Analytics of the MBA USP/Esalq
To learn more about the course, click here and access the MBX Academy platform