Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contributing OSCORE to Californium. #516

Closed
LudwigSeitz opened this issue Jan 9, 2018 · 77 comments
Closed

Contributing OSCORE to Californium. #516

LudwigSeitz opened this issue Jan 9, 2018 · 77 comments

Comments

@LudwigSeitz
Copy link

LudwigSeitz commented Jan 9, 2018

Hello team,
some of my colleagues and I would like to contribute OSCORE to Californium.

OSCORE defines the use of Object Security for CoAP using COSE, and is an alternative to DTLS, in scenarios where you have intermediary proxies that you do not trust fully.

OSCORE is an IETF working group draft that is currently in working group last call. There are a number of implementations out there, among which one we have done on top of Californium as a demonstrator.

We would like to bring that code up to your standards and contribute it to Californium, how do you suggest that we proceed?

@boaks
Copy link
Contributor

boaks commented Jan 12, 2018

Would it be a separate module?
Or must it be integrated into core?
How many lines of code?
Just to say, I'm pretty sure, that no one of the current committers will be able to spend time on maintaining that stuff. So I'm not sure, if this is a good idea.

Eclipse has a contribution process:
https://www.eclipse.org/legal/EclipseLegalProcessPoster.pdf

I guess, it's covered by page 3 and would therefore require a CQ.

@sophokles73
Copy link
Contributor

Hi @LudwigSeitz,

as @boaks already pointed out, the current Cf committers' time is very limited and their main interest therefore currently lies on stabilizing the existing functionality and finishing the upcoming 2.0.0 release.

That said, we are always interested in extending Cf's capabilities, we only need to make sure that the code that is getting contributed will be maintained accordingly. So, FMPOV the way we can/should proceed mainly depends on how big an impact your contribution will have on existing code and what your plans are regarding your future involvement in Cf. What we would like to prevent is ending up in a situation where the contributed code does not receive any more love after the contribution has been made ...

WDYT?

@boaks
Copy link
Contributor

boaks commented Jan 15, 2018

time on maintaining that stuff

Just includes my expectation, that even if OSCORE will be release as standard, there usually will arise question, especially for compatibility and interpretation of that standard. And "maintaining" exactly means to cover that.

@LudwigSeitz
Copy link
Author

LudwigSeitz commented Jan 15, 2018

Some answers (more to come):

  • It would be a module with a few hooks in the core (e.g. we need support for an additional option). I checked our current fork and only a few lines in a few core files are currently affected, some of which can probably be designed away.

  • It currently has roughly 4700 lines of code and affects some 100 loc. in the core code

  • We are looking into how we can commit to support this in the long-term. I'll get back to this
    (There is no expectation on the current maintainers of CF to also maintain this, either we manage to find a solution or it will remain an independent fork)

@boaks
Copy link
Contributor

boaks commented Jan 15, 2018

And you're aware, that we mainly work on 2.0.x not on master?

@LudwigSeitz
Copy link
Author

No, but good to know, I'll merge and see what difference it makes.

@gselander
Copy link

On maintaining OSCORE for Californium: Ericsson is financially supporting
this activity for the purpose of using it in products, so the intent is to
maintain the code long term.

@boaks
Copy link
Contributor

boaks commented Jan 18, 2018

Sounds good!

FMPOV, if the hooks in core are limited, and the main stuff goes to a own (optional?) module, I'm fine with it. So I'm looking forward to your contributions.

@gselander
Copy link

On optional: Yes, OSCORE is invoked with a new CoAP Option (called Object-Security) so is optional to use.

@LudwigSeitz
Copy link
Author

Ok checked the 2.0.x stuff. Doesn't seem to be a major issue. We are now working on extricating our code into a module. I'm also looking into the legal contribution process, can someone point me to the "Committer Tools" where I need to fill out the Contribution Questionaire?

@boaks
Copy link
Contributor

boaks commented Jan 25, 2018

@sophokles73
Can you answer this? I guess, only committers can fill the CQ, right?

@LudwigSeitz
Copy link
Author

Would any one of you be able to spare the time for a short telco, to help us getting started with the first steps of the eclipse contribution procedure? The pdf @boaks linked to is a pretty intimidating place to start with. You can reach me at ludwig.seitz@ri.se

