[Spce-dev] [Spce-user] automatic sanitize tool for proxy log?

Lorenzo Mangani lorenzo.mangani at gmail.com
Tue Jul 15 09:01:32 EDT 2014


Matthew,

I'm not sure you need a script for this - unless you have a huge amount of
IPs on your CE, it could be a one-liner with a pipe (replace IP or
sidechain more):

tail -f /var/log/ngcp/kamailio-*.log | sed -r
's/127\.0\.0\.1/INTERNAL_IP/g' | sed -r
's/111\.222\.333\.444/EXTERNAL_IP/g' | tee -a /tmp/$(date +"%F")_$(date
+"%T")_sanitized.log

Again - just a kickstart indication, the above fictional example was not
tested to any serious depth, any shell offers many possible approaches more
or less elegant to achieve the same.


Lorenzo Mangani

HOMER DEV TEAM
QXIP - Capture Engineering
Desk: +1 (202) 470-5312
Mobile: +31 6 4603-2730




On Tue, Jul 15, 2014 at 2:43 PM, Matthew Ogden <matthew at tenacit.net> wrote:

> Shot, will give that a go next time I need to hide some stuff.
>
>
>
> Is it common practice to make a script to go through a set list of IPs /
> numbers automatically?
>
>
>
> *From:* Lorenzo Mangani [mailto:lorenzo.mangani at gmail.com]
> *Sent:* 15 July 2014 02:40 PM
> *To:* Matthew Ogden
> *Cc:* spce-user at lists.sipwise.com
> *Subject:* Re: [Spce-user] automatic sanitize tool for proxy log?
>
>
>
> Matthew,
>
>
>
> Sed is your friend - something like the following should do to conceal
> most IPs (might need tweaking, just some examples for you):
>
>
>
>         sed -r 's/(\b[0-9]{1,3}\.){3}[0-9]{1,3}\b'/HIDDEN_IP/
>
>
>
> Or something as follows to conceal a specific IP:
>
>
>
>         sed -r 's/127\.0\.0\.1/NO_IP/g'
>
>
>
>
>
>
>
>
>
>
> Lorenzo Mangani
>
>
>
> HOMER DEV TEAM
>
> QXIP - Capture Engineering
>
> Desk: +1 (202) 470-5312
>
> Mobile: +31 6 4603-2730
>
>
>
>
>
>
>
> On Tue, Jul 15, 2014 at 2:31 PM, Matthew Ogden <matthew at tenacit.net>
> wrote:
>
> Hi
>
>
>
> I don’t suppose you guys have an automatic sanitization tool?
>
>
>
> Obviously no one wants to post their public IPs for SIP hacker bots to
> trawl through, do you guys use a tool?
>
>
>
> Beginners don’t understand the risk, and its time consuming for all.
>
>
>
> Kind Regards
>
>
>
>
>
> *Matthew Ogden*
>
> Management
>
> TenacIT
>
>
>
>
>
>
>
> *Strategic IT Consulting *•* Advanced Networking *• *Virtualisation*
>
> *Custom Development *•* Hosting *•* Syspro Support  *• *MS Licensing*
>
> National Tel: 041 10 10 100 | Cell: 084 205 4445 | Email:
> matthew at tenacit.net
>
> CT Tel: 021 201 0333 | Skype Name: matthew.ogden | Web:
> http://www.tenacit.net
>
>
>
>
>
>
>
>
> _______________________________________________
> Spce-user mailing list
> Spce-user at lists.sipwise.com
> http://lists.sipwise.com/listinfo/spce-user
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-dev_lists.sipwise.com/attachments/20140715/307628a2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 4536 bytes
Desc: not available
URL: <http://lists.sipwise.com/pipermail/spce-dev_lists.sipwise.com/attachments/20140715/307628a2/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 1031 bytes
Desc: not available
URL: <http://lists.sipwise.com/pipermail/spce-dev_lists.sipwise.com/attachments/20140715/307628a2/attachment-0004.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 1287 bytes
Desc: not available
URL: <http://lists.sipwise.com/pipermail/spce-dev_lists.sipwise.com/attachments/20140715/307628a2/attachment-0005.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 1424 bytes
Desc: not available
URL: <http://lists.sipwise.com/pipermail/spce-dev_lists.sipwise.com/attachments/20140715/307628a2/attachment-0006.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 4809 bytes
Desc: not available
URL: <http://lists.sipwise.com/pipermail/spce-dev_lists.sipwise.com/attachments/20140715/307628a2/attachment-0007.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 3930 bytes
Desc: not available
URL: <http://lists.sipwise.com/pipermail/spce-dev_lists.sipwise.com/attachments/20140715/307628a2/attachment-0003.png>


More information about the Spce-dev mailing list