New Reports addon

Hi guys.

I’ve created a small add-on for creating reports, sending them, and scheduling them. It’s a bit basic.

Feel free to try it out and let me know how to improve it.

All feedback is appreciated.

Byw.

1 Like

Hello.

I noticed a limitation I didn’t take into account and will fix it in a future release.

It doesn’t make sense to check the “Weekly Task” or “Monthly Task” box if the report you receive is for the previous day and not for that time range.

If you have any other ideas for improvements, they’re welcome.

Bye,

2 Likes

Hi!.

I’ve already created the new version, which takes into account the “scope” of the selected period to generate the reports and improved/simplified the configuration when creating the task. Depending on the scope you choose, it will send the report at that frequency.

The operation is the same as the previous one. It has been tested on several versions of IPFire Core without any issues, as it is highly independent. It will have problems when the path of the logs located in /var/logs changes.

To install:

  1. Decompress zip file
    reports.ipfire.tgz.zip (20,6 KB)

  2. Copy file “reports.ipfire.tgz” to /opt/pakfire/tmp.

  3. Unpak with:

tar xvf reports.ipfire.tgz

To install:

./install.sh

To uninstall:

./uninstall.sh

  1. You’ll see the menu inside “IPFire”.

Any incident reports you may have will be appreciated.

Bye.

2 Likes

hi, as a little help, I wanted to translate into Italian
reports.it.zip (1008 Byte)

2 Likes

Hi @tratru.

Don´t worry. I’ll get on with it.

Bye.

Hello again.

Here it is.
report.ipfire.tgz.zip (21,1 KB)

Try it and let me know.

I haven’t been able to translate the reports themselves into languages, only the interface. The reports are generated by bash scripts, and due to their complexity, I decided to put them in English.

Bye.

1 Like

A new version with aesthetic improvements:

  • When you deselect all report types, the background of the box turns red.

  • Check if you have configured the URL Filter and IDS/IPS. If they are not configured or enabled, they will not be displayed in the interface.

report.ipfire.tgz.zip (21,7 KB)

Bye.

Hello @tratru

I’m sorry I didn’t understand you correctly. I thought you needed help translating it into Italian and not that you were sending me the translated file. Hehe. My English is so bad…

Anyway, thanks for your contribution.

What do you think of this latest version?

Thanks.

Greetings from Spain.

Hi,

I’ve noticed some issues with the current version, as it only analyzes the messages log files, fast.log, and urlfilter.log, not their rotations. I’m implementing optimized data extraction from all of these files to reduce the slowness. Now, when 1 week is selected, it will pull data from that week, and so on.

I’ve greatly simplified the interface to make it easier to manipulate.

I’m also improving the appearance of the reports to make them more IPFire ECO-friendly.

I’ll post it soon.

Bye.

Good afternoon, everyone!

I have the final version (if no one reports any issues).

Improvements:

  • Analyzes rotated logs to extract all the information needed to create complete reports.
  • Improved appearance in both the interface and the reports (with an IPFire look).
  • Improved display on mobile devices, making it responsive.
  • Detects whether the IDS/IPS and URL Filter modules are configured or not. If they are not configured, they are not displayed in the interface.
  • Ease of use.
    reports.ipfire(final version).tgz.zip (40,6 KB)

If you find any bugs or problems, let me know. Anything’s welcome.

Bye.

2 Likes

Hi,

cool tool!
For common use, you should convert comments and error messages to english, also. :wink:

I found a little issue, not really in your addon, but realting to.
A sudden restart of IPFire (power loss, … ) may write ‘\0’ characters to the syslog. grep interprets the file from this point on as binary.
Using the -a option solves this problem.

BR,
Bernhard

2 Likes

Hi @bbitsch.

Thank you for your feedback. I’ll get back to you as soon as possible with your comment about the error messages in English.

Can you give me a little more detail about the error you encountered when restarting IPFire? It would be interesting to see it so I can try to fix it.

Greetings and thanks from sunny Spain.

As the edit of my post shows, it isn’t the controlled restart but maybe a power off/on.
I found a sequence of NUL characters in my syslog. grep ( without -a) ends at the moment with the message binary file matches, last line found just before the NUL chars.

I found the problem because my daily report for fw was empty. The offending chars are in the logs from July 1. With forcing grep to interpret /var/log/messages as text file, the report generation works.

Hi @bbitsch.

The problem is “supposedly” solved. I’ve already added the “grep -a” part. Let me know if it doesn’t work.

reports.ipfire.tgz.zip (34,8 KB)

As for the English part, if I add it, I won’t understand it. I’m sorry.

Bye.

I’ve checked the grep -a before I posted.:slight_smile:
The issue arises, when some unexpected system shutdowns/restarts occur. These fill some NUL char into the file. Most listing commands just ignore them, so they don’t show up.
The log rotation transfers them to the archive and after some time removes them with the file. :wink:

Great idea :+1: According to email reports is this actual ? And if, is encryption a theme in there ?

Best and thanks for your work on this.

Best,

Erik

1 Like

Hi @ummeegge.

I use the proxy in non-transparent mode on my IPFire. So, as far as I understand, it takes HTTPS captures in the URL Filter module, right?

If I used transparent mode, it wouldn’t show anything related to HTTPS since they wouldn’t appear.

Yes, the reports are real since everything is taken from the logs.

Thanks for your kind words. I believe (or at least that was my intention) that it won’t be affected by IPFire updates, since I’ve tried to make it completely independent of it.

It wouldn’t be a bad idea to add it to the repository as an addon, hehe.

Bye.

Hi Guys!!!.

Some screenshots:

And reports:

I hope you like it.

Bye.

[root@ipsio tmp]# /var/ipfire/reports/url-report.sh
Error: Archivo de log no encontrado: /var/log/squidGuard/urlfilter.log

is there something im missing? i dont have that log file.

/var/ipfire/reports/ids-report.sh: line 325: [: 0
0: integer expression expected

Hi @siosios.

The URL Filter detection log is located at that path:

Do you use the URL Filter? If so, do you have those files?.

Regarding this next error, let me look into it.

Thanks for your input.

Bye.