@sophokles73
Copy link
Contributor

sophokles73 commented Jan 26, 2018 via email

@vikram919
Copy link
Contributor

@LudwigSeitz
Hello,

Where can I find the repo for OSCORE CoAP? I am working on adding OSCORE for BACnet/IT, this would be really useful to perform some tests using object security.

Thank you!

@vikram919
Copy link
Contributor

I assume this is the repo for OSCORE CoAP with latest changes https://bitbucket.org/lseitz/oscoap_californium.git

@LudwigSeitz
Copy link
Author

The dev code can be found in this fork: https://bitbucket.org/lseitz/oscore
The one you are looking at is from a Masters Thesis.

@boaks
Copy link
Contributor

boaks commented Aug 23, 2018

Merging PR #679 makes now a basic OSCORE implementation available.

Unfortunately, the tests have revealed, that COSE uses/requires java 1.8, and so OSCORE can only be used, if java 1.8 is used.

For the other modules of californium we still want tu support java 1.7, therefore we run the unit test using java 1.7 which fails for OSOCRE. For now, I therefore skip the unit tests in the OSCORE pom, if java before 1.8 is used.

@LudwigSeitz
Copy link
Author

I don't think Java 1.8 is a hard requirement, I'll talk with Rikard and see if we can remove that.

@boaks
Copy link
Contributor

boaks commented Aug 23, 2018

For the oscore module, I removed the java 1.8 dependency (Integer.BYTES) already.
But the COSE libaray (com.augustcellars.cose) requires it. I'm not sure, if you can convince that project to support java 1.7.

@LudwigSeitz
Copy link
Author

LudwigSeitz commented Aug 23, 2018

I was under the impression that we had removed the dependency on the COSE lib. Let me double-check.

@boaks
Copy link
Contributor

boaks commented Aug 23, 2018

At least, the COSE pom compiles for target 1.8 and push that to maven central ...

@rikard-sics
Copy link
Contributor

My understanding is that Tobias extracted two files from the COSE library (Encrypt0Message.java & EncryptCommon.java) to be able to do some modifications to how the encryption is performed. But those files in turn have the COSE com.augustcellars.cose library as dependency and it is needed for the COSE functionality, and thus the OSCORE code requires Java 1.8.

So to make the code work with Java 1.7 I suppose there could be three options.

  1. Convince the developers of com.augustcellars.cose to support Java 1.7
  2. Fork and modify com.augustcellars.cose to provide support for Java 1.7
  3. Find or create some other code that is Java 1.7-compatible to provide the COSE functionality

Those points may be difficult to accomplish. If we cannot make the COSE library support Java 1.7, is it possible to have it so OSCORE is available but only for people running Java 1.8?

@boaks
Copy link
Contributor

boaks commented Aug 30, 2018

That's also my understanding.

Those points may be difficult to accomplish. If we cannot make the COSE library support Java 1.7, is it possible to have it so OSCORE is available but only for people running Java 1.8?

That's also my opinion. Therefore I made the test for OSCORE depend on java 1.8.
FMPOV, if we document it, that java 1.8 is required for OSCORE, it should be OK.

@rikard-sics
Copy link
Contributor

I have had some discussions with Ludwig and he has managed to create an alternative implementation of the OSCORE code that does not require Java 1.8. To achieve this we manually extract the specific files we need from the COSE (com.augustcellars.cose) library and because of that it is no longer a dependency for the code, and due to this it can now run on Java 1.7.

Is it better to let the current PR go through and then make a new PR with the code to allow running under Java 1.7? Or is it better to amend the current PR with the updated code?

@boaks
Copy link
Contributor

boaks commented Sep 4, 2018

The nasty kickback of copy and modify would be, that update and bugfixes are hard to manage. Hope, it doesn't happen too often.

Is it better to let the current PR go through and then make a new PR with the code to allow running under Java 1.7? Or is it better to amend the current PR with the updated code?

The "current PR" is merged. So, please fetch the current 2.0.x head and prepare your changes based on that. When you ready, create a new PR.

@rikard-sics
Copy link
Contributor

Okay, I see. Then we can proceed like that and submit a new PR to make the code able to run both under Java 1.7 and 1.8.

@LudwigSeitz
Copy link
Author

