J4 Issue ?
avatar ReLater
ReLater
11 Sep 2018

Steps to reproduce the issue

  • Install a nightly build where #20380 is already included.
    Joomla_4.0.0-alpha5-dev-Development-Update_Package.zip
  • Check that your Joomla administrator/logs/ directory is empty.
  • Goto plugins > System - Debug
  • Activate all possible options. Save plugin
  • Activate Debug (Global Configuration)
  • Load some pages of your site
  • Have a look into your Joomla administrator/logs/ directory

Expected result

  • Log files *.sql with database queries

12-09-_2018_00-06-08

Actual result

  • No log files with database queries.
avatar ReLater ReLater - open - 11 Sep 2018
avatar joomla-cms-bot joomla-cms-bot - change - 11 Sep 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Sep 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 12 Sep 2018
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 12 Sep 2018
Category Plugins SQL
avatar brianteeman brianteeman - change - 12 Sep 2018
Labels Added: J4 Issue
avatar brianteeman brianteeman - labeled - 12 Sep 2018
avatar PhilETaylor
PhilETaylor - comment - 14 Sep 2018

oh please lets not log sql queries into sql files which are set names and can be accessed with no authentication through automated means. That is a stupid idea.

And yes I know it will only happen with debug mode on... but turning debug mode off doesn't delete those files...

@joomla/security

avatar SniperSister
SniperSister - comment - 14 Sep 2018

I agree with @PhilETaylor

avatar ReLater
ReLater - comment - 14 Sep 2018

I agree, too.

I don't care how these files are named, extended, structured or if they are protected by a #<?php die('Forbidden.'); ?> or an additional .htaccess but logging sql queries was and is a helpful feature. E.g. if pages are redirecting. But not only in these cases where debug console is too unhandy.

From my point of view 2 files would be sufficient, one for FE, one for BE, to have the queries in a chronological order.

Just BTW: I don't would like to have an automatic deletion if debug is off.

avatar elkuku
elkuku - comment - 14 Sep 2018

Yes, this functionality has been removed. The good new is (or the bad - you decide..) that now not only the executed queries are written to a log file, but also every other information about the current request. This will allow the analysis of redirects for example.
The files will receive a hash file name e.g. /tmp/X63c5161546cb3ad7ba9c85bc6be7cfa3.json

@joomla/security should decide if this is a problem

@ReLater does this solve your issue?

avatar SniperSister
SniperSister - comment - 14 Sep 2018

The files will receive a hash file name e.g. /tmp/X63c5161546cb3ad7ba9c85bc6be7cfa3.json

How is a cleanup supposed to work? When are those files deleted?

avatar PhilETaylor
PhilETaylor - comment - 14 Sep 2018

Yes using md5 in a hash file name is still a security problem - there are a limited. Number of md5 hashes and these can be easily enumerated by a speedy bot

Why is it a Json file ?

Using .htaccess restriction is unacceptable as it’s platform specific

——
Sent from my iPhone - sorry - if needed I’ll send longer email from my desk later.
——

On 14 Sep 2018, at 16:16, David Jardin notifications@github.com wrote:

The files will receive a hash file name e.g. /tmp/X63c5161546cb3ad7ba9c85bc6be7cfa3.json

How is a cleanup supposed to work? When are those files deleted?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

avatar mbabker
mbabker - comment - 14 Sep 2018

The file writing is a feature of the debug bar package, it is not a Joomla add-on. The fact it is in the web space is a limitation of Joomla.

avatar elkuku
elkuku - comment - 14 Sep 2018

How is a cleanup supposed to work? When are those files deleted?

I'd say that it is the responsibility of the user/admin to manage the contents of their tmp directory. AFAIK there is nothing in Joomla! cleaning up tmp files?

Why is it a Json file ?

This is by design. We can explore other options that exist. See: http://phpdebugbar.com/docs/storage.html#storage

avatar SniperSister
SniperSister - comment - 14 Sep 2018

I'd say that it is the responsibility of the user/admin to manage the contents of their tmp directory. AFAIK there is nothing in Joomla! cleaning up tmp files?

Exactly that's the issue: our average user would never ever clean up his tmp directory, that's just not realistic.

avatar brianteeman
brianteeman - comment - 14 Sep 2018

We have the option to log executed queries in J3 as well - how do we handle those files?

avatar mbabker
mbabker - comment - 14 Sep 2018

We don’t.

On Fri, Sep 14, 2018 at 11:04 AM Brian Teeman notifications@github.com
wrote:

