<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/2496/">https://reviewboard.asterisk.org/r/2496/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers, David Lee, kmoore, and Matt Jordan.</div>
<div>By jrose.</div>
<p style="color: grey;"><i>Updated May 13, 2013, 4:32 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Address Kinsey's review. Part of that involved going through and unifying how we specify transport types. Now netsock2.h specifies an ast_transport enumerator which has a bit for each transport type (since chan_sip in particular required this because it could specify multiple transports in a single variable. Others used to use a more simple sequential enumeration).</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://issues.asterisk.org/jira/browse/ASTERISK-21103">ASTERISK-21103</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Stage 3/3 of ASTERISK-21103. In order to convert this set of messages I had to change all of the event blob stuff into JSON strings inside of a JSON blob loaded onto a JSON payload and sent out over stasis to the security topic where it is then consumed by stasis and read into a log message in the appropriate fashion with the fields in the right order to catch the bird to catch the spider to catch the fly.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Made sure that the security messages were being generated in the same way as they were prior to the stasis change by using the following CLI command:
securityevents test generation
Examples Before:
[May 3 14:40:28] SECURITY[1305]: res_security_log.c:134 security_event_cb: SecurityEvent="FailedACL",EventTV="1367610028-869814",Severity="Error",Service="TEST",EventVersion="1",AccountID="Username",SessionID="Session123",LocalAddress="IPV4/UDP/192.168.1.1/12121",RemoteAddress="IPV4/UDP/192.168.1.2/12345",Module="test_security_events",ACLName="TEST_ACL",SessionTV="1367610028-869754"
[May 3 14:40:28] SECURITY[1305]: res_security_log.c:134 security_event_cb: SecurityEvent="InvalidAccountID",EventTV="1367610028-869895",Severity="Error",Service="TEST",EventVersion="1",AccountID="FakeUser",SessionID="Session456",LocalAddress="IPV4/TCP/10.1.2.3/4321",RemoteAddress="IPV4/TCP/10.1.2.4/123",Module="test_security_events",SessionTV="1367610028-869854"
[May 3 14:40:28] SECURITY[1305]: res_security_log.c:134 security_event_cb: SecurityEvent="SessionLimit",EventTV="1367610028-869960",Severity="Error",Service="TEST",EventVersion="1",AccountID="Jenny",SessionID="8675309",LocalAddress="IPV4/TLS/10.5.4.3/4444",RemoteAddress="IPV4/TLS/10.5.4.2/3333",Module="test_security_events",SessionTV="1367610028-869923"
Examples After:
[May 3 14:33:35] SECURITY[31607]: res_security_log.c:122 security_event_stasis_cb: SecurityEvent="FailedACL",EventTV="1367609615-957822",Severity="Error",Service="TEST",EventVersion="1",AccountID="Username",SessionID="Session123",LocalAddress="IPV4/UDP/192.168.1.1/12121",RemoteAddress="IPV4/UDP/192.168.1.2/12345",Module="test_security_events",ACLName="TEST_ACL",SessionTV="1367609615-957750"
[May 3 14:33:35] SECURITY[31608]: res_security_log.c:122 security_event_stasis_cb: SecurityEvent="InvalidAccountID",EventTV="1367609615-958101",Severity="Error",Service="TEST",EventVersion="1",AccountID="FakeUser",SessionID="Session456",LocalAddress="IPV4/TCP/10.1.2.3/4321",RemoteAddress="IPV4/TCP/10.1.2.4/123",Module="test_security_events",SessionTV="1367609615-957969"
[May 3 14:33:35] SECURITY[31608]: res_security_log.c:122 security_event_stasis_cb: SecurityEvent="SessionLimit",EventTV="1367609615-958404",Severity="Error",Service="TEST",EventVersion="1",AccountID="Jenny",SessionID="8675309",LocalAddress="IPV4/TLS/10.5.4.3/4444",RemoteAddress="IPV4/TLS/10.5.4.2/3333",Module="test_security_events",SessionTV="1367609615-958360"
As you can see it's basically identical aside from things that are expected to change between runs and the name of the function generating the messages.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> (updated)</h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/trunk/CHANGES <span style="color: grey">(388522)</span></li>
<li>/trunk/channels/chan_iax2.c <span style="color: grey">(388522)</span></li>
<li>/trunk/channels/chan_sip.c <span style="color: grey">(388522)</span></li>
<li>/trunk/channels/sip/config_parser.c <span style="color: grey">(388522)</span></li>
<li>/trunk/channels/sip/dialplan_functions.c <span style="color: grey">(388522)</span></li>
<li>/trunk/channels/sip/include/config_parser.h <span style="color: grey">(388522)</span></li>
<li>/trunk/channels/sip/include/sip.h <span style="color: grey">(388522)</span></li>
<li>/trunk/channels/sip/security_events.c <span style="color: grey">(388522)</span></li>
<li>/trunk/include/asterisk/acl.h <span style="color: grey">(388522)</span></li>
<li>/trunk/include/asterisk/json.h <span style="color: grey">(388522)</span></li>
<li>/trunk/include/asterisk/netsock2.h <span style="color: grey">(388522)</span></li>
<li>/trunk/include/asterisk/res_sip.h <span style="color: grey">(388522)</span></li>
<li>/trunk/include/asterisk/security_events.h <span style="color: grey">(388522)</span></li>
<li>/trunk/include/asterisk/security_events_defs.h <span style="color: grey">(388522)</span></li>
<li>/trunk/main/asterisk.c <span style="color: grey">(388522)</span></li>
<li>/trunk/main/json.c <span style="color: grey">(388522)</span></li>
<li>/trunk/main/manager.c <span style="color: grey">(388522)</span></li>
<li>/trunk/main/named_acl.c <span style="color: grey">(388522)</span></li>
<li>/trunk/main/security_events.c <span style="color: grey">(388522)</span></li>
<li>/trunk/res/res_security_log.c <span style="color: grey">(388522)</span></li>
<li>/trunk/res/res_sip.c <span style="color: grey">(388522)</span></li>
<li>/trunk/res/res_sip/config_transport.c <span style="color: grey">(388522)</span></li>
<li>/trunk/res/res_sip_nat.c <span style="color: grey">(388522)</span></li>
<li>/trunk/res/res_sip_outbound_registration.c <span style="color: grey">(388522)</span></li>
<li>/trunk/tests/test_security_events.c <span style="color: grey">(388522)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2496/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>