server icon indicating copy to clipboard operation
server copied to clipboard

MDEV-33834 Add TLS version to audit plugin available variables

Open Chupsy opened this issue 10 months ago • 11 comments

MDEV: https://jira.mariadb.org/browse/MDEV-33834

Description

Add tls_version and tls_version_length variables to the audit plugin so they can be logged. This is useful to help identify suspicious or malformed connections attempting to use unsupported TLS versions. A log with this information will allow to detect and block more malicious connection attempts.

Users with 'server_audit_events' empty will have these two new variables automatically visible in their logs, but if users don't want them, they can always configure what fields to include by listing the fields in 'server_audit_events'.

Release Notes

None. This just adds more possibilities for users.

How can this PR be tested?

Modified the server audit plugin to include this new info, and updated the server audit plugin MTR tests.

Basing the PR against the correct MariaDB version

  • [X] This is a new feature and the PR is based against the latest MariaDB development branch.

PR quality check

  • [X] I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • [X] For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

Copyright

All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.

Chupsy avatar Apr 03 '24 00:04 Chupsy

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 03 '24 00:04 CLAassistant

Requested changes have been made. The MDEV is assigned to @holyfoot to review, so I have assigned here too.

LinuxJedi avatar Apr 10 '24 09:04 LinuxJedi

@Chupsy just to set the expectations: new features go into 10.6, we start working on 10.6 features in early May and finish it in min-June. Somewhere in that time @holyfoot should review and (if all good) merge your PR.

vuvova avatar Apr 10 '24 09:04 vuvova

@LinuxJedi not sure I understand the changes that you have made to the PR, maybe another commit or modifying current commit message could help ?

Chupsy avatar Apr 11 '24 21:04 Chupsy

Are you sure it's 10.6 and not 11.6 ?

Chupsy avatar Apr 11 '24 22:04 Chupsy

@LinuxJedi not sure I understand the changes that you have made to the PR, maybe another commit or modifying current commit message could help ?

I did an automatic rebase onto the top of the branch. I have not altered the code. I also added the MDEV to the title of the PR, as this makes things much easier for us.

And yes, @vuvova would have meant 11.6.

LinuxJedi avatar Apr 16 '24 08:04 LinuxJedi

Hello @LinuxJedi @vuvova, any update on the validation of this PR ? Do you need me to do some modifications ?

Chupsy avatar Apr 22 '24 21:04 Chupsy

To repeat, what I wrote above (with a s/10/11/ typo fix):

@Chupsy just to set the expectations: new features go into 11.6, we start working on 11.6 features in early May and finish it in min-June. Somewhere in that time @holyfoot should review and (if all good) merge your PR.

So, if nothing happens now — it's normal, the PR is not forgotten, please, wait until May-June

vuvova avatar Apr 23 '24 09:04 vuvova

Hi @vuvova, I'm going to rebase this to 11.6 since the jira ticket is now targetting 11.7 and there is no branch for 11.7

Chupsy avatar Jul 02 '24 17:07 Chupsy

@Chupsy , I wouldn't worry about it, for the purpose of review it doesn't really matter whether it's 11.5 or 11.6 or 11.7, don't waste your time, let's get it approved first

vuvova avatar Jul 02 '24 17:07 vuvova

@Chupsy a generic question, while I'm looking at the code. Why tls version? There are many parameters one might hypothetically want to know about a tls connection — version, certificate (fingerprint, issuer, subject, validity period), ciphers used, etc.

We cannot possibly add all that to the audit log. Why should it be a tls version, and not, say, what cipher was used? What should be the answer to a request to add more tls info, like the ciphers?

vuvova avatar Jul 23 '24 10:07 vuvova

@Chupsy just a reminder. 11.7 windows closes in less than three weeks.

vuvova avatar Aug 22 '24 21:08 vuvova

@Chupsy just a reminder. 11.7 windows closes in less than three weeks.

@vuvova this developer will no longer be contributing to MariaDB.

LinuxJedi avatar Aug 27 '24 16:08 LinuxJedi

@vuvova @LinuxJedi I will take over this PR and address the feedback (generalize MTR test and output format) in a new PR, thanks for the review.

keeper avatar Sep 03 '24 23:09 keeper

closed, moved to #3502

vuvova avatar Sep 11 '24 13:09 vuvova