Skip to content

soerenschneider/sc-agent

Repository files navigation

sc-agent

Go Report Card test-workflow release-workflow golangci-lint-workflow openapi-spec

Code, API and README is still work in progress

Table of Contents

  1. Overview
  2. Features
  3. Installation
    1. Configuration
  4. Development Workflow
  5. Security Considerations
  6. Components

Overview

Configurable daemon that provides common features needed on virtual machine instances running in my hybrid cloud.

Features

🔑 Sync secrets from Vault
🏭 Manage x509 and SSH certificates
📦 Start, stop and restart libvirt domains and systemd units
📫 Monitor system updates
🚦 Automatic shutdown, reboot and waking-up of hardware unit

Development Workflow

OpenAPI Spec

Development is done "API first", therefore server code and client code are auto-generated using oapicodegen and should not be changed by hand.

The OpenAPI 3 spec file is defined here and a swagger like page is available at the path /docs of the API server.

Generating server and client code

> make generate

Linting

Linting is done via spectral using the default OpenAPI configuration.

Detecting API / code configuration drift

A GitHub Actions workflow is in-place that runs code-generation on every commit and fails if the generated code doesn't match the committed code.

Security Considerations

Authentication

The default mode is using mTLS to authenticate against the server that serves the REST API. A middleware is available that validates request based on the CommonName attribute or EmailAddresses attributes of the certificate.

Although strongly discouraged, the server can be configured to run without any authentication for development purposes.

Authorization

All successfully authenticated users share the same permissions, no distinguished roles are available.

Components

K0s

  • start K0s service
  • stop K0s service

libvirt

  • start a libvirt domain
  • shutdown a libvirt domain
  • restart a libvirt domain

packages

  • list installed packages on a system
  • list updateable packages on a system
  • upgrade all packages

pki

  • sign ssh public keys
  • get ssh signatures configuration

secrets

  • replicate secrets from Hashicorp Vault to the local system
  • get repliaction configuration

services

  • set status of system services (restarted, started, stopped)
  • get logs of a system services

system

  • set power status of system (reboot, shutdown)
  • get status of conditional-reboot
  • set status of conditional-reboot (paused, unpaused)

Wake-on-Lan

  • Send WOL packets to wake up local machines

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •  

Languages