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

worker: append collections credentials an adaptor #778

Closed
josephjclark opened this issue Sep 25, 2024 · 2 comments
Closed

worker: append collections credentials an adaptor #778

josephjclark opened this issue Sep 25, 2024 · 2 comments

Comments

@josephjclark
Copy link
Collaborator

josephjclark commented Sep 25, 2024

The worker needs to take the run token JWT and write it to the credential of every run. It also needs to add the collections adaptor to every step (probably we do this bit as part of #777 actually - and we can only do it when we have a working adaptor (a stub one would be fine))

It should write the token as collections_key

Job code will see the key and credential, but it's harmless and safe.

Maybe later we'll only append the credential for jobs which we know use the collections API. But I think to start with we'll switch it on for everyone by default.

Note that the run token JWT is totally safe and secure. It doesn't matter if users or attackers get hold of it:

  • It has a short lease
  • It cannot be used in any lightning or worker REST endpoint
  • It can only be used in a web socket to lightning and a different JWT token is needed to connect to the socket

The absolute worst case, from a security point of view, is that an attacker gets hold of the worker token and is able to connect to the socket. Then, while the token is unexpired and the run is active, they can only access credentials and dataclips related to that project. Frankly, if you want a credential related to that project, there are far easier ways to steal it.

@github-project-automation github-project-automation bot moved this to New Issues in v2 Sep 25, 2024
@josephjclark josephjclark changed the title worker: append collections credentials worker: append collections credentials an adaptor Sep 25, 2024
@stuartc stuartc moved this from New Issues to Backlog in v2 Oct 7, 2024
@josephjclark
Copy link
Collaborator Author

We also have to append the collection adaptor to every workflow.

I would really like to use a heuristic to decide whether to do this, because it's strange to see the collection adaptor being loaded in logging. We should be able to tell with a simple scan of the expressions whether collections. is being called, and then just harmlessly load it

Later, Lightning itself should make the decision to include a collection adaptor based on some user input

@josephjclark
Copy link
Collaborator Author

Done in #801

@github-project-automation github-project-automation bot moved this from Backlog to Done in v2 Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant