wings icon indicating copy to clipboard operation
wings copied to clipboard

Add `sftp.read` to activity log

Open EpicPlayerA10 opened this issue 1 year ago • 6 comments

Adds sftp.read to activity log when file is read in SFTP.

Resolves https://github.com/pterodactyl/panel/issues/5136

Linked with PR https://github.com/pterodactyl/panel/pull/5148

EpicPlayerA10 avatar Jul 01 '24 20:07 EpicPlayerA10

Thank you for your submission.

I've looked into this, and it appears there used to be logging for SFTP read events. It was dropped during the migration to sqlite based event buffer. If memory serves, I believe it was deliberately removed due to performance concerns.

I personally do like the idea of this being available. Access though the panel is logged so makes sense to be consistent, even if it has to be gated behind a config flag. So I'll see what @matthewpi want's to do about this.

danny6167 avatar Jul 01 '24 20:07 danny6167

I don't think so that it would hit performance so much. I mean that sftp.read is very similar to sftp.write, except instead of trigerring on write, it triggers on read. sftp.write is already triggered very frequently without any performance issues, so all the more there will be no problems with sftp.read.

EpicPlayerA10 avatar Jul 01 '24 23:07 EpicPlayerA10

This must be gated behind a config option before I'd consider merging it. While someone could argue writing files produces a lot of logs as it stands, writing files is definitely something we want to know about while reads are less important. Especially over a protocol like SFTP where automated tooling may be used to sync files.

matthewpi avatar Feb 14 '25 20:02 matthewpi

Should the option be enabled or disabled by default?

EpicPlayerA10 avatar Feb 16 '25 17:02 EpicPlayerA10

Should the option be enabled or disabled by default?

The option should be named enable and set to false by default

matthewpi avatar Feb 16 '25 17:02 matthewpi

The option should be named enable and set to false by default

Done

EpicPlayerA10 avatar Feb 16 '25 22:02 EpicPlayerA10