We don't expect many changes in the COSE code. It has gone through a number of interoperability tests and the standard is published and seems stable. If I interpret your (boaks) comments correctly, you are not fundamentally opposed to this solution?
If so we will do as you suggested, fetch 2.0.x and prepare a new PR that does not depend on the COSE-Java library anymore.

@boaks
Copy link
Contributor

boaks commented Sep 6, 2018

If I interpret your (boaks) comments correctly, you are not fundamentally opposed to this solution?

You know the COSE code better, so it's up to you.

If so we will do as you suggested, fetch 2.0.x and prepare a new PR that does not depend on the COSE-Java library anymore.

OK, but I guess, this will be more than 1000 lines, so be patient, when your PR is ready, it will require a next CQ :-).

@LudwigSeitz
Copy link
Author

754 new lines of code for including the necessary files from the COSE-Java lib. So I take it no CQ will be needed?

@boaks
Copy link
Contributor

boaks commented Sep 6, 2018

754 would be great.
But it's also crypto stuff, so I think, a CQ would be better.

@gselander
Copy link

Just on OSCORE versions: -16 has passed IESG review.

@boaks
Copy link
Contributor

boaks commented Mar 12, 2019

Thanks for the update!
Right now I updated also https://projects.eclipse.org/projects/technology.californium again (but it takes some time to get visible).

Contributed by joint project of Ericsson and RISE.

If full names should be included, please let me know, which one to use!

@rikard-sics
Copy link
Contributor

Right now I updated also https://projects.eclipse.org/projects/technology.californium again (but it takes some time to get visible).

Contributed by joint project of Ericsson and RISE.

If full names should be included, please let me know, which one to use!

Thanks, for the full name of RISE you could put RISE Research Institutes of Sweden.

@yemkay
Copy link

yemkay commented Sep 20, 2021

Hello, referring to the old discussion in this thread regarding "experimental", can you confirm if the OSCORE currently available in release 3.x is meant for production use. Thanks all!

@boaks
Copy link
Contributor

boaks commented Sep 20, 2021

Usually I try to list the state of the several RFCs in our Eclipse/Project-Page.

