Commit Graph

6 Commits (425a5909b83a26661f02fc94ca08bde6dcdecc0c)

Author SHA1 Message Date
Dustin 425a5909b8 ci: Begin Jenkins build pipeline
dustin/dynk8s-provisioner/pipeline/head There was a failure building this commit Details
2022-09-06 11:39:30 -05:00
Dustin ac1b20d910 sns: Save messages to disk
Upon receipt of a notification or unsubscribe confirmation message from
SNS, after the message signature has been verified, the receiver will
now write the re-serialized contents of the message out to the
filesystem.  This will allow the messages to be inspected later in order
to develop additional functionality for this service.

The messages are saved in a `messages` director within the current
working directory.  This directory contains a subdirectory for each SNS
topic.  Within the topic subdirectories, the each message is saved in a
file named with the message timestamp and ID.
2022-09-05 09:45:44 -05:00
Dustin ab45823654 Begin HTTP server, SNS message receiver
This commit introduces the HTTP interface for the dynamic K8s node
provisioner.  It will serve as the main communication point between the
ephemeral nodes in the cloud, sharing the keys and tokens they require
in order to join the Kubernetes cluster.

The initial functionality is simply an Amazon SNS notification receiver.
SNS notifications will be used to manage the lifecycle of the dynamic
nodes.

For now, the notification receiver handles subscription confirmation
messages by following the link provided to confirm the subscription.
All other messages are simply written to the filesystem; these will be
used to implement and test future functionality.
2022-09-03 22:58:23 -05:00
Dustin 3ce72623e6 model: sns: Add union type
The `model::sns::Message` enumeration provides a mechanism for
deserializing a JSON document into the correct type.  It will be used by
the HTTP operation that receives messages from SNS in order to determine
the correct action to take in response to the message.
2022-09-03 22:57:07 -05:00
Dustin 196a43c49c sns: Begin work on Amazon SNS message handling
In order to prevent arbitrary clients from using the provisioner to
retrieve WireGuard keys and Kubernetes bootstrap tokens, access to those
resources *must* be restricted to the EC2 machines created by the
Kubernetes Cloud Autoscaler.  The key to the authentication process will
be SNS notifications from AWS to indicate when new EC2 instances are
created; everything that the provisioner does will be associated with an
instance it discovered through an SNS notification.

SNS messages are signed using PKCS#1 v1.5 RSA-SHA1, with a public key
distributed in an X.509 certificate.  To ensure that messages received
are indeed from AWS, the provisioner will need to verify those
signatures.  Messages with missing or invalid signatures will be
considered unsafe and ignored.

The `model::sns` module includes the data structures that represent SNS
messages.  The `sns::sig` module includes the primitive operations for
implementing signature verification.
2022-09-01 18:22:22 -05:00
Dustin 90e5bd65ca Initial commit 2022-08-31 21:02:17 -05:00