-
Notifications
You must be signed in to change notification settings - Fork 94
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
Generate authentication keys #3478
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really a proper review. Just quickly read it to know more or less what's changing. But great improvements with f-strings, and also good unit tests! 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a few small comments which should be quick fixes. Namely we need to swap the order in which we set permissions and move files to make sure they don't become vulnerable in between.
(@dpmatthews plans to take a close look, and do some testing, before others pitch in here) |
@dpmatthews and I have just been through this together. I think it is now ready for review, @hjoliver I will add you to the list of reviewers. Thank you to all for the comments so far. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Works end-to-end WFS <=> UIS <=> UI
2020-01-24T17:01:08+13:00 DEBUG - Starting
2020-01-24T17:01:08+13:00 DEBUG - auth received API command b'CURVE'
2020-01-24T17:01:08+13:00 DEBUG - Configure curve: *[/home/sutherlander/cylc-run/baz/.service/client_public_keys]
.
.
.
2020-01-24T17:01:47+13:00 DEBUG - version: b'1.0', request_id: b'1', domain: '', address: '127.0.0.1', identity: b'', mechanism: b'CURVE'
2020-01-24T17:01:47+13:00 DEBUG - ALLOWED (CURVE) domain=* client_key=b'@:LiHf*406UmxVmgT1dyY.tZ3gN3:XhZxXv?/i{Q'
2020-01-24T17:01:47+13:00 DEBUG - ZAP reply code=b'200' text=b'OK'
2020-01-24T17:02:11+13:00 DEBUG - version: b'1.0', request_id: b'1', domain: '', address: '127.0.0.1', identity: b'', mechanism: b'CURVE'
2020-01-24T17:02:11+13:00 DEBUG - ALLOWED (CURVE) domain=* client_key=b'@:LiHf*406UmxVmgT1dyY.tZ3gN3:XhZxXv?/i{Q'
2020-01-24T17:02:11+13:00 DEBUG - ZAP reply code=b'200' text=b'OK'
2020-01-24T17:02:11+13:00 INFO - [client-command] release_suite sutherlander@cortex-vbox:cylc-release
.
.
.
Definitely some improvements ... Will have another read and try to think about it in the wider context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good.
Tested as working including remote functionality 🚀
Cylc creates the two keys we expect it to; client (cli) and server (ser) both in public (pub) and private (pri) variants:
@localhost
~/cylc-run/suite/.service/
- cli-pri
client.key_secret
- cli-pub
client_public_keys/client.key
- ser-pri
server.key_secret
- ser-pub
server.key
- cli-pri
On the remote hosts Cylc copies two keys across:
@remotehost
~/cylc-run/<suite>/.service/
- cli-pri
client.key_secret
- ser-pub
server.key
- cli-pri
(I find the filenames curve/zmq uses for these keys really darned confusing).
Note: Copying the private client key is bad security but this is set aside for future work #3443
A quick rebase and we are good to go! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remote tests now working fine for me
- Change file permissions for public/private keys - Stop keys being regenerated - Tests added. Remove passphrase bits breaking functional tests
Replaced **kwargs from suite_files keyinfo object init Fixed suite names in tests.
2bcb0a0
to
018cfe5
Compare
I suspect this PR will result in further changes to code so I will squash once fully ready to be merged.
Keys are now all stored in the .service directory of the suite rather than the client keys atored in the .cylc directory.
Keys are no longer regenerated - cylc errors are raised instead
This has been left extensible for future multiple platform key generation.
Closes #3444
Closes #3445
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.