Skip to main content

A configuration tool for ignition based systems

Project description

afterglow

WARNING: Project is currently unstable, API's versions and tags can change at any moment

A configuration tool for ignition based systems.

Ignition-based systems have a 'one-shot' system configuration, which needs to be generally available to all instances. This means that if you are deploying a service that requires configured secrets, you might be tempted to place them in the Ignition config. However, doing so would involve storing secrets in plain text (potentially uploading them to a hosting service). Not only is this insecure, but it also doesn't truly solve the problem since these secrets are likely to rotate, rendering any static values in the Ignition configuration invalid. This service is intended to allow secret provisioning after boot, similar to how you would provision other servers. This aligns with the general principles of other configuration tools such as Ansible and Puppet

Principle of operation

This service uses ssh and scp to copy across configuration files and uses parent/child semantics where the parent provisions the child. A typical boot up flow may look like this:

  • Parent (CI/Local/Instance) boots up a new vm on some host provider
    • Parent needs to know the childs public key
    • Requires the parent knows the IP address of the child node
  • Child boots and runs afterglow child <...> providing private key
    Note: In someways this is just kicking the can down the road. We still need to get the secret key onto the child node. How exactly is up to you. Two solutions seems promising:
    • Add a volume mount to the instance through the host provider
    • Upload a custom FCOS|Flatcar|... image with a preshared key (symmetrical/asymetrical?) used to decrypt a private key in the ignition config
    • Some other trust mechanism through the host provider (aws secrets manager) with IAM permissions provided to the instance
  • Parent runs afterglow parent <...> including child public key connecting to child
  • Child initiates scp for each configured files.
  • Both parent and child process return exit code 0 on successful provisioning
  • Child writes lock file to --lock-path containing <file tag> = <sha256sum> key value pairs
    Note: The intention of this is to allow use of this in a systemd unit configuration for oneshot behaviour

In the case of copy failure the child process keeps running waiting up to timeout for a new parent connection which succeeds.

Roadmap

  • Add CI integration tests

Usage

Specify the mode either parent or child

usage: afterglow [-h] [parent | child] ...

Copy files from one machine to another

positional arguments:
  [parent | child]
    child           copy files onto this machine
    parent          copy files from this machine

Parent options

usage: afterglow parent [-h] --private-key PRIVATE_KEY --child-key CHILD_KEY --ip IP --port PORT --files FILES [FILES ...] [--timeout TIMEOUT]

options:
  -h, --help            show this help message and exit
  --private-key PRIVATE_KEY
                        Path to private key file
  --child-key CHILD_KEY
                        Path to childs public key
  --ip IP               The ip addres to connect to
  --port PORT           The port to connect to
  --files FILES [FILES ...]
                        Colon seperated file:path mapping
  --timeout TIMEOUT     The time window for which files are expeted to be copied across

Child options

usage: afterglow child [-h] --private-key PRIVATE_KEY --port PORT --files FILES [FILES ...] [--timeout TIMEOUT]

options:
  -h, --help            show this help message and exit
  --private-key PRIVATE_KEY
                        Path to private key file
  --port PORT           The port on which the server will listen
  --files FILES [FILES ...]
                        Colon seperated file:path mapping
  --lock-path LOCK_PATH Path to write the lock file to upon successfull provisioning
  --timeout TIMEOUT     The time window for which files are expeted to be copied across

Makefile

Simplify docker packaging

Dependencies

Docker or Podman (pass USE_PODMAN=1 to use podman)

The pyproject.toml file needs to have a version set correctly

Targets

  • build: Builds the Docker or Podman image using the specified Dockerfile and assigns appropriate tags based on the project's version defined in pyproject.toml.

  • run: Runs the Docker or Podman container with the specified runtime arguments (RUN_ARGS). It also allows additional runtime arguments to be passed (DOCKER_ARGS).

  • clean: Removes the Docker or Podman image and the running container associated with the project. It stops the running container, removes it, and deletes the image.

  • rebuild: clean build

  • rerun: rebuild run

  • push: Push image to docker hub

  • help: Show help information

Developing

Tech stack

Example invocations

Child

 docker run \
    -v ~/.ssh:/root/.ssh:ro \
    -v `pwd`:/host \
    -p 127.0.0.1:8022:8022 \
    dataligand/afterglow:latest child \
        --files test_file:/host/child/files \
        --lock-path /host/afterglow.lock \
        --private-key /root/.ssh/id_ed25519 \
        --port 8022

