kalipso 54c0e8a46b [nix] add base integration test
run it using 'nix flake check -L'
2023-10-31 15:01:35 +01:00
2023-10-31 13:12:50 +01:00
2023-10-31 02:50:25 +01:00
2023-10-31 15:01:35 +01:00
2023-10-31 14:46:45 +01:00
2023-10-31 00:51:36 +01:00
2023-10-30 20:00:43 +01:00
2023-10-31 15:01:35 +01:00
2023-10-31 00:51:36 +01:00
2023-10-31 14:47:03 +01:00

gokill

'gokill' is a tool that completes some actions when a certain event occurs. actions can vary from shuting down the machine to sending mails over erasing data. actions can be triggert by certain conditions like specific outcomes of unix comands or not having internet connection.

actions and triggers should be easy to extend and handled like plugins. they also should be self documenting. every action and trigger should be testable at anytime as a 'dry-run'. actions can have a 'stage' defined. the lowest stage is started first, and only when all actions on that stage are finished next stage is triggered

gokill should run as daemon. config should be read from /etc/somename/config.json

Config Example

[ //list of triggers
    {
		"type": "UsbDisconnect",
		"name": "First Trigger",
		"options": {
			"deviceId": "ata-Samsung_SSD_860_EVO_1TB_S4AALKWJDI102",
			"waitTillConnected": true //only trigger when usb drive was actually attached before
		}
        "actions": [ //list of actions that will be executed when triggered
            {
                "name": "unixCommand",
                "options": {
                    "command": "shutdown -h now"
                },
                "stage": 2 // defines the order in which actions are triggered.
            },
            {
                "type": "sendMail",
                "options": {
                    "smtpserver": "domain.org",
                    "port": 667,
                    "recipients": [ "mail1@host.org", "mail2@host.org" ],
                    "message": "kill switch was triggered",
                    "attachments": [ "/path/atachments" ],
                    "pubkeys": "/path/to/keys.pub"
                },
                "stage": 1 //this event is triggered first, then the shutdown
            },
        ]
    },
    {
		"type": "EthernetDisconnect",
		"name": "Second Trigger",
		"options": {
			"interfaceName": "eth0",
		}
        "actions": [
            {
                "name": "unixCommand",
                "options": {
                    "command": "env DISPLAY=:0 sudo su -c i3lock someUser"
                }
            }
        ]
    }
]

nix support

gokill enjoys full nix support. gokill exposes a nix flakes that outputs a gokill package, a nixosModule and more. That means you can super easily incorporate gokill into your existing nixosConfigurations. Here is a small example config:

{
  services.gokill.enable = true;
  services.gokill.triggers = [
    {
      type = "EthernetDisconnect";
      name = "MainTrigger";
      options = {
        interfaceName = "eth1";
      };
      actions = [
        {
            type = "Command";
            options = {
                command = "echo hello world";
            };
            stage = 1;
        }
      ];
    }
  ];
}

This will automatically configure and enable a systemd running gokill as root user in the background

actions

  • shutdown
  • wipe ram
  • send mail
  • delete data
  • shred area
  • random command
  • wordpress post
  • ipfs command
  • buskill 'triggers'
    • lock-screen
    • shutdown
    • luks header shredder
    • veracrypt self-destruct

Triggers

  • no internet
  • pull usb stick
  • ethernet unplugged
  • power adapter disconnected
  • unix command
  • anyOf
    • trigger wrapper containing many triggers and fires as soon as one of them is triggered
  • allOf
  • ipfs trigger
Description
No description provided
Readme 3.2 MiB
Languages
Go 85.7%
Nix 14.3%