<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:14:40 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[NETCONF-300] unauthorized websocket client is able to receivedata change notifications via sal-rest-connector</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-300</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;short story:&lt;br/&gt;
unauthorized websocket client is able to receivedata change notifications via sal-rest-connector &lt;br/&gt;
if data-change-event-subscription was previously created by authorized user. &lt;/p&gt;

&lt;p&gt;setup environment:&lt;br/&gt;
------------------&lt;br/&gt;
1. start odl distribution-karaf-0.5.0-Boron&lt;br/&gt;
2. install features: &lt;br/&gt;
feature:install odl-restconf&lt;br/&gt;
feature:install odl-dlux-all&lt;br/&gt;
feature:install odl-ovsdb-southbound-impl &lt;br/&gt;
log:set DEBUG org.opendaylight.netconf.sal&lt;/p&gt;

&lt;p&gt;test authorization:&lt;br/&gt;
-------------------&lt;br/&gt;
3. try POST request using postman without authorization &lt;br/&gt;
request: POST &lt;a href=&quot;http://localhost:8181/restconf/config/network-topology:network-topology&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/restconf/config/network-topology:network-topology&lt;/a&gt;&lt;br/&gt;
response: 401 unauthorized&lt;br/&gt;
request: POST &lt;a href=&quot;http://localhost:8181/restconf/config/network-topology:network-topology&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/restconf/config/network-topology:network-topology&lt;/a&gt; using Basic http authorization&lt;br/&gt;
response: 200 + data returned from server&lt;br/&gt;
4. &lt;br/&gt;
POST: &lt;a href=&quot;http://localhost:8181/restconf/operations/sal-remote:create-data-change-event-subscription&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/restconf/operations/sal-remote:create-data-change-event-subscription&lt;/a&gt;&lt;br/&gt;
&amp;lt;input xmlns=&quot;urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote&quot;&amp;gt;&lt;br/&gt;
  &amp;lt;path xmlns:a=&quot;urn:TBD:params:xml:ns:yang:network-topology&quot;&amp;gt;/a:network-topology&amp;lt;/path&amp;gt;&lt;br/&gt;
  &amp;lt;datastore xmlns=&quot;urn:sal:restconf:event:subscription&quot;&amp;gt;CONFIGURATION&amp;lt;/datastore&amp;gt;&lt;br/&gt;
  &amp;lt;scope xmlns=&quot;urn:sal:restconf:event:subscription&quot;&amp;gt;BASE&amp;lt;/scope&amp;gt;  &lt;br/&gt;
&amp;lt;/input&amp;gt;&lt;/p&gt;

&lt;p&gt;create data-change-event-subscription by authorized user:&lt;br/&gt;
---------------------------------------------------------&lt;br/&gt;
5. with postman&lt;br/&gt;
using Basic http authorization&lt;br/&gt;
POST: &lt;a href=&quot;http://localhost:8181/restconf/streams/stream/data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=BASE&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/restconf/streams/stream/data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=BASE&lt;/a&gt;&lt;br/&gt;
&amp;lt;input xmlns=&quot;urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote&quot;&amp;gt;&lt;br/&gt;
  &amp;lt;path xmlns:a=&quot;urn:TBD:params:xml:ns:yang:network-topology&quot;&amp;gt;/a:network-topology&amp;lt;/path&amp;gt;&lt;br/&gt;
  &amp;lt;datastore xmlns=&quot;urn:sal:restconf:event:subscription&quot;&amp;gt;CONFIGURATION&amp;lt;/datastore&amp;gt;&lt;br/&gt;
  &amp;lt;scope xmlns=&quot;urn:sal:restconf:event:subscription&quot;&amp;gt;BASE&amp;lt;/scope&amp;gt;  &lt;br/&gt;
