Skip to content

pgsql: truly disable by default - v1 - #16175

Open
jufajardini wants to merge 1 commit into
OISF:mainfrom
jufajardini:8349-disable-pgsql/v1
Open

pgsql: truly disable by default - v1#16175
jufajardini wants to merge 1 commit into
OISF:mainfrom
jufajardini:8349-disable-pgsql/v1

Conversation

@jufajardini

Copy link
Copy Markdown
Contributor

While the pgsql parser is disabled if its setting is present in the yaml config file, it is actually enabled if truly defaulted, that is, if not present in the settings.

Actually disable pgsql parsing and logging if not present in the suricata.yaml config.

Bug: #8349

Link to ticket: https://redmine.openinfosecfoundation.org/issues/

https://redmine.openinfosecfoundation.org/issues/8349

Describe changes:

  • Use registration function that doesn't register pgsql app-proto by default. This means that the behavior with no configuration present or the default config set should be the same, for pgsql, truly making it disabled by default
    This means that if the protocol isn't explicitly enabled for detection a pgsql rule will throw an error, and that logging has to be explicitly enabled, too.

Provide values to any of the below to override the defaults.

SV_BRANCH=OISF/suricata-verify#3351

While the pgsql parser is disabled if its setting is present in the yaml
config file, it is actually enabled if truly defaulted, that is, if not
present in the settings.

Actually disable pgsql parsing and logging if not present in the
suricata.yaml config. This implies that eve output also has to be
explicitly enabled, now.

Bug: OISF#8349
@jufajardini
jufajardini requested a review from a team as a code owner September 3, 2026 20:01
@suricata-review-bot

Copy link
Copy Markdown

AI-generated review posted automatically by Suricata ai-review.

Verdict: approve

No high- or medium-severity findings.

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.13%. Comparing base (b8084b3) to head (c17c6e9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16175      +/-   ##
==========================================
- Coverage   83.14%   83.13%   -0.01%     
==========================================
  Files        1004     1004              
  Lines      277579   277585       +6     
==========================================
- Hits       230789   230769      -20     
- Misses      46790    46816      +26     
Flag Coverage Δ
fuzzcorpus 61.75% <85.71%> (+0.11%) ⬆️
livemode 18.46% <85.71%> (+0.05%) ⬆️
netns 22.82% <85.71%> (-0.06%) ⬇️
pcap 45.40% <85.71%> (-0.04%) ⬇️
suricata-verify 67.30% <100.00%> (-0.03%) ⬇️
unittests 58.54% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@suricata-qa

Copy link
Copy Markdown

WARNING:

field baseline test %
SURI_TLPW2_single_stats_chk
.app_layer.flow.pgsql 0 - -
.app_layer.error.pgsql.gap 0 - -
.app_layer.error.pgsql.alloc 0 - -
.app_layer.error.pgsql.parser 0 - -
.app_layer.error.pgsql.internal 0 - -
.app_layer.tx.pgsql 0 - -
SURI_TLPW2_autofp_stats_chk
.app_layer.flow.pgsql 0 - -
.app_layer.error.pgsql.gap 0 - -
.app_layer.error.pgsql.alloc 0 - -
.app_layer.error.pgsql.parser 0 - -
.app_layer.error.pgsql.internal 0 - -
.app_layer.tx.pgsql 0 - -
SURI_TLPW1_stats_chk
.app_layer.flow.pgsql 0 - -
.app_layer.error.pgsql.gap 0 - -
.app_layer.error.pgsql.alloc 0 - -
.app_layer.error.pgsql.parser 0 - -
.app_layer.error.pgsql.internal 0 - -
.app_layer.tx.pgsql 0 - -
SURI_TLPR1_stats_chk
.app_layer.flow.pgsql 0 - -
.app_layer.error.pgsql.gap 0 - -
.app_layer.error.pgsql.alloc 0 - -
.app_layer.error.pgsql.parser 0 - -
.app_layer.error.pgsql.internal 0 - -
.app_layer.tx.pgsql 0 - -
IPS_AFP_stats_chk
.app_layer.flow.pgsql 0 - -
.app_layer.error.pgsql.gap 0 - -
.app_layer.error.pgsql.alloc 0 - -
.app_layer.error.pgsql.parser 0 - -
.app_layer.error.pgsql.internal 0 - -
.app_layer.tx.pgsql 0 - -
TREX_GENERIC_stats_chk
.app_layer.flow.pgsql 0 - -
.app_layer.error.pgsql.gap 0 - -
.app_layer.error.pgsql.alloc 0 - -
.app_layer.error.pgsql.parser 0 - -
.app_layer.error.pgsql.internal 0 - -
.app_layer.tx.pgsql 0 - -

Pipeline = 33736

@inashivb inashivb added the needs baseline update QA will need a new base line label Sep 4, 2026
Comment thread suricata.yaml.in
stream-depth: 0
# Maximum number of live PostgreSQL transactions per flow
# max-tx: 1024
# stream-depth: 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this indentation change looks off? Or is this a diff viewer artifact?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No diff artifact, it is odd indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs baseline update QA will need a new base line

Development

Successfully merging this pull request may close these issues.

5 participants