Code Monkey home page Code Monkey logo

Comments (14)

beudbeud avatar beudbeud commented on June 5, 2024

thanks for the commit :)

from glpi.

remicollet avatar remicollet commented on June 5, 2024

I think using direct error_log (to apache log) is not the correct solution.
In GLPI we "never" use error_log directly

We only use logDebug (to php-errors.log) or logInFile (to any file)

Adding such error_log imply another file to manage / supervize.

from glpi.

orthagh avatar orthagh commented on June 5, 2024

OK. You're right for log_error function.
Even so, i think logging "login errors" could be an improvement.

We can add a new file login_error.log filled by a Toolbox::logInFile('login', $sg); to manage this information.
Better, we can condition the writing by a check on use_log_in_files configuration var.

Imo, others existing files in _log arent legit for this new content.

from glpi.

ddurieux avatar ddurieux commented on June 5, 2024

Yes but better to have info on only one line : date + IP

from glpi.

remicollet avatar remicollet commented on June 5, 2024

Even so, i think logging "login errors" could be an improvement.

I never say I disagree with the feature ;) only with implementation :p

from glpi.

remicollet avatar remicollet commented on June 5, 2024

Perhaps even simpler to log in a event_log file all records added in glpi_events

from glpi.

orthagh avatar orthagh commented on June 5, 2024

Ok like this ?

from glpi.

yllen avatar yllen commented on June 5, 2024

I not agree with the solution. In your commit ALL events are recorded and the log file will be huge for a big society.
For me you must only record failed events

from glpi.

orthagh avatar orthagh commented on June 5, 2024

Sure but filtered by two options :

  • event_loglevel (Event::prepareInputForAdd cancels the event db add and log)
  • use_log_in_files (Toolbox::logInfile don't store on disk if options disabled)

System admin can also manage all log files with a logrotate (I think this should be highly recommended in documentation, for all log files, your opinion ?)

from glpi.

yllen avatar yllen commented on June 5, 2024

The request was for failed login, not for all events.
A filter on level 1 should be apply

from glpi.

orthagh avatar orthagh commented on June 5, 2024

I reverted previous commit pending a decision regarding this issue.

Sincerely, i think logging events won't increase disk usage dramatically .

On the bigger instance i know, with event_loglevel = 5 (full), glpi_events table contains 20K entries per month.
An event line should be arround 150 Bytes.
So a disk increase of 3mBytes per month.

This log could be archived and deleted by logrotate or by glpi crontask "circularlogs".

Can you provide amount of line added per month in your context for estimation ?

from glpi.

orthagh avatar orthagh commented on June 5, 2024

@yllen, PR is up to date with your advises.
If it's ok for you, i'll merge this

from glpi.

yllen avatar yllen commented on June 5, 2024

OK for me

from glpi.

C-Duv avatar C-Duv commented on June 5, 2024

The original Redmine issue's goal was to be able to use fail2ban, which #58 does not permit.
The event.log file format is incompatible with fail2ban which requires a "timestamp" on the event line...

Can theses authentication failures event be sent to other, more fail2ban compliant, locations? I didn't find any corresponding configuration setting in GLPI.

from glpi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.