Parent

docker run \
  -v ~/.ssh:/root/.ssh:ro \
  -v `pwd`:/root/files:ro \
  --network host \
  dataligand/afterglow:latest parent \
      --files test_file:/root/files/test_file \
      --private-key /root/.ssh/id_ed25519 \
      --child-key /root/.ssh/id_ed25519.pub \
      --ip localhost \
      --port 8022

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

afterglow-0.1.0.dev0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distributions

afterglow-0.1.0.dev0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

afterglow-0.1.0.dev0-4-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

afterglow-0.1.0.dev0-3-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

afterglow-0.1.0.dev0-2-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

afterglow-0.1.0.dev0-1-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file afterglow-0.1.0.dev0.tar.gz.

File metadata

  • Download URL: afterglow-0.1.0.dev0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.3 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for afterglow-0.1.0.dev0.tar.gz
Algorithm Hash digest
SHA256 a117b7befaf902a8a7f5ca76b76d18b660a3fdece9c761b0652de573bfdc8827
MD5 38524b337435a8746e03119b9fe6e0ee
BLAKE2b-256 36598e891365853b069e506a19602c1aeac8d2473aa0d48f772219a77e2a12f2

See more details on using hashes here.

File details

Details for the file afterglow-0.1.0.dev0-py3-none-any.whl.

File metadata

  • Download URL: afterglow-0.1.0.dev0-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.3 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for afterglow-0.1.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 df98566c98259299ab42ae65e3c14a19a89f5324c8aa0b33e09cc0deec77e55a
MD5 b7141f530fb1274a88e6ebbf1687c36f
BLAKE2b-256 dc1b60e3e669b5a814e6d34063363ef6872bcb8e4cfe0fdfa302cf98417efdeb

See more details on using hashes here.

File details

Details for the file afterglow-0.1.0.dev0-4-py3-none-any.whl.

File metadata

  • Download URL: afterglow-0.1.0.dev0-4-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.3 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for afterglow-0.1.0.dev0-4-py3-none-any.whl
Algorithm Hash digest
SHA256 2e4a62c7c0822dd1f3774951c648f52f8ba0aea0609944c0c6c1fc693ef50a10
MD5 955970b04040bf62f7f4af480642dd13
BLAKE2b-256 1c4e0553a79f0c38cf45ae183d1815e087813fe9e069e797b59a9ae3dcfc77a8

See more details on using hashes here.

File details

Details for the file afterglow-0.1.0.dev0-3-py3-none-any.whl.

File metadata

  • Download URL: afterglow-0.1.0.dev0-3-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.3 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for afterglow-0.1.0.dev0-3-py3-none-any.whl
Algorithm Hash digest
SHA256 de09e3e409c584397b7638c50ea262ed82105e3dbaf5302cfe4be9f7ac2fa0c9
MD5 f4a29e2b34ec18757850d4ec79276da1
BLAKE2b-256 65d6750c88ecd6c60c76125cfbd6d6f6a65c2b2ec2f5d41d18c88c974ad06548

See more details on using hashes here.

File details

Details for the file afterglow-0.1.0.dev0-2-py3-none-any.whl.

File metadata

  • Download URL: afterglow-0.1.0.dev0-2-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.3 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for afterglow-0.1.0.dev0-2-py3-none-any.whl
Algorithm Hash digest
SHA256 4fdea11af7f868801c1ccaa753c598abc1c86d1c965a9ca48da60d60c9516625
MD5 8ad7acda0b747afd5cfbe94f8c549a3b
BLAKE2b-256 fb96b50841c5c49637b177524fdde345d1d096691b96e46ed059951cc3a65cd8

See more details on using hashes here.

File details

Details for the file afterglow-0.1.0.dev0-1-py3-none-any.whl.

File metadata

  • Download URL: afterglow-0.1.0.dev0-1-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.11.3 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for afterglow-0.1.0.dev0-1-py3-none-any.whl
Algorithm Hash digest
SHA256 1115e327dceb77119f10ab2c2795321c0329686294dc397e2b7e97af2eff7a5c
MD5 cbed0e33a30a442ba07b3af62e49958d
BLAKE2b-256 60034a1fb48e522c48e891f736d7ba39a6c278d1fa6ff946ec8300a04a22e405

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page