-
Notifications
You must be signed in to change notification settings - Fork 309
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
[WIP] Feature: pgp flux app signer #1212
Open
MorningLightMountain713
wants to merge
18
commits into
RunOnFlux:development
Choose a base branch
from
MorningLightMountain713:feature/pgp_app_signer
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[WIP] Feature: pgp flux app signer #1212
MorningLightMountain713
wants to merge
18
commits into
RunOnFlux:development
from
MorningLightMountain713:feature/pgp_app_signer
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addresses #1128 |
Here is an example on an app on one of my nodes: You would normally get the identity on one node and send it to the other, they would create the challenge and send it back to you, then you decrypt and send the response back to prove you are who you say you are. /app # curl -s app.identity.service/nodeidentity | jq .
{
"status": "success",
"data": {
"txhash": "nodetxhashhere",
"outidx": 0
}
}
/app # curl -s -H 'Content-Type: application/json' app.identity.service/createchallenge --data '{"identity": "nodetxhashhere"}' | jq .
{
"status": "success",
"data": {
"message": "7ac2b1e60bf96fd8524c38d330b4e3f5",
"encrypted": "-----BEGIN PGP MESSAGE-----\n\nwV4Dc/5AJeD9oo8SAQdAumMrrbMtBGlO8VhsvnvgsGxOEJPtYYQXLCteMuKA\nrlIwUxMhRm38MjaDL75VJi1EPrxuz3gOvdkasmQ+C6+pWSiLiRMxwBwZcoUG\nuiTeSFRF0ncB5Ia99+3wWhD+97xsE9YqExvNDzeqKX4Z4byozDUpoA1dq8J7\np5FlkmFS6ErV/VzBot/Jg1a7VFYp2dGZUsmnlpoOcZUENbAXJCxn/yyLYUL9\n6xNfV/+zg/6/5UiSLyC4rEIeOkWfHtE27M/UOLfNSdcd3/8r0A==\n=WuFO\n-----END PGP MESSAGE-----\n"
}
}
/app # curl -s -H 'Content-Type: application/json' app.identity.service/decryptchallenge --data '{"encrypted": "-----BEGIN PGP MESSAGE-----\n\
nwV4Dc/5AJeD9oo8SAQdAumMrrbMtBGlO8VhsvnvgsGxOEJPtYYQXLCteMuKA\nrlIwUxMhRm38MjaDL75VJi1EPrxuz3gOvdkasmQ+C6+pWSiLiRMxwBwZcoUG\nuiTeSFRF0ncB5Ia99
+3wWhD+97xsE9YqExvNDzeqKX4Z4byozDUpoA1dq8J7\np5FlkmFS6ErV/VzBot/Jg1a7VFYp2dGZUsmnlpoOcZUENbAXJCxn/yyLYUL9\n6xNfV/+zg/6/5UiSLyC4rEIeOkWfHtE27M/
UOLfNSdcd3/8r0A==\n=WuFO\n-----END PGP MESSAGE-----\n"}' | jq .
{
"status": "success",
"data": "7ac2b1e60bf96fd8524c38d330b4e3f5"
}
/app # |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This ones a pretty big deal in my opinon. Mostly done - just need a bit more real world testing and some unittests. (and check the networking)
Allows Flux apps to validate each other. So you can be sure that the inbound / outbound sockets are authenticated between apps.
Background:
Flux has an issue whereby you want to inject private data into running apps, like databases, secrets etc. This in the past has been done by FluxVault. When the app starts up, FluxVault connects to it and gives it some config. This is reliant on the public ip address, and more importantly, there is no secure way for a node to reach out to the vault and identify itself.
Now you can!
It means you can seed a FluxApp once - and then nodes can go to other nodes to get their config / secrets!
What this pull does:
Adds a service that is available to flux docker networks on the hostname
http://app.identity.service:80
where applications can request a message signed by the node.The cleartext message and encrypted message are returned to the flux application. The encrypted message contains the appname (based off container source IP by inspecting docker networks) so it is authentication on a per app basis per fluxnode.
There is also an endpoint to decrypt a message - the other end would use this, then send the cleartext message back to prove that they are part of the "app group"
This app signer service has 3 endpoints:
Suggested mesage flow for an app:
I will edit this writeup and expand a bit... just want to get this pull in.
I was going to pre fetch / cache all the pgp keys for any apps that are deployed on a node, but I'm not sure if this will actually benefit as I'm not sure how fast the application started messages are broadcast. I.e. will a new docker app spin up before the message has reached the target node. I'll do some more testing / thinking around this.