|
|
Help with background/root/encrypted scripting
|
|
|
|
Mac Elite
Join Date: Sep 2000
Status:
Offline
|
|
I have a perl script that I need to run at all times. It periodically collects network data and writes it to stdout, which I redirect to a file. The information that this script writes is highly sensitive and I would like some help in setting it up in a more secure way.
First off, how can I make it run in the background at startup? It needs to run as root. Also, how can I make it so that the script doesnt overwrite the output file everytime that it is launched (in this case it would be upon restart) because just using the command "script > outputfile" will result in the outputfile being overwritten. Is there a way that I can append the data to the end of the file instead?
Also, since this data is highly sensitive, is there a way that I can have the output file encrypted so that i can only be unencrypted with a password? Right now I usually use "tail -f" to read the contents of the file when I need to see the updates happening live. Is there a way to encrypt the file and still allow something similar?
Thanks for the help.
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status:
Offline
|
|
1. Copy
file:///System/Library/StartupItems/LDAP
into /Library/StartupItems (create if it doesn't exist),
then modify the script named LDAP and the Info.plist to suit your needs.
2. To append, use >> instead of >
3. Not sure.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by waffffffle:
Also, since this data is highly sensitive, is there a way that I can have the output file encrypted so that i can only be unencrypted with a password? Right now I usually use "tail -f" to read the contents of the file when I need to see the updates happening live. Is there a way to encrypt the file and still allow something similar?
Since your first two questions were answered I will tackle the third. I don't think Perl has any built-in way to encrypt data on the fly like that. You could encrypt the string and then write the encrypted string to a file. However, you would have to write a "reader" tool to decrypt the file when you wanted to read it.
Alternately, you could use Java, which has encrypted file streams (example here).
If you do decide you want to stick with perl, look at the Crypt::* modules at CPAN -- everything you could ever want is there.
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Sep 2000
Status:
Offline
|
|
Originally posted by Mithras:
1. Copy
file:///System/Library/StartupItems/LDAP
into /Library/StartupItems (create if it doesn't exist),
then modify the script named LDAP and the Info.plist to suit your needs.
Thanks for the help but I am not sure about this part. I copied the folder over. I really don't understand shell scripting too well so I'm not sure what I should put in there.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|