[asterisk-commits] jrose: testsuite/asterisk/trunk r4335 - in /asterisk/trunk/tests/channels/pjs...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 11 14:18:53 CST 2013


Author: jrose
Date: Mon Nov 11 14:18:49 2013
New Revision: 4335

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=4335
Log:
Testsuite: Verify that res_pjsip sends security events for authentication

Review: https://reviewboard.asterisk.org/r/3001/

Added:
    asterisk/trunk/tests/channels/pjsip/auth_security_events/
    asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/
    asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/
    asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/manager.users.conf.inc   (with props)
    asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/pjsip.conf   (with props)
    asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/
    asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_fail.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_pass.xml   (with props)
    asterisk/trunk/tests/channels/pjsip/auth_security_events/test-config.yaml   (with props)
Modified:
    asterisk/trunk/tests/channels/pjsip/tests.yaml

Added: asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/manager.users.conf.inc
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/manager.users.conf.inc?view=auto&rev=4335
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/manager.users.conf.inc (added)
+++ asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/manager.users.conf.inc Mon Nov 11 14:18:49 2013
@@ -1,0 +1,4 @@
+[user]
+secret = mysecret
+read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan,test,agi,security
+write = system,call,agent,user,config,command,reporting,originate,agi

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/manager.users.conf.inc
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/manager.users.conf.inc
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/manager.users.conf.inc
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/pjsip.conf
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/pjsip.conf?view=auto&rev=4335
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/pjsip.conf (added)
+++ asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/pjsip.conf Mon Nov 11 14:18:49 2013
@@ -1,0 +1,23 @@
+[local]
+type=transport
+protocol=udp
+bind=0.0.0.0:5060
+
+[alice]
+type=auth
+auth_type=userpass
+password=test_pass
+username=alice
+
+[alice]
+type=aor
+max_contacts=10
+
+[alice]
+type=endpoint
+context=default
+disallow=all
+allow=ulaw
+aors=alice
+auth=alice
+

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/configs/ast1/pjsip.conf
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_fail.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_fail.xml?view=auto&rev=4335
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_fail.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_fail.xml Mon Nov 11 14:18:49 2013
@@ -1,0 +1,43 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<!-- Derived from scenarios originally created by Walter Doekes -->
+<scenario name="Asterisk REGISTER username disclosure">
+  <send retrans="500">
+    <![CDATA[
+
+      REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: <sip:[service]@[remote_ip]:[remote_port]>;tag=[pid]SIPpTag00[call_number]
+      To: <sip:[service]@[remote_ip]:[remote_port]>
+      Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]>
+      Expires: 60
+      Call-ID: [call_id]
+      CSeq: 1 REGISTER
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="401" auth="true"/>
+
+  <send retrans="500">
+    <![CDATA[
+
+      REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: <sip:[service]@[remote_ip]:[remote_port]>;tag=[pid]SIPpTag00[call_number]
+      To: <sip:[service]@[remote_ip]:[remote_port]>
+      Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]>
+      Expires: 60
+      [authentication]
+      Call-ID: [call_id]
+      CSeq: 2 REGISTER
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="401"/>
+
+</scenario><!-- vim: set ts=8 sw=2 sts=2 et ai: -->

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_fail.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_fail.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_fail.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_pass.xml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_pass.xml?view=auto&rev=4335
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_pass.xml (added)
+++ asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_pass.xml Mon Nov 11 14:18:49 2013
@@ -1,0 +1,43 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<!-- Derived from scenarios originally created by Walter Doekes -->
+<scenario name="Asterisk REGISTER username disclosure">
+  <send retrans="500">
+    <![CDATA[
+
+      REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: <sip:[service]@[remote_ip]:[remote_port]>;tag=[pid]SIPpTag00[call_number]
+      To: <sip:[service]@[remote_ip]:[remote_port]>
+      Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]>
+      Expires: 60
+      Call-ID: [call_id]
+      CSeq: 1 REGISTER
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="401" auth="true"/>
+
+  <send retrans="500">
+    <![CDATA[
+
+      REGISTER sip:[remote_ip]:[remote_port] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
+      From: <sip:[service]@[remote_ip]:[remote_port]>;tag=[pid]SIPpTag00[call_number]
+      To: <sip:[service]@[remote_ip]:[remote_port]>
+      Contact: <sip:[service]@[local_ip]:[local_port];transport=[transport]>
+      Expires: 60
+      [authentication]
+      Call-ID: [call_id]
+      CSeq: 2 REGISTER
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200"/>
+
+</scenario><!-- vim: set ts=8 sw=2 sts=2 et ai: -->

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_pass.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_pass.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/sipp/register_pass.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: asterisk/trunk/tests/channels/pjsip/auth_security_events/test-config.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/auth_security_events/test-config.yaml?view=auto&rev=4335
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/auth_security_events/test-config.yaml (added)
+++ asterisk/trunk/tests/channels/pjsip/auth_security_events/test-config.yaml Mon Nov 11 14:18:49 2013
@@ -1,0 +1,88 @@
+testinfo:
+    summary:     'Tests that Security events are received for authentication events in res_pjsip'
+    description: |
+        "Two registers are performed, one which should fail and one which should pass.
+         For the failing registration, we anticipate to receive 'ChallengeSent' and
+         'ChallengeResponseFailed' in that order. For the passing scenario, we expect
+         'ChallengeSent' followed by 'SuccessfulAuth'."
+
+properties:
+    minversion: '12.0.0'
+    dependencies:
+        - python : 'twisted'
+        - python : 'starpy'
+        - app : 'sipp'
+        - sipp:
+            version: 'v3.3'
+        - asterisk: 'res_pjsip'
+    tags:
+        - pjsip
+
+test-modules:
+    test-object:
+        config-section: sipp-config
+        typename: 'sipp.SIPpTestCase'
+    modules:
+        -
+            config-section: 'security-ami'
+            typename: 'ami.AMIEventModule'
+
+
+
+sipp-config:
+    reactor-timeout: 40
+    fail-on-any: True
+    test-iterations:
+        -
+            scenarios:
+                - { 'key-args': {'scenario': 'register_fail.xml',  '-s': 'alice', '-p': '5061', '-ap' : 'invalid' } }
+                - { 'key-args': {'scenario': 'register_pass.xml',  '-s': 'alice', '-p': '5062', '-ap' : 'test_pass' } }
+
+security-ami:
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'ChallengeSent'
+                Severity: 'Informational'
+                Service: 'PJSIP'
+                AccountID: 'alice'
+                RemoteAddress: 'IPV4/UDP/127.0.0.1/5061'
+        count: '1'
+
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'ChallengeResponseFailed'
+                Severity: 'Error'
+                Service: 'PJSIP'
+                AccountID: 'alice'
+                RemoteAddress: 'IPV4/UDP/127.0.0.1/5061'
+        count: '1'
+
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'ChallengeSent'
+                Severity: 'Informational'
+                Service: 'PJSIP'
+                AccountID: 'alice'
+                RemoteAddress: 'IPV4/UDP/127.0.0.1/5062'
+        count: '1'
+
+    -
+        type: 'headermatch'
+        id: '0'
+        conditions:
+            match:
+                Event: 'SuccessfulAuth'
+                Severity: 'Informational'
+                Service: 'PJSIP'
+                AccountID: 'alice'
+                RemoteAddress: 'IPV4/UDP/127.0.0.1/5062'
+        count: '1'

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/test-config.yaml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/test-config.yaml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: asterisk/trunk/tests/channels/pjsip/auth_security_events/test-config.yaml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: asterisk/trunk/tests/channels/pjsip/tests.yaml
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/pjsip/tests.yaml?view=diff&rev=4335&r1=4334&r2=4335
==============================================================================
--- asterisk/trunk/tests/channels/pjsip/tests.yaml (original)
+++ asterisk/trunk/tests/channels/pjsip/tests.yaml Mon Nov 11 14:18:49 2013
@@ -4,6 +4,7 @@
     - test: 'incoming_calls_without_auth'
     - dir: 'basic_calls'
     - test: 'srtp_negotiation'
+    - test: 'auth_security_events'
     - dir: 'one_touch_recording'
     - dir: 'registration'
     - dir: 'diversion'




More information about the asterisk-commits mailing list