The main question for me is, what you assume to be relevant for using OSCORE in production.

  • practice/experience - AFAIK there not that much issues reported (e.g. the current issue OSCore observe seconde times occur MAC validation failed #1707)
  • support - that's still mainly a question to outside the current committers
  • improvements - that's still mainly a question to outside the current committers
  • compliance according the RFC - that's still mainly a question to outside the current committers

Or what makes something for you "meant for production"?

Should I reopen this issue? Or may be you create a new issue for OSCORE with your questions about "meant for production"? Maybe others have more information.

(My personal commitment is still the same as on begin of 2018.)

@yemkay
Copy link

yemkay commented Sep 20, 2021

Thanks @boaks. Good to know. We are in learning phase of OSCORE and were looking for libraries. Will log a seperate issue, in case of any queries.

@boaks
Copy link
Contributor

boaks commented Sep 20, 2021

You're welcome.

Usually there is a set of reason, why to chose one technology. Just in order, that your choice is not that fixed, you may have a look at DTLS 1.2 with CID. That's implemented. And comes with

The client libraries are currently under develop, mbedtls requires to get updated to the latest (hopefully final) version of the RFC.

@gselander
Copy link

@rikard-sics: Would you like to share some information on the status of OSCORE for Cf?

@yemkay
Copy link

yemkay commented Sep 20, 2021

Our choice of OSCORE was due to its "End to End encryption", which is especially useful when there are multiple hops between client and server.

Thanks for the suggestions. I believe, OSCORE is still the right choice for us. Please correct me if wrong.

@boaks
Copy link
Contributor

boaks commented Sep 20, 2021

"End to End encryption":

In both cases the IP and UDP message itself is not encrypted (at least not generally), but the UDP-payload is (DTLS, at least some parts), or the coap-message (OSOCRE, at least some parts). Anyway, everyone should go for the technology, which matches best.

If "hops" are coap-proxies, then that "hop" requires to see the coap-message (at least some parts of it).
If "hops" are just IP-nodes (e.g. router, k8s-proxy, NAT), then DTLS CID provides e2e security as well, because these hops are just need to see the UDP message.

@rikard-sics
Copy link
Contributor

rikard-sics commented Sep 20, 2021

Hello. Let me jump in with some comments from my side. I have been working as the main contributor of OSCORE to Californium.

It is true that OSCORE does provide end-to-end security (of the CoAP payload, CoAP code and many of the CoAP options (Option list)). This can allow OSCORE to be used via a CoAP proxy without exposing the payload and many of the options. There is also code as part of the JUnit tests showing how OSCORE can be ran between a client and server via a proxy.

Some points that @boaks listed:
Support - I try to keep a look out for any issues that are created related to OSCORE in the Californium repo, and fix or assist with any issues that come up. Additionally I am happy to provide support on how to get the OSCORE code running and any specific points on its usage.
Improvements - Currently I have no major plans for coming additions to the code, mostly small fixes, and possibly adding support for more encryption algorithms. This is in part because there has been no need for further additions as the OSCORE protocol is already implemented with support for things like block-wise and observe also. If there are requests for specific improvements I am happy to explore those.
Compliance according the RFC - We have ran interoperability tests to ensure that the code is consistent with the test vectors in the RFC for instance.

@yemkay
Copy link

yemkay commented Sep 21, 2021

@boaks Thanks for this. Our requirement is to cover both cases.

If "hops" are coap-proxies, then that "hop" requires to see the coap-message (at least some parts of it).
If "hops" are just IP-nodes (e.g. router, k8s-proxy, NAT), then DTLS CID provides e2e security as well, because these hops are just need to see the UDP message.

@rikard-sics Thank you. Glad to know.

@gselander
Copy link

Just adding to @boaks on the different properties of DTLS and OSCORE.

DTLS is targeting protection of UDP payload. OSCORE targets protection of REST operations independent of transport, so allows efficient end-to-end protection in a mix of HTTP/CoAP over various transports.

DTLS 1.2 was published in January 2012 and is widely deployed. OSCORE was published in July 2019 and is a part of a new suite of lightweight security protocols. During the period between these publications the benefits of low security overhead in particular for IoT applications was understood and this is reflected in OSCORE (and later in the record layer of DTLS 1.3), see e.g.:
https://datatracker.ietf.org/doc/html/draft-ietf-lwig-security-protocol-comparison-05#section-3.1

Looking ahead, both DTLS 1.2 and OSCORE are complemented with a lightweight version of OAuth 2.0 for authorization and access control in constrained environments (ACE) which is expected to soon become an IETF standard. Another progressed standardization activity in the IETF is OSCORE protection of group communication, e.g. protection of CoAP over multicast IP, which is an extension of RFC 8613. The ACE framework is also be used for authorizing access to the crypto keys in a group running OSCORE. There is also an extremely lightweight security handshake protocol in development (LAKE) significantly reducing the overhead of TLS/DTLS 1.2 & 1.3 handshakes. These latter components are still work in progress in the IETF although there are some implementations tested for interoperability.

Hope that helps.

@boaks
Copy link
Contributor

boaks commented Sep 29, 2021

DTLS is targeting protection of UDP payload. OSCORE targets protection of REST operations independent of transport, so allows efficient end-to-end protection in a mix of HTTP/CoAP over various transports.

That's interesting.

I didn't follow the specification process in the last months (years :-) ) . If I remember well, at least the initial versions seems to stick on coap artifacts in order to create a nonce (but I may be wrong). I'm wondering how that will make it into the http stuff. Are there working examples, which demonstrates the e2e encryption over a coap2http cross proxy?

@boaks
Copy link
Contributor

boaks commented Sep 29, 2021

Should I reopen this issue in order to try to include more people into the discussion about the use-cases?
(Or a new one?)

@gselander
Copy link

Are there working examples, which demonstrates the e2e encryption over a coap2http cross proxy?

I can't recall if this was tested during the interop testing of RFC 8613 but the basic example is in the RFC so should be straightforward to try out with access to a proxy implementation. There are examples of both HTTP-CoAP and CoAP-HTTP, here is the latter:
https://datatracker.ietf.org/doc/html/rfc8613#section-11.6

The end-to-end REST functionality was requested by Open Connectivity Foundation and the delegate was involved in the design.

the initial versions seems to stick on coap artifacts in order to create a nonce

I don't follow you there, which nonce is that?

@gselander
Copy link

Should I reopen this issue

I don't think that is necessary for now. It is a good that Cf has both DTLS and OSCORE functionality and as long as people seem to find it and questions are answered then mission is accomplished.

@boaks
Copy link
Contributor

boaks commented Sep 29, 2021

I don't follow you there, which nonce is that?

I may remember that wrong ;-). I never read it deep enough,

