Registrations to Open-AudIT forums are now closed. To ask any new questions please visit Opmantek Community Questions.

Open-AudIT

What's on your network?
It is currently Fri Apr 19, 2024 6:58 pm

All times are UTC + 10 hours




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 
Author Message
PostPosted: Fri Dec 07, 2007 8:16 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
As per posts here... viewtopic.php?f=9&t=2526 by Edoardo and Andrew

Request to add in ability to email certain details directly from the web interface.

First things first, do we try to stick with basic PHP mail() function, or should we go for something more sophisticated, i.e. http://cvs.php.net/viewvc.cgi/pear/Mail/

Tasks.
1) Add email fields to setup(perhaps), and admin>config.
Do we store the details in the database or in include_config.php bearing in mind we need keep the auth details reasonably secure.
2) Design an interface to the RSS feed

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 07, 2007 8:31 pm 
Offline
Open-AudIT Fellow

Joined: Thu May 17, 2007 5:47 pm
Posts: 568
Location: Italy
If I don't make a mistake, to support SMTP authentication in PHP we need also the Pear Mail package.

_________________
Edoardo


Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 07, 2007 8:58 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
I agree, I had a look at the PHP mail() function and it doesn't seem to support authentication. Therefore we do need Pear mail.php

I have had a play with this, both using mail() and pear mail (http://pear.php.net/package/Mail)

I would certainly be happier with the pear package despite the extra effort to make it work, and I did toy with the idea of giving the user a choice, but "that way madness lies.."

We will need to do a test for pear on the Admin Config page, and grey out the form if pear is not installed with suitable pointers to a mail FAQ here on the OA site.

I wouldn't bother with adding email to the setup script, it isn't needed at setup time, and might break the setup if pear is not installed.

Anything else you can think of?

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 09, 2007 8:12 pm 
Offline
Open-AudIT Fellow

Joined: Thu May 17, 2007 5:47 pm
Posts: 568
Location: Italy
Andrew, we don't need PEAR: please take a look at http://www.phpguru.org/static/mime.mail.html. The open-source htmlMimeMail5 package supports SMTP auth. As an excellent example, it's used in the SB EventLog Monitor project (http://eventlog-monitor.info/).

_________________
Edoardo


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 10, 2007 9:12 pm 
Offline
Moderator
User avatar

Joined: Tue Jan 25, 2005 3:09 am
Posts: 2140
Location: Scotland
Looks good, I will investigate further when I have a spare moment.

_________________
Andrew

[size=85]OA Server: Windows XP/ XAMPP, Mandriva/Apache, Ubuntu
Auditing: 300+ Wstns, 20+ Srvrs, Thin clients, Linux boxes, Routers, etc
OS's: Windows XP , W2K Srvr, W2K3 Srvr, W2K8, Vista, Windows 7, Linuxes (and a Mac at home)
LDAP: Active Directory[/size]


Top
 Profile  
Reply with quote  
PostPosted: Sat Dec 29, 2007 3:58 am 
Offline
Open-AudIT Fellow

Joined: Thu May 17, 2007 5:47 pm
Posts: 568
Location: Italy
[quote="A_Hull"]Looks good, I will investigate further when I have a spare moment.

Hi, did you have time to take a look at this feature?

_________________
Edoardo


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 12, 2009 5:57 am 
Offline
Contributor

Joined: Fri Jul 04, 2008 6:46 am
Posts: 153
Location: USA - WI
Sorry to bump such an old thread, but since it appears this was discussed but never finished I figure I'll continue the discussion.

I started to work on SMTP support. I integrated the SMTP configuration into the normal Admin config area in the tab where the LDAP connections and paths are configured. I modifed that section a bit so it can accommodate SMTP and LDAP connection configuration and testing. I'm using the following class to build the email and send it out via SMTP...

http://www.phpclasses.org/browse/package/9.html

It seems like a very robust class. It supports sending emails in lot of different ways, supports multipart/related and multipart/alternative emails, adding attachments, and it supports SMTP over SSL with authentication. It also has great debugging output for testing the SMTP settings. And it's licensed under the BSD license, so it's GPL compatible. It has great documentation too.

I've attached the patch I'm working on. You need to apply it to a clean SVN tree and then do a normal OA setup, because it needs to create a new table for the holding the SMTP information (because it can contain username/passwords...don't want to store those in plain text =/).

I'm sure there are lots of things that could be sent via email from the interface, such as sending the PDF with machine details via an email with a link to the page, or instead of exporting search information, sending it as an email. An event notification system would be something neat to implement to. Such as sending emails if a new machine is added to the DB and it matches certain criteria, etc.

Still tweaking a few things on the patch, so not completely done yet, but it's close.


Attachments:
add-smtp.txt.zip [80.86 KiB]
Downloaded 395 times

_________________
OA Server: Debian Squeeze w/ Apache2
Auditing: 700 Workstations, 250 or so Retail Terminals, about 75 Servers
OS's: Windows XP/2003/2008/2008 R2/Vista/7, Debian
LDAP: Active Directory 2008 R2
Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 26, 2009 10:48 am 
Offline
Contributor

Joined: Fri Jul 04, 2008 6:46 am
Posts: 153
Location: USA - WI
I've changed this a bit since I posted. The improved one now handles SSL and START TLS properly, and you can choose to auto detect the authentication type of the SMTP server or use a specific authentication type. The goal is to be as flexible as possible to accommodate various SMTP configurations. I've tested on a few different SMTP servers and it works good. However, I hate to add it to SVN when it doesn't really do anything. So, I started a notification system to go with it. I'm starting with a few simple notifications (new systems, new installed software, new detected ports, low disk space). The idea is to make adding new notification types relatively easy.

_________________
OA Server: Debian Squeeze w/ Apache2
Auditing: 700 Workstations, 250 or so Retail Terminals, about 75 Servers
OS's: Windows XP/2003/2008/2008 R2/Vista/7, Debian
LDAP: Active Directory 2008 R2


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 16, 2009 8:58 am 
Offline
Contributor

Joined: Fri Jul 04, 2008 6:46 am
Posts: 153
Location: USA - WI
Well, I think I'm going to hold off on notifications at the moment =/ I actually got a lot of it done, but some of the implementation I just wasn't sure how to do in a non-messy way.

Instead I made it so you can email exported PDFs or CSV files. To do this I implemented a modal interface for the exporting of CSV and PDF files. To do the modal in a way that's most compatible I opted to use jquery/jquery UI. I hate to add another javascript library , but there's lots of other areas that could benefit from it in OA. I'm including jquery, and the core, dialog, and tooltip pieces of jquery UI. Also, the modal for the export of PDF/CSV can easily be extended for DIA/SVG if someone was so inclinded :)

The patch for this is rather large, as it adds jquery/jquery ui, a mime/smtp/sasl message class for email, and the modal. None of these separately are of much good though. I've tested new installs and upgrades and both seem to go good. I also tested some different SMTP configs with no problems. Adding SMTP also checks another missing piece off the list for the web-schedule bit :P

Added as of svn rev 1204.

_________________
OA Server: Debian Squeeze w/ Apache2
Auditing: 700 Workstations, 250 or so Retail Terminals, about 75 Servers
OS's: Windows XP/2003/2008/2008 R2/Vista/7, Debian
LDAP: Active Directory 2008 R2


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 16, 2009 7:34 pm 
Offline
Site Admin
User avatar

Joined: Mon Jun 07, 2004 11:48 am
Posts: 1964
Location: Brisbane, Australia
The _plan_ is to have this in OAv2.
Alerts are generated every time something changes.
A user will be able to say "for group xyz, I want to be notified about alerts of type abc, every (instant, daily, weekly, monthly)".
There are different types of alerts - basically, each type of database table.

You can also see all alerts for a given system (already in code and working).

_________________
Support and Development hours available from [url=https://opmantek.com]Opmantek[/url].
Please consider a purchase to help make Open-AudIT better for everyone.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 posts ] 

All times are UTC + 10 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group