We have the option to log executed queries in J3 as well - how do we
handle those files?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#22137 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWfofOxHjBIY2tsNCICLMzmAw5VQrcmks5ua9NzgaJpZM4WkUL-
.

--

  • Michael Please pardon any errors, this message was sent from my iPhone.
avatar brianteeman
brianteeman - comment - 14 Sep 2018

We dont handle the files or I am mistaken and we dont have that functionality?

avatar brianteeman
brianteeman - comment - 14 Sep 2018

oh and dont forget that as of Joomla 3.9 (and not yet merged into joomla 4) we have automatic log rotation and deletion

avatar ReLater
ReLater - comment - 14 Sep 2018

We dont handle the files or I am mistaken and we dont have that functionality?

My image above is Joomla 3 with activated "log queries" or how it's called. Deactivated by default. The users have to delete the sql-files and they're unprotected.

does this solve your issue?

As long as it doesn't become too complicated to "unpack"/decode these files I myself can live with it or a similiar solution and are able to code a custom tool/extension.

A just "Nice to have" would be a timestamp/date at the beginnig of the file names to make orientation/ordering easier if one copies them or whatever.

avatar brianteeman
brianteeman - comment - 14 Sep 2018

@ReLater please test the "new" behaviour for handling logs in j3

avatar ReLater
ReLater - comment - 14 Sep 2018

I will.

As far as I see without testing only php files will be removed by log rotation https://github.com/joomla/joomla-cms/blob/staging/plugins/system/logrotation/logrotation.php#L175

And only if they are in Joomla log_path https://github.com/joomla/joomla-cms/blob/staging/plugins/system/logrotation/logrotation.php#L129

avatar ReLater
ReLater - comment - 14 Sep 2018

Concerning Joomla 3: Have a look please on pr #22187
Maybe just a temporary solution(?)

avatar beat
beat - comment - 14 Sep 2018

I agree with @PhilETaylor and all other JSST members that have expressed their concerns above.

I'm also against logging highly sensitive data such as SQL statements and POST parameters into permanent files on the server as a standard core feature. It is against many privacy regulations, including the EU GDPR.

It is imho ok to have an API for a separately installable third-party debugging plugin to log those into a more appropriate location and form than Joomla core can do.

avatar mbabker
mbabker - comment - 15 Sep 2018

So you are essentially saying that the debug plugin and logging API should
be removed from core because they provide tools that allows someone to
write “sensitive” data somewhere. That’s a paranoia response.

Debugging anything in Joomla that is done by another person, has a
redirect, or provides a non-HTML response is already a black box. Right
now that means core hacking or working against an environment where you
have a step debugger (ext/xdebug) installed and enabled. The debug bar
package provides a mechanism of reaching into this black box without core
hacks or being an advanced developer who can get a step debugger running.
It comes at the expense of logging data somewhere (default filesystem, the
package has out-of-the-box solutions for something like Redis or a database
on a PDO connection, or we write a custom implementation of the storage
interface).

It is an acceptable risk to provide these tools to assist in tracing
problems. What we fail to do is explain this risk and what data is created
where and how it can be purged.

It is not acceptable to further cripple the ability to debug issues on a
website or make it a task that only “senior” developers can perform.

On Fri, Sep 14, 2018 at 6:29 PM beat notifications@github.com wrote:

I agree with @PhilETaylor https://github.com/PhilETaylor and all other
JSST members that have expressed their concerns above.

I'm also against logging highly sensitive data such as SQL statements and
POST parameters into permanent files on the server as a standard core
feature. It is against many privacy regulations, including the EU GDPR.

It is imho ok to have an API for a separately installable third-party
debugging plugin to log those into a more appropriate location and form
than Joomla core can do.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#22137 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAWfoapIcK56feI5yeu9C1URbT9Zuwucks5ubDvvgaJpZM4WkUL-
.

--

  • Michael Please pardon any errors, this message was sent from my iPhone.
avatar elkuku
elkuku - comment - 15 Sep 2018

I agree with @mbabker
But since I believe that paranoia doesn't have to be always a bad thing, I made a PR so people can go to sleep in peace ? hopefully...

avatar joomla-cms-bot joomla-cms-bot - change - 15 Sep 2018
Closed_Date 2018-09-15 05:04:59 2018-09-15 05:05:00
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 15 Sep 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 15 Sep 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-09-15 05:04:59
Closed_By franz-wohlkoenig
avatar joomla-cms-bot
joomla-cms-bot - comment - 15 Sep 2018
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Sep 2018

closed as having Pull Request #22188

Add a Comment

Login with GitHub to post a comment