There are examples of both HTTP-CoAP and CoAP-HTTP, here is the latter:

I see now, it requires something as a plugin for the HTTP-server (or an application, which can handle it).
I will see, if I can extend the proxy2 to support that for Californium 3.1. (for 3.0 there is already too much still pending.)

@boaks
Copy link
Contributor

boaks commented Mar 28, 2022

@rikard-sics
@gselander

Let me come back to the current state of the OSCORE implementation for the projects status page

Experimental implementation of OSCORE (Object Security for Constrained RESTful Environments), (RFC 8613).
Contributed by joint project of Ericsson and RISE, Research Institutes of Sweden.

If wanted, we can adapt the text. Please provide a proposal.

@rikard-sics
Copy link
Contributor

Let me come back to the current state of the OSCORE implementation for the projects status page

Experimental implementation of OSCORE (Object Security for Constrained RESTful Environments), (RFC 8613).
Contributed by joint project of Ericsson and RISE, Research Institutes of Sweden.

If wanted, we can adapt the text. Please provide a proposal.

Yes, sounds good to update the description.

Let us have a discussion internally on this and I can come back with a proposal before Friday.

@boaks
Copy link
Contributor

boaks commented Mar 29, 2022

Just let me know, when you come to a conclusion and proposal.
There is no need to hurry from my side.

@boaks
Copy link
Contributor

boaks commented Apr 4, 2022

Let me add a remark about the API considerations:

Overall, many APIs in Californium are not that clear, if that belongs to something as the "public API" intended for general users, or a special extension, intended for special usage and may be required to change without major release.

I would appreciate, if you could check your API, and see, if the part, which should be used for general use-case is stable in your opinion.

From my experience, that sometime leads to develop just a new version of the module in parallel, as I did e.g. for the cf-proxy, I just added cf-proxy2 and deprecated the old one. That gives time to the users to migrate.

An other idea would be, if there large changes coming (e.g. the development in the scope of leshan), that first this changes are integrated and then the state of cf-oscore is changed. I don't have an overview about the usage of the current cf-oscore. So, if the API changes too much, it may be also considered to put that new work on a cf-oscore2.

FMPOV, just all "to be discussed".

@rikard-sics
Copy link
Contributor

Just let me know, when you come to a conclusion and proposal.
There is no need to hurry from my side.

After some internal discussions we arrived at the following text:

Implementation of OSCORE (RFC 8613)

If that sounds good to you we could go with that. Let me get back to the points in your latest post.

@boaks
Copy link
Contributor

boaks commented Apr 4, 2022

Replacing

Experimental implementation of OSCORE (Object Security for Constrained RESTful Environments), (RFC 8613).
Contributed by joint project of Ericsson and RISE, Research Institutes of Sweden.

with

Implementation of OSCORE (RFC 8613).
Contributed by joint project of Ericsson and RISE, Research Institutes of Sweden.

or

Implementation of OSCORE (RFC 8613).

?

@rikard-sics
Copy link
Contributor

Replacing

Experimental implementation of OSCORE (Object Security for Constrained RESTful Environments), (RFC 8613).
Contributed by joint project of Ericsson and RISE, Research Institutes of Sweden.

with

Implementation of OSCORE (RFC 8613).
Contributed by joint project of Ericsson and RISE, Research Institutes of Sweden.

or

Implementation of OSCORE (RFC 8613).

?

We were thinking simply replacing the entire current text with the following:
Implementation of OSCORE (RFC 8613).
(So also dropping the "acknowledgements")

@boaks
Copy link
Contributor

boaks commented Apr 4, 2022

OK.

@boaks
Copy link
Contributor

boaks commented Apr 4, 2022

Though for some other features I added the californium version, I added a 3.5.0 for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests