[New Rule] Postgresql COPY PROGRAM Command Execution - #6542
Merged
Conversation
Contributor
Rule: New - GuidelinesThese guidelines serve as a reminder set of considerations when proposing a new rule. Documentation and Context
Rule Metadata Checks
New BBR Rules
Testing and Validation
|
|
⛔️ Test failed Results
|
eric-forte-elastic
requested review from
Aegrah,
bryans3c,
imays11,
terrancedejesus and
w0rk3r
July 30, 2026 21:02
|
⛔️ Test failed Results
|
eric-forte-elastic
marked this pull request as ready for review
July 30, 2026 21:03
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Network Packet Capture detection rule to identify PostgreSQL COPY ... FROM/TO PROGRAM usage in plaintext PostgreSQL query traffic, expanding network_traffic.pgsql protocol coverage in the detection-rules repository.
Changes:
- Introduces a new high-severity KQL query rule targeting PostgreSQL
COPY ... PROGRAMstatements. - Adds an investigation guide, false-positive guidance, and setup requirements for plaintext visibility and protocol parsing.
- Maps the rule to MITRE ATT&CK Execution (TA0002) / Command and Scripting Interpreter (T1059).
|
⛔️ Test failed Results
|
bryans3c
approved these changes
Jul 31, 2026
Aegrah
approved these changes
Jul 31, 2026
|
⛔️ Test failed Results
|
|
⛔️ Test failed Results
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Related to https://github.com/elastic/ia-trade-team/issues/961
Summary - What I changed
Adds the
PostgreSQL COPY PROGRAM Command Executionrule to expandnetwork_traffic.pgsqlprotocol coverage.The high-severity KQL rule identifies PostgreSQL
COPY ... FROM PROGRAMandCOPY ... TO PROGRAMstatements. A superuser or role withpg_execute_server_programcan abuse this functionality to execute arbitrary operating-system commands as the PostgreSQL service account following database credential compromise.Note
This rule requires visibility into plaintext PostgreSQL query traffic. Similar to the other paintext based rules, this is to gauge customer interest in these protections.
How To Test
RTA or TRADE stack
Checklist
bug,enhancement,schema,maintenance,Rule: New,Rule: Deprecation,Rule: Tuning,Hunt: New, orHunt: Tuningso guidelines can be generatedmeta:rapid-mergelabel if planning to merge within 24 hoursContributor checklist