1

We started to implement the security part of OneM2M and we set about implementing Access Control Policy(ACP) first. While we are investigating the oneM2M example of the Access Control Policy, we see that the privileges (PV) and self privileges (PVS) can be any originator which can be any Application Entity (AE) or Common Service Entity(CSE).

In a privilege, each access control rule defines which AE/CSE is allowed for which operation. So for sets of access control rules an operation is permitted if it is permitted by one or more access control rules in the set.

TS-0001 v3.12.0 | Ln 3432-3433

After that, we also looked at the Eclipse version of the OneM2M implementation and run the application for each CSEs (IN-CSE & MN-CSE). A web interface welcomes you with a login screen and waits for a username and password. Then the weird part comes up. After we did a successful login, the entered username & password seems to be used as originator for the resources that we want to access. In addition to this, also a test user has been also added to the default ACP.

The example ACP is taken from a eclipse forum's thread.

<m2m:acp xmlns:m2m="http://www.onem2m.org/xml/protocols">
    <pv>
        <acr>
            <acor>admin:admin</acor>
            <acop>63</acop>
        </acr>
        <acr>
            <acor>test</acor>
            <acop>34</acop>
        </acr>
    </pv>
    <pvs>
        <acr>
            <acor>admin:admin</acor>
            <acop>63</acop>
        </acr>
    </pvs>
</m2m:acp>

The question is, is it suitable to put some kind of username & password logic to the ACP itself ? Whatever it is, I understand the necessity of that kind of usage. But I am not sure it is the right way to do that in OneM2M.

Assume that we have an AE that has a web interface and used by many users. So each user has different privileges for accessing the other resources in OneM2M, but the access control policies only have originators that can be any AE/CSE and not users. How to implement this kind of scenario ?

Related question is from the OneM2M website

The Cgateway_ae (It seems to be the MN-AE) sends an ACP create request to the MN-CSE. But where the permission comes from for the MN-AE to create a ACP to the MN-CSE. Somehow it should be created before it wants to create another ACP ?

Who has the responsibility to create that ACP ? How that responsible party will know the related AE-ID/CSE-ID even before it is created.

enter image description here

POST /home_gateway?rcn=0 HTTP/1.1
Host: mn.provider.com:8080
X-M2M-Origin: Cgateway_ae
Content-Type: application/vnd.onem2m-res+xml; ty=1
X-M2M-RI: mncse-62948
    
<m2m:acp xmlns:m2m="http://www.onem2m.org/xml/protocols" rn="MN-CSEAcp">
  <pv>
    <acr>
      <acor>Cgateway_ae Clight_ae1 Clight_ae2 /in-cse/Csmartphone_ae</acor>
      <acop>63</acop>
    </acr>
  </pv>
  <pvs>
    <acr>
      <acor>Cgateway_ae</acor>
      <acop>51</acop>
    </acr>
  </pvs>
</m2m:acp>

------------------ EDITED ---------------------------

enter image description here

This is a really good document.

http://www.onem2m.org/tr-0038/procedures/authorization/configuration-of-accesscontrolpolicy

Community
  • 1
  • 1
Barış Velioğlu
  • 5,709
  • 15
  • 59
  • 105

1 Answers1

1

The Eclipse om2m implementation brings its own integrated web UI that has a special handling of the access control originator (acor). If the acor contains a ":" character, then the originator is split into a username/password combination for the UI. As far as I know it still regards the access policies that are defined for that user in the <ACP> resources. And, as shown in the example, a single <ACP> resource can support more than one originator. The Eclipse om2m implementation might not fully compliant when allowing this format.
See TS-0001 chapter "10.2.2.2 Create <AE>". This explains how this identifier is created (by the CSE). After reading this, it becomes much clearer when, in the oneM2M examples, the AE-ID's start with a 'C' or an 'S'. Also check in TS-0001 chapter "7.2 M2M-SP-ID, CSE-ID, App-ID and AE-ID and resource Identifier formats" for further details on the identifier format.

A CSE should always have a kind of "root" originator together with a privileged <ACP> that allows management AE's to perform management functions. Without an <AE> this could be the CSE-ID. For Eclipse om2m this would be the "admin:admin" originator. With this originator a management AE can add further <ACP>'s and originators with lesser privileges for other AE's. Please note, that this kind of user/identity/access management is usually part of the business logic and not part of oneM2M.

Is it sufficiently secure? As always, this depends. Many IoT systems assign a "secret" token to a device to authenticate a connection request. But keep in mind that the originator identifier always comes from an AE that must have successfully registered with the CSE in the first place and is therefore trusted.

To the second part of the question: in the example from the oneM2M website there must be an <ACP> that allows the originator "Cgateway_ae" to CREATE a new <ACP> resource under the resource path "/home_gateway" (the MN-CSE in the example). This <ACP> seems to be missing in the example, but the gateway AE that registers the new <ACP> resource to grant the other AE's the access rights must have the privileges to do so. This can be done either by pre-shared originator authentication information (such as a smart card or similar mechanisms), or another way of distribution of the originator information (e.g. the exchange of a file when the AE is actually running together with the CSE in a secure and trusted environment).

(Updated according to discussion)

Andreas Kraft
  • 3,754
  • 1
  • 30
  • 39
  • So you mean putting our own proprietary implementation doesnt violate the OneM2M standard ? Because it seems that only AE-ID/CSE-ID/GROUP-ID(AEs/CSEs) are allowed to be originators. (I added a picture). Still I have some confusion about how to control permissions when we talk about users of related AE ? Assume that AE is the originator of a ACP that has permission's value 63 (full privileges).Then any create request comes from that AE to the itself seems to pass the ACP check. After that what about the users of that AE?Is this out of scope for ACP check and should be handled without OneM2M – Barış Velioğlu Apr 11 '19 at 21:41
  • For the second part of your answer, I understand that somehow I should know that any AEs which want to register our platform should be known in advance. So that I can create a ACP for that AE before it is registered ? – Barış Velioğlu Apr 11 '19 at 21:41
  • In the meantime thanks really for your time. There is still not enough person to answer OneM2M questions on the internet. – Barış Velioğlu Apr 11 '19 at 21:44
  • For the first comment: Technically, any application (even a curl script...) is an AE. That means it must have have an AE-ID! So, registering an AE with an AE-ID together with the ACP solves this problem ;) And to the users of the AE: any access that is done via the AE happens with the AE's privileges. If your AE supports multiple users than that user management is out of scope of oneM2M. But, what you can do is registering multiple instances of the same application as different AE's and with different AE-ID's. This way, you can somehow use oneM2M's access control for your users. – Andreas Kraft Apr 11 '19 at 21:59
  • For the second comment: You can do it in any order. But you need to keep in mind that the AE-ID is assigned when creating the AE resource. Please check in TS-0001 chapter "10.2.2.2 Create < AE>" ! This explains how this identifier is created (by the CSE). After reading this, it becomes much clearer when, in the oneM2M examples, the AE-ID's start with a 'C' or an 'S'. Also check in TS-0001 chapter "7.2 M2M-SP-ID, CSE-ID, App-ID and AE-ID and resource Identifier formats" for further details on the identifier format. – Andreas Kraft Apr 11 '19 at 22:17
  • For the third comment: You are welcome! I am glad I can help! I am also currently pushing inside of oneM2M that more of the experts become active here on SO and elsewhere ;) We are currently looking for options. – Andreas Kraft Apr 11 '19 at 22:20