Escalonamento de privilégios: o superusuário do banco de dados AlloyDB grava nas tabelas do usuário
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Este documento descreve um tipo de descoberta de ameaça no Security Command Center. As descobertas de ameaças são geradas por
detectores de ameaças quando eles detectam
uma ameaça potencial nos seus recursos da nuvem. Para uma lista completa das descobertas de ameaças disponíveis, consulte o índice de descobertas de ameaças.
Visão geral
A conta de superusuário do banco de dados AlloyDB para PostgreSQL (postgres) gravou nas tabelas do usuário. O superusuário (uma função com acesso muito amplo) geralmente não deve ser usado para gravar em tabelas de usuários. Uma conta de usuário com acesso mais limitado
deve ser usada para atividades diárias normais. Quando um superusuário grava em uma tabela de usuários, isso pode indicar que um invasor ampliou os privilégios ou comprometeu o usuário padrão do banco de dados e está modificando dados. Também pode indicar práticas normais, mas não seguras.
Como responder
Para responder a essa descoberta, faça o seguinte:
Etapa 1: verificar os detalhes da descoberta
Abra uma descoberta
Privilege Escalation: AlloyDB Database Superuser Writes to User Tables, conforme direcionado em Como verificar descobertas.
Na guia Resumo do painel de detalhes da descoberta, revise as informações nas seguintes seções:
O que foi detectado, especialmente os seguintes campos:
Nome de exibição do banco de dados: o nome do banco de dados na
instância do AlloyDB para PostgreSQL que foi afetada.
Nome de usuário do banco de dados: o superusuário.
Consulta de banco de dados: a consulta SQL executada ao gravar em tabelas de usuários.
Recurso afetado, especialmente os seguintes campos:
Nome completo do recurso: o nome do recurso da instância do AlloyDB para PostgreSQL
que foi afetada.
Nome completo do pai: o nome do recurso da instância do AlloyDB para PostgreSQL.
Nome completo do projeto: o projeto Google Cloud que contém
a instância do AlloyDB para PostgreSQL.
Links relacionados, principalmente os seguintes campos:
URI do Cloud Logging: link para as entradas do Logging.
Método MITRE ATT&CK: link para a documentação do MITRE ATT&CK.
Para ver o JSON completo da descoberta, clique na guia JSON.
Etapa 2: verificar os registros
No console Google Cloud , acesse o Explorador de registros clicando
no link em cloudLoggingQueryURI (da Etapa 1).
A página Explorador de registros inclui todos os registros relacionados à instância relevante do AlloyDB para PostgreSQL.
Verifique os registros pgaudit do PostgreSQL, que contêm as consultas
executadas pelo superusuário, usando os seguintes filtros:
protoPayload.request.user="postgres"
Etapa 3: pesquisar métodos de ataque e resposta
Revise a entrada do framework MITRE ATT&CK para esse tipo de descoberta:
Exfiltration Over Web Service (Exfiltração sobre o serviço da Web).
Para determinar se outras etapas de correção são necessárias, combine seus
resultados da investigação com a pesquisa do
MITRE.
Etapa 4: implementar a resposta
O plano de resposta a seguir pode ser apropriado para essa descoberta, mas também pode afetar as operações.
Avalie cuidadosamente as informações coletadas na investigação para determinar a melhor maneira de
resolver as descobertas.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-10 UTC."],[],[],null,["| Premium and Enterprise [service tiers](/security-command-center/docs/service-tiers)\n\nThis document describes a threat finding type in Security Command Center. Threat findings are generated by\n[threat detectors](/security-command-center/docs/concepts-security-sources#threats) when they detect\na potential threat in your cloud resources. For a full list of available threat findings, see [Threat findings index](/security-command-center/docs/threat-findings-index).\n\nOverview\n\nThe AlloyDB for PostgreSQL database superuser account (`postgres`)\nwrote to user tables. The superuser (a role with very broad access) generally\nshouldn't be used to write to user tables. A user account with more limited access\nshould be used for normal daily activity. When a superuser writes to a user\ntable, that could indicate that an attacker has escalated privileges or has\ncompromised the default database user and is modifying data. It could also\nindicate normal but unsafe practices.\n\nHow to respond\n\nTo respond to this finding, do the following:\n\nStep 1: Review finding details\n\n1. Open an `Privilege Escalation: AlloyDB Database Superuser Writes to User Tables` finding, as directed in [Reviewing findings](/security-command-center/docs/how-to-investigate-threats#reviewing_findings).\n2. On the **Summary** tab of the finding details panel, review the\n information in the following sections:\n\n - **What was detected** , especially the following fields:\n - **Database display name**: the name of the database in the AlloyDB for PostgreSQL instance that was affected.\n - **Database user name**: the superuser.\n - **Database query**: the SQL query executed while writing to user tables.\n - **Affected resource** , especially the following fields:\n - **Resource full name**: the resource name of the AlloyDB for PostgreSQL instance that was affected.\n - **Parent full name**: the resource name of the AlloyDB for PostgreSQL instance.\n - **Project full name**: the Google Cloud project that contains the AlloyDB for PostgreSQL instance.\n - **Related links** , especially the following fields:\n - **Cloud Logging URI**: link to Logging entries.\n - **MITRE ATT\\&CK method**: link to the MITRE ATT\\&CK documentation.\n3. To see the complete JSON for the finding, click the **JSON** tab.\n\nStep 2: Check logs\n\n1. In the Google Cloud console, go to **Logs Explorer** by clicking the link in `cloudLoggingQueryURI` (from [Step 1](#privesc_alloydb_database_superuser_writes_to_user_tables_findings)). The **Logs Explorer** page includes all logs related to the relevant AlloyDB for PostgreSQL instance.\n2. Check the logs for PostgreSQL pgaudit logs, which contain the queries executed by the superuser, by using the following filters:\n - `protoPayload.request.user=\"postgres\"`\n\nStep 3: Research attack and response methods\n\n1. Review the MITRE ATT\\&CK framework entry for this finding type: [Exfiltration Over Web Service](https://attack.mitre.org/techniques/T1078/001/).\n2. To determine if additional remediation steps are necessary, combine your investigation results with MITRE research.\n\nStep 4: Implement your response\n\n\nThe following response plan might be appropriate for this finding, but might also impact operations.\nCarefully evaluate the information you gather in your investigation to determine the best way to\nresolve findings.\n\n- [Review the users allowed to connect to the database](/alloydb/docs/database-users/about#manage-users).\n- [Consider changing the password for the superuser](/alloydb/docs/database-users/about#change-password).\n- Consider [creating a new, limited access user](/alloydb/docs/database-users/about#create) for the different types of queries used on the instance.\n - [Grant the new user only the necessary permissions needed to execute their queries](/alloydb/docs/database-users/about#create).\n - Update the credentials for the clients that connect to the AlloyDB for PostgreSQL instance\n\nWhat's next\n\n- Learn [how to work with threat\n findings in Security Command Center](/security-command-center/docs/how-to-investigate-threats).\n- Refer to the [Threat findings index](/security-command-center/docs/threat-findings-index).\n- Learn how to [review a\n finding](/security-command-center/docs/how-to-investigate-threats#reviewing_findings) through the Google Cloud console.\n- Learn about the [services that\n generate threat findings](/security-command-center/docs/concepts-security-sources#threats)."]]