jehan procaccia a écrit :
> jehan procaccia wrote:
>> I like this one:
>> "Can't you just svnlook cat -t each file?"
>> if you have a complete command sample with a pipe to clamav , that
>> would same me hours searching how to do it ;-) .
> Ok, it took me a certain time (mostly with svnlook rather than clamav
> ...), but I finnaly get it ;-)
> "svnlook cat each files and pipe the output to clamav antivirus"
> exemple:
> [root_at_svnserver /data2/svn/repos/test4/db]
> $ svnlook cat /data2/svn/repos/test4 "New Document Microsoft Office
> Word.docx" | clamscan -
>
> Now I'll try to figure out how to write a script that gets a list of
> all files in the repository (possibly "svnlook tree") to feed "svnlook
> cat" in the first place .
For your Information, I finnaly wrote a script to scan the whole
repository for virus, if it can help someone else ...
1) Get the full path list of files of the repository affected by viruses
$ svnlook tree --full-paths /svn/repos/repoName >
/tmp/repoName-file-list.txt
2) write a script that scan each files in the list above
$ cat /root/svn-clamscan.sh
#!/bin/bash
while read x
do
echo "____NEXT_FILE_____"
echo $x
svnlook cat /svn/repos/repoName "$x" | clamscan -
done < /tmp/repoName-file-list.txt
3) start it
$ time sh /root/svn-clamscan.sh > /tmp/clamscan-result-repoName.txt
4) check it
$ grep "Infected files" /tmp/clamscan-result-repoName.txt | more
the whole thing could be more automated by creating input varaibles
(repoName for example) but I didn't had to do it has I needed to scan
only 2 repos .
hope it helps .. at least me next time ;-) .
Bye .
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-11-21 12:15:07 CET