Giter Site home page Giter Site logo

cl-unix-cybernetics 0.4.0

UNIX cybernetics in Common Lisp.

You describe your systems (hosts) using resources having properties.

The properties are then probed and synchronized using only /bin/sh on the remote host, and /usr/bin/ssh on the control host.

Current status

There is support for local shell and connection to remote hosts via ssh.

Using only /bin/sh commands makes ksh and bash suitable shells as they are compatible with /bin/sh.

Supported resource types :

  • Host (hostname)
  • User (useradd, usermod, userdel)
  • Group (groupadd, groupmod, groupdel)
  • File (owner, group, permissions, content)
  • Directory (owner, group, permissions)
  • Package (Debian, OpenBSD)

Security design

You should only allow what you would allow your system operators :

  • a shell accessible through SSH using a public key
  • apropriate sudo permissions

All commands issued to the remote hosts can be logged.

Does not grant the hosts access to its workstation while it works. Does not grant access to data belonging to any host. Does not send any data that is not of direct concern to the host. In short, all UNIX permissions are respected.

Usage

1. Install repo.

2. Fetch sources.

  $ sbcl --eval '(repo:install :cl-unix-cybernetics)'

3. Build and install the cl-unix-cybernetics binary

  $ cd ~/common-lisp/thodg/cl-unix-cybernetics
  $ make
  $ sudo cp build/cl-unix-cybernetics /usr/local/bin/

4. Write some resources in a .lisp script

In the tutorial.lisp file :

  #!/usr/local/bin/cl-unix-cybernetics --script

  (resource 'host "example.kmx.io"
            :user "sysadm"
            (resource 'user "sysadm"
                      :shell "/bin/sh"
                      :ensure :present))

  (with-host "example.kmx.io"
    (sync *host*))

6. Profit.

  $ chmod 755 tutorial.lisp
  $ ./tutorial.lisp

The tutorial.lisp script will synchronize the host "example.kmx.io" according to the resource specifications given in the file.

7. DRY up your scripts using #.(include "file")

In the user/dx.lisp file :

  ;; Thomas de Grivel (kmx.io)
  (resource 'group "dx"
            :gid 19256
            :ensure :present)
  (resource 'user "dx"
            :uid 19256
            :gid 19256
            :home "/home/dx"
            :ensure :present)

In your main script :

  #!/usr/local/bin/cl-unix-cybernetics --script

  (resource 'host "example.kmx.io"
            :user "admin"
            (resource 'user "admin"
                      :shell "/bin/sh"
                      :ensure :present)
            #.(include "user/dx"))

  (with-host "example.kmx.io"
    (sync *host*))

History

This project used to be named "Adams". It was renamed in 2022 to "cl-unix-cybernetics".

Authors

Thomas de Grivel [email protected]

cl-unix-cybernetics's Projects

ironclad icon ironclad

A cryptographic toolkit written in Common Lisp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.