&amp;lt;/input&amp;gt;&lt;br/&gt;
response: 200&lt;br/&gt;
{&lt;br/&gt;
  &quot;output&quot;: &lt;/p&gt;
{
    &quot;stream-name&quot;: &quot;data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=BASE&quot;
  }
&lt;p&gt;}&lt;br/&gt;
6. &lt;br/&gt;
using Basic http authorization&lt;br/&gt;
GET &lt;a href=&quot;http://localhost:8181/restconf/streams/stream/data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=BASE&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/restconf/streams/stream/data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=BASE&lt;/a&gt;&lt;br/&gt;
response: 200&lt;br/&gt;
ws://localhost:8185/data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=BASE&lt;/p&gt;

&lt;p&gt;receive data change events as not authorized user:&lt;br/&gt;
--------------------------------------------------&lt;br/&gt;
7. from web browser (chrome: new incognito tab) as not authorized user, open login page of ODL dlux &lt;a href=&quot;http://localhost:8181/index.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/index.html&lt;/a&gt;, press F12 to start javascript console&lt;br/&gt;
in console, write small javascript to subscribe to websocket for data change notifications:&lt;br/&gt;
var WSocket = new WebSocket(&apos;ws://localhost:8185/data-change-event-subscription/network-topology:network-topology/datastore=CONFIGURATION/scope=BASE&apos;);&lt;br/&gt;
WSocket.onmessage = function(event) &lt;/p&gt;
{ console.log(&apos;Unauthorized Data Access: &apos; + event.data); }
&lt;p&gt;;&lt;br/&gt;
8. from POSTMAN&lt;br/&gt;
using Basic http authorization application/xml&lt;br/&gt;
PUT &lt;a href=&quot;http://localhost:8181/restconf/config/network-topology:network-topology&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/restconf/config/network-topology:network-topology&lt;/a&gt;&lt;br/&gt;
&amp;lt;network-topology xmlns=&quot;urn:TBD:params:xml:ns:yang:network-topology&quot;&amp;gt;&lt;br/&gt;
&amp;lt;topology xmlns=&quot;urn:TBD:params:xml:ns:yang:network-topology&quot;&amp;gt;&lt;br/&gt;
    &amp;lt;topology-id&amp;gt;network-topo:2&amp;lt;/topology-id&amp;gt;&lt;br/&gt;
    &amp;lt;link&amp;gt;&lt;br/&gt;
      &amp;lt;link-id&amp;gt;l3&amp;lt;/link-id&amp;gt;&lt;br/&gt;
      &amp;lt;source&amp;gt;&lt;br/&gt;
        &amp;lt;source-node&amp;gt;n4&amp;lt;/source-node&amp;gt;&lt;br/&gt;
      &amp;lt;/source&amp;gt;&lt;br/&gt;
      &amp;lt;destination&amp;gt;&lt;br/&gt;
        &amp;lt;dest-node&amp;gt;n5&amp;lt;/dest-node&amp;gt;&lt;br/&gt;
      &amp;lt;/destination&amp;gt;&lt;br/&gt;
    &amp;lt;/link&amp;gt;&lt;br/&gt;
    &amp;lt;link&amp;gt;&lt;br/&gt;
      &amp;lt;link-id&amp;gt;l2&amp;lt;/link-id&amp;gt;&lt;br/&gt;
      &amp;lt;source&amp;gt;&lt;br/&gt;
        &amp;lt;source-node&amp;gt;n5&amp;lt;/source-node&amp;gt;&lt;br/&gt;
      &amp;lt;/source&amp;gt;&lt;br/&gt;
      &amp;lt;destination&amp;gt;&lt;br/&gt;
        &amp;lt;dest-node&amp;gt;n6&amp;lt;/dest-node&amp;gt;&lt;br/&gt;
      &amp;lt;/destination&amp;gt;&lt;br/&gt;
    &amp;lt;/link&amp;gt;&lt;br/&gt;
    &amp;lt;node&amp;gt;&lt;br/&gt;
        &amp;lt;node-id&amp;gt;n4&amp;lt;/node-id&amp;gt;&lt;br/&gt;
    &amp;lt;/node&amp;gt;&lt;br/&gt;
    &amp;lt;node&amp;gt;&lt;br/&gt;
        &amp;lt;node-id&amp;gt;n5&amp;lt;/node-id&amp;gt;&lt;br/&gt;
    &amp;lt;/node&amp;gt;&lt;br/&gt;
    &amp;lt;node&amp;gt;&lt;br/&gt;
       &amp;lt;node-id&amp;gt;n6&amp;lt;/node-id&amp;gt;&lt;br/&gt;
    &amp;lt;/node&amp;gt;&lt;br/&gt;
&amp;lt;/topology&amp;gt;&lt;br/&gt;
&amp;lt;/network-topology&amp;gt;&lt;/p&gt;

&lt;p&gt;9. not authorized instance of chrome browser receives notification about data store change  &lt;br/&gt;
Unauthorized Data Access: &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&amp;gt;&lt;br/&gt;
&amp;lt;notification xmlns=&quot;urn:ietf:params:xml:ns:netconf:notification:1.0&quot;&amp;gt;&lt;br/&gt;
    &amp;lt;eventTime&amp;gt;2016-10-19T03:56:24+02:00&amp;lt;/eventTime&amp;gt;&lt;br/&gt;
    &amp;lt;data-changed-notification xmlns=&quot;urn:opendaylight:params:xml:ns:yang:controller:md:sal:remote&quot;&amp;gt;&lt;br/&gt;
        &amp;lt;data-change-event&amp;gt;&lt;br/&gt;
            &amp;lt;path xmlns:edqn=&quot;urn:TBD:params:xml:ns:yang:network-topology&quot;&amp;gt;/edqn:network-topology&amp;lt;/path&amp;gt;&lt;br/&gt;
            &amp;lt;operation&amp;gt;updated&amp;lt;/operation&amp;gt;&lt;br/&gt;
            &amp;lt;data&amp;gt;&lt;br/&gt;
                &amp;lt;network-topology xmlns=&quot;urn:TBD:params:xml:ns:yang:network-topology&quot;&amp;gt;&lt;br/&gt;
                    &amp;lt;topology&amp;gt;&lt;br/&gt;
                        &amp;lt;topology-id&amp;gt;network-topo:2&amp;lt;/topology-id&amp;gt;&lt;br/&gt;
                        &amp;lt;link&amp;gt;&lt;br/&gt;
                            &amp;lt;link-id&amp;gt;l3&amp;lt;/link-id&amp;gt;&lt;br/&gt;
                            &amp;lt;destination&amp;gt;&lt;br/&gt;
                                &amp;lt;dest-node&amp;gt;n5&amp;lt;/dest-node&amp;gt;&lt;br/&gt;
                            &amp;lt;/destination&amp;gt;&lt;br/&gt;
                            &amp;lt;source&amp;gt;&lt;br/&gt;
                                &amp;lt;source-node&amp;gt;n4&amp;lt;/source-node&amp;gt;&lt;br/&gt;
                            &amp;lt;/source&amp;gt;&lt;br/&gt;
                        &amp;lt;/link&amp;gt;&lt;br/&gt;
                        &amp;lt;link&amp;gt;&lt;br/&gt;
                            &amp;lt;link-id&amp;gt;l2&amp;lt;/link-id&amp;gt;&lt;br/&gt;
                            &amp;lt;destination&amp;gt;&lt;br/&gt;
                                &amp;lt;dest-node&amp;gt;n6&amp;lt;/dest-node&amp;gt;&lt;br/&gt;
                            &amp;lt;/destination&amp;gt;&lt;br/&gt;
                            &amp;lt;source&amp;gt;&lt;br/&gt;
                                &amp;lt;source-node&amp;gt;n5&amp;lt;/source-node&amp;gt;&lt;br/&gt;
                            &amp;lt;/source&amp;gt;&lt;br/&gt;
                        &amp;lt;/link&amp;gt;&lt;br/&gt;
                        &amp;lt;node&amp;gt;&lt;br/&gt;
                            &amp;lt;node-id&amp;gt;n6&amp;lt;/node-id&amp;gt;&lt;br/&gt;
                        &amp;lt;/node&amp;gt;&lt;br/&gt;
                        &amp;lt;node&amp;gt;&lt;br/&gt;
                            &amp;lt;node-id&amp;gt;n5&amp;lt;/node-id&amp;gt;&lt;br/&gt;
                        &amp;lt;/node&amp;gt;&lt;br/&gt;
                        &amp;lt;node&amp;gt;&lt;br/&gt;
                            &amp;lt;node-id&amp;gt;n4&amp;lt;/node-id&amp;gt;&lt;br/&gt;
                        &amp;lt;/node&amp;gt;&lt;br/&gt;
                    &amp;lt;/topology&amp;gt;&lt;br/&gt;
                &amp;lt;/network-topology&amp;gt;&lt;br/&gt;
            &amp;lt;/data&amp;gt;&lt;br/&gt;
        &amp;lt;/data-change-event&amp;gt;&lt;br/&gt;
    &amp;lt;/data-changed-notification&amp;gt;&lt;br/&gt;
&amp;lt;/notification&amp;gt;&lt;/p&gt;

&lt;p&gt;10. how to fix the problem:&lt;br/&gt;
in project netconf/restconf/sal-rest-connector/src/main/java&lt;br/&gt;
org.opendaylight.netconf.sal.streams.websockets.WebSocketServerHandler&lt;br/&gt;
in method &lt;br/&gt;
private void handleHttpRequest(final ChannelHandlerContext ctx, final FullHttpRequest req) throws Exception;&lt;br/&gt;
user&apos;s identity must be checked before listener is registered&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="21313">NETCONF-300</key>
            <summary>unauthorized websocket client is able to receivedata change notifications via sal-rest-connector</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="JMorvay">Jakub Morvay</assignee>
                                    <reporter username="juraj.veverka@pantheon.tech">Juraj Veverka</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Oct 2016 06:11:09 +0000</created>
                <updated>Tue, 13 Aug 2019 13:17:40 +0000</updated>
                            <resolved>Tue, 13 Aug 2019 13:17:40 +0000</resolved>
                                                                    <component>restconf-nb</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="39682" author="juraj.veverka@pantheon.tech" created="Thu, 20 Oct 2016 06:11:09 +0000"  >&lt;p&gt;Attachment sal-rest-connector-ws.postman_collection.json has been added with description: postman collection of requests used in the test&lt;/p&gt;</comment>
                            <comment id="66909" author="jaro0149odl" created="Wed, 19 Jun 2019 06:25:07 +0000"  >&lt;p&gt;please look at &lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-623&quot; title=&quot;Impossible to receive notifications via RESTCONF RFC8040 implementation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-623&quot;&gt;&lt;del&gt;NETCONF-623&lt;/del&gt;&lt;/a&gt; for updates&lt;/p&gt;</comment>
                            <comment id="67008" author="jaro0149odl" created="Tue, 16 Jul 2019 11:47:53 +0000"  >&lt;p&gt;it is fixed by &lt;del&gt;&lt;a href=&quot;https://jira.opendaylight.org/browse/NETCONF-623&quot; title=&quot;Impossible to receive notifications via RESTCONF RFC8040 implementation&quot; class=&quot;issue-link&quot; data-issue-key=&quot;NETCONF-623&quot;&gt;&lt;del&gt;NETCONF-623&lt;/del&gt;&lt;/a&gt;&lt;/del&gt; in rfc-8040 (both upgrade request and web-socket channel can be secured in the same way as other web-traffic), the question is whether we would like to port it to old restconf too&lt;br/&gt;
if we don&apos;t want to, we can close this issue&lt;/p&gt;</comment>
                            <comment id="67116" author="jaro0149odl" created="Tue, 13 Aug 2019 13:17:40 +0000"  >&lt;p&gt;no response, closing the issue as fixed&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="31717">NETCONF-623</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="12692" name="sal-rest-connector-ws.postman_collection.json" size="3046" author="juraj.veverka@pantheon.tech" created="Thu, 20 Oct 2016 06:11:09 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6993</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=6993]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10206" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Issue Type</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10300"><![CDATA[Bug]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10204" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>ODL SR Target Milestone</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10349"><![CDATA[Unspecified]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                    <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i01xov:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>