grindmonkeh: (horns.)
[personal profile] grindmonkeh
ie. propellorheaded linux fodder.

This is a simple bash script I just wrote that finds world-writable files on our not-for-profit webserver and generates a nice report via e-mail to the devtards. Our web devs for a mystical reason like to chmod 777 entire directories. That's bad, kids.

#!/bin/bash
find /home -type f -perm -o+w -exec ls -l {} \; > /var/log/wwreport.txt
cp /var/log/wwreportdescrip.txt /var/log/sendreport.txt
cat /var/log/wwreport.txt >> /var/log/sendreport.txt
mail -s "*NameofServer* Server World Writable File Report" devtard@here.edu < /var/log/sendreport.txt
mv /var/log/sendreport.txt /var/log/sendreport.txt.`eval date +%Y%m%d`


wwreport.txt is filled with the list of directory paths.
wwreportdescrip.txt has pre-existing text: "The following is a report of world writable files in the public_html directories of the *NameofServer* server. These files will need to be given the correct permissions within the next seven days to maintain server security or access to the site(s) in question will be suspended."

These are both wrapped up into sendreport.txt, it's mailed, and then the report is archived with the date.

99.9% of everybody everywhere will not give a rat's ass about any of this, but to the one person who understands the frustration of having devtards in-house... Here you go.
From:
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.

Profile

grindmonkeh: (Default)
grindmonkeh

September 2010

S M T W T F S
   1234
5678 9 1011
1213141516 1718
19202122232425
2627282930  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Powered by Dreamwidth Studios