From e8c30b428e9f798cfe7615c15ef59771f0a825df Mon Sep 17 00:00:00 2001 From: Tyler Cook <10459406+cilki@users.noreply.github.com> Date: Thu, 26 Dec 2024 22:37:34 -0600 Subject: [PATCH] wip: begin to convert osquery schemas to structs --- Vagrantfile | 28 +--- .../core/integration/osquery/Installer.java | 142 ------------------ .../core/integration/osquery/OQSession.java | 88 ----------- .../src/main/json/Profile/BlockDevice.json | 58 ------- .../src/main/json/Profile/Cpu.json | 41 ----- .../src/main/json/Profile/Cpu/Core.json | 15 -- .../src/main/json/Profile/Disk.json | 72 --------- .../src/main/json/Profile/Disk/Partition.json | 46 ------ .../src/main/json/Profile/Disk/Smart.json | 91 ----------- .../src/main/json/Profile/Display.json | 36 ----- .../src/main/json/Profile/FirefoxAddon.json | 95 ------------ .../src/main/json/Profile/Firmware.json | 47 ------ .../src/main/json/Profile/HostEntry.json | 17 --- .../src/main/json/Profile/KernelModule.json | 35 ----- .../src/main/json/Profile/Mainboard.json | 29 ---- .../src/main/json/Profile/Memory.json | 59 -------- .../src/main/json/Profile/Memory/Device.json | 125 --------------- .../src/main/json/Profile/Memory/Map.json | 23 --- .../src/main/json/Profile/Mountpoint.json | 70 --------- .../src/main/json/Profile/Network.json | 21 --- .../main/json/Profile/Network/ArpEntry.json | 29 ---- .../main/json/Profile/Network/BoundPort.json | 59 -------- .../src/main/json/Profile/Network/Route.json | 55 ------- .../src/main/json/Profile/Nic.json | 141 ----------------- .../src/main/json/Profile/Nic/Windows.json | 25 --- .../src/main/json/Profile/Os.json | 71 --------- .../src/main/json/Profile/Process.json | 125 --------------- .../src/main/json/Profile/Process/Fd.json | 14 -- .../main/json/Profile/Process/Namespace.json | 39 ----- .../src/main/json/Profile/Process/Socket.json | 70 --------- .../src/main/json/Profile/Sensor.json | 19 --- .../src/main/json/Profile/SoundCard.json | 21 --- .../src/main/json/Profile/UsbDevice.json | 38 ----- .../src/main/json/Profile/User.json | 40 ----- .../src/main/json/Profile/UserGroup.json | 29 ---- .../core/integration/systemd/Systemctl.java | 60 -------- .../core/integration/systemd/SystemdLog.java | 24 --- .../integration/systemd/SystemdService.java | 69 --------- plugin/sandpolis-plugin-device/README.md | 8 - .../plugin/filesystem/cmd/FilesystemCmd.java | 33 ---- .../plugin/filesystem/mount/FuseDriver.java | 42 ------ sandpolis/Cargo.toml | 4 +- sandpolis/src/client/ui/layer/mod.rs | 2 + sandpolis/src/core/layer/mod.rs | 7 + .../core/layer/{device.rs => probe/mod.rs} | 32 ++-- .../layer/sysinfo/applications/firefox.rs | 30 ++++ .../core/layer/sysinfo/hardware/battery.rs | 61 +++----- .../src/core/layer/sysinfo/hardware/cpu.rs | 21 +++ .../core/layer/sysinfo/hardware/disk/mod.rs | 26 ++++ .../layer/sysinfo/hardware/disk/partition.rs | 16 ++ .../core/layer/sysinfo/hardware/disk/smart.rs | 34 +++++ .../core/layer/sysinfo/hardware/display.rs | 12 ++ .../core/layer/sysinfo/hardware/firmware.rs | 14 ++ .../core/layer/sysinfo/hardware/mainboard.rs | 8 + .../src/core/layer/sysinfo/hardware/memory.rs | 40 +++++ .../src/core/layer/sysinfo/hardware/nic.rs | 56 +++++++ .../src/core/layer/sysinfo/hardware/sensor.rs | 6 + .../src/core/layer/sysinfo/hardware/sound.rs | 6 + .../src/core/layer/sysinfo/hardware/usb.rs | 12 ++ .../src/core/layer/sysinfo/os/block_device.rs | 18 +++ sandpolis/src/core/layer/sysinfo/os/group.rs | 8 + .../core/layer/sysinfo/os/kernel_module.rs | 10 ++ sandpolis/src/core/layer/sysinfo/os/memory.rs | 18 +++ sandpolis/src/core/layer/sysinfo/os/mod.rs | 20 +++ .../src/core/layer/sysinfo/os/mountpoint.rs | 22 +++ .../src/core/layer/sysinfo/os/network/arp.rs | 8 + .../layer/sysinfo/os/network/bound_port.rs | 18 +++ .../core/layer/sysinfo/os/network/hosts.rs | 4 + .../src/core/layer/sysinfo/os/network/mod.rs | 6 + .../core/layer/sysinfo/os/network/route.rs | 20 +++ .../src/core/layer/sysinfo/os/process/fd.rs | 4 + .../src/core/layer/sysinfo/os/process/mod.rs | 42 ++++++ .../layer/sysinfo/os/process/namespace.rs | 14 ++ .../core/layer/sysinfo/os/process/socket.rs | 22 +++ sandpolis/src/core/layer/sysinfo/os/user.rs | 12 ++ sandpolis/src/core/mod.rs | 18 ++- 76 files changed, 590 insertions(+), 2210 deletions(-) delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/java/org/s7s/core/integration/osquery/Installer.java delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/java/org/s7s/core/integration/osquery/OQSession.java delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/BlockDevice.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Cpu.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Cpu/Core.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Disk.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Disk/Partition.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Disk/Smart.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Display.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/FirefoxAddon.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Firmware.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/HostEntry.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/KernelModule.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Mainboard.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Memory.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Memory/Device.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Memory/Map.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Mountpoint.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network/ArpEntry.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network/BoundPort.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network/Route.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Nic.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Nic/Windows.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Os.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process/Fd.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process/Namespace.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process/Socket.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Sensor.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/SoundCard.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/UsbDevice.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/User.json delete mode 100644 core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/UserGroup.json delete mode 100644 core/ext/sandpolis-core-ext-systemd/src/main/java/org/s7s/core/integration/systemd/Systemctl.java delete mode 100644 core/ext/sandpolis-core-ext-systemd/src/main/java/org/s7s/core/integration/systemd/SystemdLog.java delete mode 100644 core/ext/sandpolis-core-ext-systemd/src/main/java/org/s7s/core/integration/systemd/SystemdService.java delete mode 100644 plugin/sandpolis-plugin-device/README.md delete mode 100644 plugin/sandpolis-plugin-filesystem/src/main/java/org/s7s/plugin/filesystem/cmd/FilesystemCmd.java delete mode 100644 plugin/sandpolis-plugin-filesystem/src/main/java/org/s7s/plugin/filesystem/mount/FuseDriver.java rename sandpolis/src/core/layer/{device.rs => probe/mod.rs} (71%) create mode 100644 sandpolis/src/core/layer/sysinfo/applications/firefox.rs rename core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Battery.json => sandpolis/src/core/layer/sysinfo/hardware/battery.rs (55%) create mode 100644 sandpolis/src/core/layer/sysinfo/hardware/cpu.rs create mode 100644 sandpolis/src/core/layer/sysinfo/hardware/disk/mod.rs create mode 100644 sandpolis/src/core/layer/sysinfo/hardware/disk/partition.rs create mode 100644 sandpolis/src/core/layer/sysinfo/hardware/disk/smart.rs create mode 100644 sandpolis/src/core/layer/sysinfo/hardware/display.rs create mode 100644 sandpolis/src/core/layer/sysinfo/hardware/firmware.rs create mode 100644 sandpolis/src/core/layer/sysinfo/hardware/mainboard.rs create mode 100644 sandpolis/src/core/layer/sysinfo/hardware/memory.rs create mode 100644 sandpolis/src/core/layer/sysinfo/hardware/nic.rs create mode 100644 sandpolis/src/core/layer/sysinfo/hardware/sensor.rs create mode 100644 sandpolis/src/core/layer/sysinfo/hardware/sound.rs create mode 100644 sandpolis/src/core/layer/sysinfo/hardware/usb.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/block_device.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/group.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/kernel_module.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/memory.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/mod.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/mountpoint.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/network/arp.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/network/bound_port.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/network/hosts.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/network/mod.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/network/route.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/process/fd.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/process/mod.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/process/namespace.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/process/socket.rs create mode 100644 sandpolis/src/core/layer/sysinfo/os/user.rs diff --git a/Vagrantfile b/Vagrantfile index 5037122b2..435111546 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,40 +2,24 @@ Vagrant.configure("2") do |config| config.vm.define "linux" do |linux| linux.vm.box = "archlinux/archlinux" - linux.vm.synced_folder ".", "/home/vagrant/sandpolis" + linux.vm.synced_folder ".", "/home/vagrant/sandpolis", type: "nfs", nfs_version: 4 linux.vm.provider "virtualbox" do |virtualbox| virtualbox.memory = 8192 virtualbox.cpus = 16 end + linux.vm.provider "libvirt" do |libvirt| + libvirt.memory = 8192 + libvirt.cpus = 16 + end + # Configure environment linux.vm.provision :shell, :inline => "hostnamectl set-hostname sandpolis_linux && locale-gen en_US.UTF.8" linux.vm.provision :shell, :inline => "pacman -Syu --noconfirm binutils gcc make git wget vim python-pip npm linux-headers" - # Install Java - linux.vm.provision :shell, :inline => "wget -q -O- https://download.java.net/java/early_access/panama/3/openjdk-17-panama+3-167_linux-x64_bin.tar.gz | tar zxf -" - linux.vm.provision :shell, :inline => "echo 'export JAVA_HOME=/home/vagrant/jdk-17' >>/home/vagrant/.bash_profile" - # Install Rust linux.vm.provision :shell, :inline => "curl https://sh.rustup.rs -sSf | sh -s -- -y" - - # Install Swift - linux.vm.provision :shell, :inline => "wget -q -O- https://swift.org/builds/swift-5.4.3-release/ubuntu2004/swift-5.4.3-RELEASE/swift-5.4.3-RELEASE-ubuntu20.04.tar.gz | tar zxf -" - linux.vm.provision :shell, :inline => "echo 'export PATH=\${PATH}:~/swift-5.4.3-RELEASE-ubuntu20.04/usr/bin' >>/home/vagrant/.bash_profile" - linux.vm.provision :shell, :inline => "source /home/vagrant/.bash_profile" - - # Install protoc-gen-swift - #linux.vm.provision :shell, :inline => "git clone --depth 1 https://github.com/apple/swift-protobuf" - #linux.vm.provision :shell, :inline => "(cd swift-protobuf; swift build -c release; cp .build/release/protoc-gen-swift /usr/bin/protoc-gen-swift)" - - # Install protoc-gen-rust - linux.vm.provision :shell, :inline => "git clone --depth 1 https://github.com/stepancheg/rust-protobuf" - linux.vm.provision :shell, :inline => "(cd rust-protobuf; cargo build --package protobuf-codegen --release; cp target/release/protoc-gen-rust /usr/bin/protoc-gen-rust)" - - # Install formatters - linux.vm.provision :shell, :inline => "pacman -Syu --noconfirm python-black" - linux.vm.provision :shell, :inline => "npm install -g prettier" end config.vm.define "openbsd" do |openbsd| diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/java/org/s7s/core/integration/osquery/Installer.java b/core/ext/sandpolis-core-ext-osquery/src/main/java/org/s7s/core/integration/osquery/Installer.java deleted file mode 100644 index 4597eb940..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/java/org/s7s/core/integration/osquery/Installer.java +++ /dev/null @@ -1,142 +0,0 @@ -//============================================================================// -// // -// Copyright © 2015 - 2022 Sandpolis Software Foundation // -// // -// This source file is subject to the terms of the Mozilla Public License // -// version 2. You may not use this file except in compliance with the MPLv2. // -// // -//============================================================================// -package org.s7s.core.integration.osquery; - -import java.io.IOException; -import java.net.URI; -import java.net.http.HttpClient; -import java.net.http.HttpRequest; -import java.net.http.HttpResponse.BodyHandlers; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Optional; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.s7s.core.foundation.Platform.ArchType; -import org.s7s.core.foundation.Platform.OsType; -import org.s7s.core.foundation.S7SFile; -import org.s7s.core.foundation.S7SProcess; -import org.s7s.core.foundation.S7SSystem; -import org.s7s.core.integration.osquery.Installer.Response.Asset; -import org.s7s.core.integration.pacman.Pacman; - -public class Installer { - - public record Response(Asset[] assets) { - public record Asset(String browser_download_url) { - - } - } - - public static Optional locate() { - // Try to find binary on PATH - var bin = S7SFile.which("osqueryi"); - if (bin.isPresent()) { - return Optional.of(bin.get().path()); - } - - return Optional.empty(); - } - - public static void install() throws IOException, InterruptedException { - if (locate().isPresent()) { - return; - } - - // Attempt to install with a package manager first - if (Pacman.isAvailable()) { - if (Pacman.load().install("osquery").complete() == 0) { - return; - } - } - - // Attempt manual installation - var url = getLatestUrl(S7SSystem.OS_TYPE, S7SSystem.ARCH_TYPE); - if (url.isPresent()) { - // Download to tmp - var tmp = Files.createTempFile(null, null); - - HttpClient.newHttpClient().send(HttpRequest.newBuilder() - .uri(URI.create("https://api.github.com/repos/osquery/osquery/releases/latest")).GET().build(), - BodyHandlers.ofFile(tmp)); - - switch (S7SSystem.OS_TYPE) { - case LINUX: - break; - case MACOS: - break; - case WINDOWS: - // Execute the installer - S7SProcess.exec(tmp); - break; - default: - break; - } - } - } - - public static Optional getLatestUrl(OsType os, ArchType arch) throws IOException, InterruptedException { - HttpRequest request = HttpRequest.newBuilder() - .uri(URI.create("https://api.github.com/repos/osquery/osquery/releases/latest")).GET().build(); - - var response = new ObjectMapper() - .createParser(HttpClient.newHttpClient().send(request, BodyHandlers.ofInputStream()).body()) - .readValueAs(Response.class); - - for (var asset : response.assets()) { - switch (os) { - case LINUX: - if (asset.browser_download_url().contains("linux")) { - switch (arch) { - case X86_64: - if (asset.browser_download_url().contains("x86_64.tar.gz")) { - return Optional.of(asset.browser_download_url()); - } - break; - case AARCH64: - if (asset.browser_download_url().contains("aarch64.tar.gz")) { - return Optional.of(asset.browser_download_url()); - } - break; - default: - break; - } - } - break; - case MACOS: - if (asset.browser_download_url().contains("macos")) { - switch (arch) { - case X86_64: - if (asset.browser_download_url().contains("x86_64.tar.gz")) { - return Optional.of(asset.browser_download_url()); - } - break; - default: - break; - } - } - break; - case WINDOWS: - if (asset.browser_download_url().endsWith(".msi")) { - switch (arch) { - case X86_64: - return Optional.of(asset.browser_download_url()); - default: - break; - } - } - break; - default: - break; - } - } - - return Optional.empty(); - } -} diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/java/org/s7s/core/integration/osquery/OQSession.java b/core/ext/sandpolis-core-ext-osquery/src/main/java/org/s7s/core/integration/osquery/OQSession.java deleted file mode 100644 index 49c18bd6c..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/java/org/s7s/core/integration/osquery/OQSession.java +++ /dev/null @@ -1,88 +0,0 @@ -//============================================================================// -// // -// Copyright © 2015 - 2022 Sandpolis Software Foundation // -// // -// This source file is subject to the terms of the Mozilla Public License // -// version 2. You may not use this file except in compliance with the MPLv2. // -// // -//============================================================================// -package org.s7s.core.integration.osquery; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -public record OQSession(Path executable, Process process, BufferedWriter stdin, BufferedReader stdout) { - - public static OQSession of() throws IOException { - var osqueryi = Installer.locate().orElseThrow(FileNotFoundException::new); - - var process = Runtime.getRuntime().exec(osqueryi.toString()); - var stdin = new BufferedWriter(new OutputStreamWriter(process.getOutputStream())); - var stdout = new BufferedReader(new InputStreamReader(process.getInputStream())); - - // Drain initial stdout - if (stdout.ready()) - stdout.skip(Long.MAX_VALUE); - - return new OQSession(osqueryi, process, stdin, stdout); - } - - public synchronized String[][] query(String[] columns, String table) throws IOException { - - try { - // Add select operation - stdin.write("SELECT "); - - // Add select columns - stdin.write(Arrays.stream(columns).collect(Collectors.joining(","))); - - // Add table - stdin.write(" FROM "); - stdin.write(table); - - // Execute query - stdin.write(";\n"); - stdin.flush(); - - // Read header - String line = stdout.readLine(); - if (line == null || !line.startsWith("+")) { - throw new IOException("Unexpected header line: " + line); - } - line = stdout.readLine(); - if (line == null || !line.startsWith("|")) { - throw new IOException("Unexpected header line: " + line); - } - line = stdout.readLine(); - if (line == null || !line.startsWith("+")) { - throw new IOException("Unexpected header line: " + line); - } - - // Read rows - var rows = new ArrayList(); - while ((line = stdout.readLine()) != null) { - if (line.startsWith("|")) { - rows.add(Arrays.stream(line.split("\\|")).map(String::trim).filter(Predicate.not(String::isEmpty)) - .toArray(String[]::new)); - } else { - break; - } - } - - return rows.toArray(String[][]::new); - } finally { - // Drain stdout - if (stdout.ready()) - stdout.skip(Long.MAX_VALUE); - } - } -} diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/BlockDevice.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/BlockDevice.json deleted file mode 100644 index 16f1dbf9c..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/BlockDevice.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "name", - "type": "java.lang.String", - "description": "Block device name", - "osquery": "block_devices.name" - }, - { - "name": "parent", - "type": "java.lang.String", - "description": "Block device parent name", - "osquery": "block_devices.parent" - }, - { - "name": "vendor", - "type": "java.lang.String", - "description": "Block device vendor string", - "osquery": "block_devices.vendor" - }, - { - "name": "model", - "type": "java.lang.String", - "description": "Block device model string identifier", - "osquery": "block_devices.model" - }, - { - "name": "size", - "type": "java.lang.Long", - "description": "Block device size in blocks", - "osquery": "block_devices.size" - }, - { - "name": "block_size", - "type": "java.lang.Integer", - "description": "Block size in bytes", - "osquery": "block_devices.block_size" - }, - { - "name": "uuid", - "type": "java.lang.String", - "description": "Block device Universally Unique Identifier", - "osquery": "block_devices.uuid" - }, - { - "name": "type", - "type": "java.lang.String", - "description": "Block device type string", - "osquery": "block_devices.type" - }, - { - "name": "label", - "type": "java.lang.String", - "description": "Block device label string", - "osquery": "block_devices.label" - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Cpu.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Cpu.json deleted file mode 100644 index 321700f05..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Cpu.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "model", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "vendor", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "frequency_spec", - "type": "java.lang.Integer", - "description": "The specified frequency in Hertz" - }, - { - "name": "l1_cache", - "type": "java.lang.Integer", - "description": "The size of the L1 cache in bytes" - }, - { - "name": "l2_cache", - "type": "java.lang.Integer", - "description": "The size of the L2 cache in bytes" - }, - { - "name": "l3_cache", - "type": "java.lang.Integer", - "description": "The size of the L3 cache in bytes" - }, - { - "name": "l4_cache", - "type": "java.lang.Integer", - "description": "The size of the L4 cache in bytes" - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Cpu/Core.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Cpu/Core.json deleted file mode 100644 index ec6785614..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Cpu/Core.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "usage", - "type": "java.lang.Double", - "description": "The core's usage between 0.0 and 1.0" - }, - { - "name": "temperature", - "type": "java.lang.Double", - "description": "The core's temperature in Celsius" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Disk.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Disk.json deleted file mode 100644 index 928a70d93..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Disk.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "name", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "model", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "serial", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "size", - "type": "java.lang.Long", - "description": "The disk's total size in bytes" - }, - { - "name": "reads", - "type": "java.lang.Long", - "description": null - }, - { - "name": "read_bytes", - "type": "java.lang.Long", - "description": null - }, - { - "name": "writes", - "type": "java.lang.Long", - "description": null - }, - { - "name": "write_bytes", - "type": "java.lang.Long", - "description": null - }, - { - "name": "queue_length", - "type": "java.lang.Long", - "description": null - }, - { - "name": "transfer_time", - "type": "java.lang.Long", - "description": null - }, - { - "name": "model_family", - "type": "java.lang.String", - "description": null - }, - { - "name": "firmware_version", - "type": "java.lang.String", - "description": null - }, - { - "name": "read_error_rate", - "type": "java.lang.Long", - "description": null - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Disk/Partition.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Disk/Partition.json deleted file mode 100644 index f88a05788..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Disk/Partition.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "identification", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "name", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "description", - "type": "java.lang.String", - "description": null - }, - { - "name": "uuid", - "type": "java.lang.String", - "description": "The partition's UUID" - }, - { - "name": "size", - "type": "java.lang.Long", - "description": "The partition's total size in bytes" - }, - { - "name": "major", - "type": "java.lang.Integer", - "description": null - }, - { - "name": "minor", - "type": "java.lang.Integer", - "description": null - }, - { - "name": "mount", - "type": "java.lang.String", - "description": "The partition's mount point" - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Disk/Smart.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Disk/Smart.json deleted file mode 100644 index f6051c108..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Disk/Smart.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "collection": false, - "attributes": [ - { - "name": "rotation_rate", - "type": "java.lang.Long", - "description": "Drive rotations per minute", - "osquery": "smart_drive_info.rotation_rate" - }, - { - "name": "spin_up_time", - "type": "java.lang.Long", - "description": null - }, - { - "name": "start_stop_cycles", - "type": "java.lang.Long", - "description": null - }, - { - "name": "reallocated_sectors", - "type": "java.lang.Long", - "description": null - }, - { - "name": "seek_error_rate", - "type": "java.lang.Long", - "description": null - }, - { - "name": "power_on_time", - "type": "java.lang.Long", - "description": null - }, - { - "name": "spin_retries", - "type": "java.lang.Long", - "description": null - }, - { - "name": "calibration_retries", - "type": "java.lang.Long", - "description": null - }, - { - "name": "power_cycles", - "type": "java.lang.Long", - "description": null - }, - { - "name": "poweroff_retracts", - "type": "java.lang.Long", - "description": null - }, - { - "name": "load_cycles", - "type": "java.lang.Long", - "description": null - }, - { - "name": "temperature", - "type": "java.lang.Long", - "description": null - }, - { - "name": "reallocated_events", - "type": "java.lang.Long", - "description": null - }, - { - "name": "current_pending_sector", - "type": "java.lang.Long", - "description": null - }, - { - "name": "offline_uncorrectable", - "type": "java.lang.Long", - "description": null - }, - { - "name": "crc_errors", - "type": "java.lang.Long", - "description": null - }, - { - "name": "multizone_error_rate", - "type": "java.lang.Long", - "description": null - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Display.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Display.json deleted file mode 100644 index 68f09a6e1..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Display.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "name", - "type": "java.lang.String", - "immutable": true, - "description": "The display's name" - }, - { - "name": "edid", - "type": "java.lang.String", - "description": null - }, - { - "name": "resolution", - "type": "java.lang.String", - "description": "The display's resolution" - }, - { - "name": "size", - "type": "java.lang.String", - "immutable": true, - "description": "The display's physical size in pixels" - }, - { - "name": "refresh_frequency", - "type": "java.lang.Integer", - "description": "Refresh frequency in Hertz" - }, - { - "name": "bit_depth", - "type": "java.lang.Integer", - "description": null - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/FirefoxAddon.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/FirefoxAddon.json deleted file mode 100644 index b2a364367..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/FirefoxAddon.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "uid", - "type": "java.lang.String", - "description": "The local user that owns the addon", - "osquery": "firefox_addons.uid" - }, - { - "name": "name", - "type": "java.lang.String", - "description": "Addon display name", - "osquery": "firefox_addons.name" - }, - { - "name": "identifier", - "type": "java.lang.String", - "description": "Addon identifier", - "osquery": "firefox_addons.identifier" - }, - { - "name": "creator", - "type": "java.lang.String", - "description": "Addon-supported creator string", - "osquery": "firefox_addons.creator" - }, - { - "name": "type", - "type": "java.lang.String", - "description": "Extension, addon, webapp", - "osquery": "firefox_addons.type" - }, - { - "name": "version", - "type": "java.lang.String", - "description": "Addon-supplied version string", - "osquery": "firefox_addons.version" - }, - { - "name": "description", - "type": "java.lang.String", - "description": "Addon-supplied description string", - "osquery": "firefox_addons.description" - }, - { - "name": "source_url", - "type": "java.lang.String", - "description": "URL that installed the addon", - "osquery": "firefox_addons.source_url" - }, - { - "name": "visible", - "type": "java.lang.Boolean", - "description": "Whether the addon is shown in the browser", - "osquery": "firefox_addons.visible" - }, - { - "name": "active", - "type": "java.lang.Boolean", - "description": "Whether the addon is active", - "osquery": "firefox_addons.active" - }, - { - "name": "disabled", - "type": "java.lang.Boolean", - "description": "Whether the addon is disabled", - "osquery": "firefox_addons.disabled" - }, - { - "name": "autoupdate", - "type": "java.lang.Boolean", - "description": "Whether the addon is applies background updates", - "osquery": "firefox_addons.autoupdate" - }, - { - "name": "native_addon", - "type": "java.lang.Boolean", - "description": "Whether the addon includes binary components", - "osquery": "firefox_addons.native" - }, - { - "name": "location", - "type": "java.lang.String", - "description": "Global, profile location", - "osquery": "firefox_addons.location" - }, - { - "name": "path", - "type": "java.lang.String", - "description": "Path to plugin bundle", - "osquery": "firefox_addons.path" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Firmware.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Firmware.json deleted file mode 100644 index 9f348ceda..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Firmware.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "collection": false, - "attributes": [ - { - "name": "name", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "manufacturer", - "type": "java.lang.String", - "immutable": true, - "description": "The BIOS manufacturer title" - }, - { - "name": "description", - "type": "java.lang.String", - "immutable": true, - "description": "The BIOS description" - }, - { - "name": "version", - "type": "java.lang.String", - "immutable": true, - "description": "The BIOS version number" - }, - { - "name": "revision", - "type": "java.lang.String", - "immutable": true, - "description": "The BIOS revision number" - }, - { - "name": "release_date", - "type": "java.lang.String", - "immutable": true, - "description": "The BIOS release date" - }, - { - "name": "uefi", - "type": "java.lang.Boolean", - "immutable": true, - "description": "Whether the BIOS supports UEFI mode" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/HostEntry.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/HostEntry.json deleted file mode 100644 index 734ede2a3..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/HostEntry.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "address", - "type": "java.lang.String", - "description": "IP address mapping", - "osquery": "etc_hosts.address" - }, - { - "name": "hostnames", - "type": "java.lang.String", - "description": "Raw hosts mapping", - "osquery": "etc_hosts.hostnames" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/KernelModule.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/KernelModule.json deleted file mode 100644 index 5885aeb85..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/KernelModule.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "name", - "type": "java.lang.String", - "description": "Module name", - "osquery": "kernel_modules.name" - }, - { - "name": "size", - "type": "java.lang.String", - "description": "Size of module content", - "osquery": "kernel_modules.size" - }, - { - "name": "used_by", - "type": "java.lang.String", - "description": "Module reverse dependencies", - "osquery": "kernel_modules.used_by" - }, - { - "name": "status", - "type": "java.lang.String", - "description": "Kernel module status", - "osquery": "kernel_modules.status" - }, - { - "name": "address", - "type": "java.lang.String", - "description": "Kernel module address", - "osquery": "kernel_modules.address" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Mainboard.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Mainboard.json deleted file mode 100644 index 9c50ef295..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Mainboard.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "collection": false, - "attributes": [ - { - "name": "model", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "manufacturer", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "version", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "serial_number", - "type": "java.lang.String", - "immutable": true, - "description": null - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Memory.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Memory.json deleted file mode 100644 index b2a2110c2..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Memory.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "collection": false, - "attributes": [ - { - "name": "total", - "type": "java.lang.Long", - "description": "The amount of physical RAM in bytes", - "osquery": "memory_info.memory_total" - }, - { - "name": "free", - "type": "java.lang.Long", - "description": "The amount of physical RAM, in bytes, left unused by the system", - "osquery": "memory_info.memory_free" - }, - { - "name": "file_buffers", - "type": "java.lang.Long", - "description": "The amount of physical RAM, in bytes, used for file buffers", - "osquery": "memory_info.buffers" - }, - { - "name": "cached", - "type": "java.lang.Long", - "description": "The amount of physical RAM, in bytes, used as cache memory", - "osquery": "memory_info.cached" - }, - { - "name": "swap_cached", - "type": "java.lang.Long", - "description": "The amount of sawp, in bytes, used as cache memory", - "osquery": "memory_info.swap_cached" - }, - { - "name": "active", - "type": "java.lang.Long", - "description": "The total amount of buffer or page cache memory, in bytes, that is in active use", - "osquery": "memory_info.active" - }, - { - "name": "inactive", - "type": "java.lang.Long", - "description": "The total amount of buffer or page cache memory, in bytes, that are free and available", - "osquery": "memory_info.inactive" - }, - { - "name": "swap_total", - "type": "java.lang.Long", - "description": "The total amount of swap available, in bytes", - "osquery": "memory_info.swap_total" - }, - { - "name": "swap_free", - "type": "java.lang.Long", - "description": "The total amount of swap free, in bytes", - "osquery": "memory_info.swap_free" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Memory/Device.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Memory/Device.json deleted file mode 100644 index 6cf5a5d67..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Memory/Device.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "handle", - "type": "java.lang.String", - "description": "Handle, or instance number, associated with the structure in SMBIOS", - "osquery": "memory_devices.handle" - }, - { - "name": "array_handle", - "type": "java.lang.String", - "description": "The memory array that the device is attached to", - "osquery": "memory_devices.array_handle" - }, - { - "name": "form_factor", - "type": "java.lang.String", - "description": "Implementation form factor for this memory device", - "osquery": "memory_devices.form_factor" - }, - { - "name": "total_width", - "type": "java.lang.Integer", - "description": "Total width, in bits, of this memory device, including any check or error-correction bits", - "osquery": "memory_devices.total_width" - }, - { - "name": "data_width", - "type": "java.lang.Integer", - "description": "Data width, in bits, of this memory device", - "osquery": "memory_devices.data_width" - }, - { - "name": "size", - "type": "java.lang.Integer", - "description": "Size of memory device in bytes", - "osquery": "memory_devices.size" - }, - { - "name": "set", - "type": "java.lang.Integer", - "description": "Identifies if memory device is one of a set of devices. A value of 0 indicates no set affiliation.", - "osquery": "memory_devices.set" - }, - { - "name": "device_location", - "type": "java.lang.String", - "description": "String number of the string that identifies the physically-labeled socket or board position where the memory device is located", - "osquery": "memory_devices.device_location" - }, - { - "name": "bank_location", - "type": "java.lang.String", - "description": "String number of the string that identifies the physically-labeled bank where the memory device is located", - "osquery": "memory_devices.bank_location" - }, - { - "name": "memory_type", - "type": "java.lang.String", - "description": "Type of memory used", - "osquery": "memory_devices.memory_type" - }, - { - "name": "memory_type_details", - "type": "java.lang.String", - "description": "Additional details for memory device", - "osquery": "memory_devices.memory_type_details" - }, - { - "name": "max_speed", - "type": "java.lang.Integer", - "description": "Max speed of memory device in megatransfers per second (MT/s)", - "osquery": "memory_devices.max_speed" - }, - { - "name": "configured_clock_speed", - "type": "java.lang.Integer", - "description": "Configured speed of memory device in megatransfers per second (MT/s)", - "osquery": "memory_devices.configured_clock_speed" - }, - { - "name": "manufacturer", - "type": "java.lang.String", - "description": "Manufacturer ID string", - "osquery": "memory_devices.manufacturer" - }, - { - "name": "serial_number", - "type": "java.lang.String", - "description": "Serial number of memory device", - "osquery": "memory_devices.serial_number" - }, - { - "name": "asset_tag", - "type": "java.lang.String", - "description": "Manufacturer specific asset tag of memory device", - "osquery": "memory_devices.asset_tag" - }, - { - "name": "part_number", - "type": "java.lang.String", - "description": "Manufacturer specific serial number of memory device", - "osquery": "memory_devices.part_number" - }, - { - "name": "min_voltage", - "type": "java.lang.Integer", - "description": "Minimum operating voltage of device in millivolts", - "osquery": "memory_devices.min_voltage" - }, - { - "name": "max_voltage", - "type": "java.lang.Integer", - "description": "Maximum operating voltage of device in millivolts", - "osquery": "memory_devices.max_voltage" - }, - { - "name": "configured_voltage", - "type": "java.lang.Integer", - "description": "Configured operating voltage of device in millivolts", - "osquery": "memory_devices.configured_voltage" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Memory/Map.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Memory/Map.json deleted file mode 100644 index a2b112054..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Memory/Map.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "name", - "type": "java.lang.String", - "description": "Region name", - "osquery": "memory_map.name" - }, - { - "name": "start", - "type": "java.lang.String", - "description": "Start address of memory region", - "osquery": "memory_map.start" - }, - { - "name": "end", - "type": "java.lang.String", - "description": "End address of memory region", - "osquery": "memory_map.end" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Mountpoint.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Mountpoint.json deleted file mode 100644 index 5e1da4ff0..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Mountpoint.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "device", - "type": "java.lang.String", - "description": "Mounted device", - "osquery": "mounts.device" - }, - { - "name": "device_alias", - "type": "java.lang.String", - "description": "Mounted device alias", - "osquery": "mounts.device_alias" - }, - { - "name": "path", - "type": "java.lang.String", - "description": "Mounted device path", - "osquery": "mounts.path" - }, - { - "name": "type", - "type": "java.lang.String", - "description": "Mounted device type", - "osquery": "mounts.type" - }, - { - "name": "blocks_size", - "type": "java.lang.Long", - "description": "Block size in bytes", - "osquery": "mounts.blocks_size" - }, - { - "name": "blocks", - "type": "java.lang.Long", - "description": "Mounted device used blocks", - "osquery": "mounts.blocks" - }, - { - "name": "blocks_free", - "type": "java.lang.Long", - "description": "Mounted device free blocks", - "osquery": "mounts.blocks_free" - }, - { - "name": "blocks_available", - "type": "java.lang.Long", - "description": "Mounted device available blocks", - "osquery": "mounts.blocks_available" - }, - { - "name": "inodes", - "type": "java.lang.Long", - "description": "Mounted device used inodes", - "osquery": "mounts.inodes" - }, - { - "name": "inodes_free", - "type": "java.lang.Long", - "description": "Mounted device free inodes", - "osquery": "mounts.inodes_free" - }, - { - "name": "flags", - "type": "java.lang.String", - "description": "Mounted device flags", - "osquery": "mounts.flags" - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network.json deleted file mode 100644 index 2f96ec56c..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "collection": false, - "attributes": [ - { - "name": "hostname", - "type": "java.lang.String", - "description": "The host's hostname" - }, - { - "name": "fqdn", - "type": "java.lang.String", - "description": "The host's fully-qualified domain name" - }, - { - "name": "dns", - "type": "java.lang.String", - "list": true, - "description": "The host's DNS servers" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network/ArpEntry.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network/ArpEntry.json deleted file mode 100644 index 4e27cbb8d..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network/ArpEntry.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "address", - "type": "java.lang.String", - "description": "IPv4 address target", - "osquery": "arp_cache.address" - }, - { - "name": "mac", - "type": "java.lang.String", - "description": "MAC address of broadcasted address", - "osquery": "arp_cache.mac" - }, - { - "name": "interface_id", - "type": "java.lang.String", - "description": "Interface of the network for the MAC", - "osquery": "arp_cache.interface" - }, - { - "name": "permanent", - "type": "java.lang.Boolean", - "description": "Whether the ARP entry is permanent", - "osquery": "arp_cache.permanent" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network/BoundPort.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network/BoundPort.json deleted file mode 100644 index 0d576ad92..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network/BoundPort.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "pid", - "type": "java.lang.Integer", - "description": "Process (or thread) ID", - "osquery": "listening_ports.pid" - }, - { - "name": "port", - "type": "java.lang.Integer", - "description": "Transport layer port", - "osquery": "listening_ports.port" - }, - { - "name": "protocol", - "type": "java.lang.Integer", - "description": "Transport protocol (TCP/UDP)", - "osquery": "listening_ports.protocol" - }, - { - "name": "family", - "type": "java.lang.Integer", - "description": "Network protocol (IPv4, IPv6)", - "osquery": "listening_ports.family" - }, - { - "name": "address", - "type": "java.lang.String", - "description": "Specific address for bind", - "osquery": "listening_ports.address" - }, - { - "name": "fd", - "type": "java.lang.Long", - "description": "Socket file descriptor number", - "osquery": "listening_ports.fd" - }, - { - "name": "socket", - "type": "java.lang.Long", - "description": "Socket handle or inode number", - "osquery": "listening_ports.socket" - }, - { - "name": "path", - "type": "java.lang.Long", - "description": "Path for UNIX domain sockets", - "osquery": "listening_ports.path" - }, - { - "name": "net_namespace", - "type": "java.lang.Long", - "description": "The inode number of the network namespace", - "osquery": "listening_ports.net_namespace" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network/Route.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network/Route.json deleted file mode 100644 index 632482c77..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Network/Route.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "destination", - "type": "java.lang.String", - "description": "Destination IP address" - }, - { - "name": "netmask", - "type": "java.lang.Integer", - "description": "Netmask length" - }, - { - "name": "gateway", - "type": "java.lang.Integer", - "description": "Route gateway" - }, - { - "name": "source", - "type": "java.lang.Integer", - "description": "Route source" - }, - { - "name": "flags", - "type": "java.lang.Integer", - "description": "Flags to describe route" - }, - { - "name": "interface_id", - "type": "java.lang.String", - "description": "Route local interface" - }, - { - "name": "mtu", - "type": "java.lang.Integer", - "description": "Maximum Transmission Unit for the route" - }, - { - "name": "metric", - "type": "java.lang.Integer", - "description": "Cost of route. Lowest is preferred" - }, - { - "name": "type", - "type": "java.lang.String", - "description": "Type of route" - }, - { - "name": "hopcount", - "type": "java.lang.Integer", - "description": "Max hops expected" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Nic.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Nic.json deleted file mode 100644 index 593f9df11..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Nic.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "name", - "type": "java.lang.String", - "id": true, - "description": "The interface's name", - "osquery": "interface_details.interface" - }, - { - "name": "description", - "type": "java.lang.String", - "description": "The interface's description", - "osquery": "interface_details.description" - }, - { - "name": "mtu", - "type": "java.lang.Integer", - "description": "The interface's maximum transmission unit in bytes", - "osquery": "interface_details.mtu" - }, - { - "name": "mac", - "type": "java.lang.String", - "description": "The interface's MAC address", - "osquery": "interface_details.mac" - }, - { - "name": "virtual", - "type": "java.lang.Boolean", - "description": null - }, - { - "name": "ipv4", - "type": "java.lang.String", - "list": true, - "description": "The interface's IPv4 addresses" - }, - { - "name": "ipv6", - "type": "java.lang.String", - "list": true, - "description": "The interface's IPv6 addresses" - }, - { - "name": "broadcast", - "type": "java.lang.String", - "description": null - }, - { - "name": "netmask", - "type": "java.lang.String", - "description": "The interface's subnet mask" - }, - { - "name": "read_bytes", - "type": "java.lang.Long", - "description": "The number of bytes read from the interface", - "osquery": "interface_details.ibytes" - }, - { - "name": "write_bytes", - "type": "java.lang.Long", - "description": "The number of bytes written to the interface", - "osquery": "interface_details.obytes" - }, - { - "name": "read_packets", - "type": "java.lang.Long", - "description": "The number of packets read from the interface", - "osquery": "interface_details.ipackets" - }, - { - "name": "write_packets", - "type": "java.lang.Long", - "description": "The number of packets written to the interface", - "osquery": "interface_details.opackets" - }, - { - "name": "read_errors", - "type": "java.lang.Long", - "description": "The number of read errors", - "osquery": "interface_details.ierrors" - }, - { - "name": "write_errors", - "type": "java.lang.Long", - "description": "The number of write errors", - "osquery": "interface_details.oerrors" - }, - { - "name": "read_drops", - "type": "java.lang.Long", - "description": "The number of read drops", - "osquery": "interface_details.idrops" - }, - { - "name": "write_drops", - "type": "java.lang.Long", - "description": "The number of write drops", - "osquery": "interface_details.odrops" - }, - { - "name": "write_collisions", - "type": "java.lang.Long", - "description": "The number of write collisions", - "osquery": "interface_details.collisions" - }, - { - "name": "link_speed", - "type": "java.lang.Long", - "description": "The interface's maximum speed in bytes", - "osquery": "interface_details.link_speed" - }, - { - "name": "default_gateway", - "type": "java.lang.Boolean", - "description": null - }, - { - "name": "flag_up", - "type": "java.lang.Boolean", - "description": null - }, - { - "name": "flag_running", - "type": "java.lang.Boolean", - "description": null - }, - { - "name": "flag_loopback", - "type": "java.lang.Boolean", - "description": null - }, - { - "name": "flag_multicast", - "type": "java.lang.Boolean", - "description": null - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Nic/Windows.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Nic/Windows.json deleted file mode 100644 index a2f577586..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Nic/Windows.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "collection": false, - "attributes": [ - { - "name": "luid", - "type": "java.lang.Long", - "description": "The interface's locally unique identifier" - }, - { - "name": "guid", - "type": "java.lang.String", - "description": "The interface's globally unique identifier" - }, - { - "name": "paused", - "type": "java.lang.Boolean", - "description": "Whether the interface is in a paused state" - }, - { - "name": "low_power", - "type": "java.lang.Boolean", - "description": "Whether the interface is in a low-power state" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Os.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Os.json deleted file mode 100644 index 1f98d7353..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Os.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "collection": false, - "attributes": [ - { - "name": "name", - "type": "java.lang.String", - "immutable": true, - "description": "Distribution name", - "osquery": "os_version.name" - }, - { - "name": "family", - "type": "java.lang.String", - "immutable": true, - "description": "The operating system's family" - }, - { - "name": "manufacturer", - "type": "java.lang.String", - "immutable": true, - "description": "The operating system's manufacturer" - }, - { - "name": "bitness", - "type": "java.lang.Integer", - "immutable": true, - "description": "The operating system's register width in bits" - }, - { - "name": "version", - "type": "java.lang.String", - "immutable": true, - "description": "The operating system's primary version", - "osquery": "os_version.version" - }, - { - "name": "major_version", - "type": "java.lang.Integer", - "immutable": true, - "description": "Major release version", - "osquery": "os_version.major" - }, - { - "name": "minor_version", - "type": "java.lang.Integer", - "immutable": true, - "description": "Minor release version", - "osquery": "os_version.minor" - }, - { - "name": "codename", - "type": "java.lang.String", - "immutable": true, - "description": "The operating system's code name", - "osquery": "os_version.codename" - }, - { - "name": "build_number", - "type": "java.lang.String", - "immutable": true, - "description": "The operating system's build number" - }, - { - "name": "arch", - "type": "java.lang.String", - "immutable": true, - "description": "OS architecture", - "osquery": "os_version.arch" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process.json deleted file mode 100644 index fe7a86427..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "name", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "path", - "type": "java.lang.String", - "description": null - }, - { - "name": "command", - "type": "java.lang.String", - "description": null, - "osquery": "processes.cmdline" - }, - { - "name": "working_directory", - "type": "java.lang.String", - "description": null, - "osquery": "processes.cwd" - }, - { - "name": "user", - "type": "java.lang.String", - "description": null - }, - { - "name": "user_id", - "type": "java.lang.String", - "description": null, - "osquery": "processes.uid" - }, - { - "name": "group", - "type": "java.lang.String", - "description": null - }, - { - "name": "group_id", - "type": "java.lang.String", - "description": null, - "osquery": "processes.gid" - }, - { - "name": "state", - "type": "java.lang.String", - "description": null, - "osquery": "processes.state" - }, - { - "name": "pid", - "type": "java.lang.Integer", - "description": "The process's process ID", - "osquery": "processes.pid" - }, - { - "name": "parent_pid", - "type": "java.lang.Integer", - "description": null, - "osquery": "processes.parent" - }, - { - "name": "thread_count", - "type": "java.lang.Integer", - "description": null, - "osquery": "processes.threads" - }, - { - "name": "priority", - "type": "java.lang.Integer", - "description": null - }, - { - "name": "virtual_size", - "type": "java.lang.Long", - "description": null - }, - { - "name": "resident_set_size", - "type": "java.lang.Long", - "description": "The resident memory size in bytes", - "osquery": "processes.resident_size" - }, - { - "name": "kernel_time", - "type": "java.lang.Long", - "description": "The number of milliseconds the process has executed in kernel mode", - "osquery": "processes.system_time" - }, - { - "name": "user_time", - "type": "java.lang.Long", - "description": "The number of milliseconds the process has executed in user mode", - "osquery": "processes.user_time" - }, - { - "name": "start_time", - "type": "java.lang.Long", - "description": "The epoch timestamp of the process start time", - "osquery": "processes.start_time" - }, - { - "name": "bytes_read", - "type": "java.lang.Long", - "description": "The number of bytes the process has read from disk", - "osquery": "processes.disk_bytes_read" - }, - { - "name": "bytes_written", - "type": "java.lang.Long", - "description": "The number of bytes the process has written to disk", - "osquery": "processes.disk_bytes_written" - }, - { - "name": "handle_count", - "type": "java.lang.Long", - "description": "The number of file handles that the process owns", - "osquery": "processes.handle_count" - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process/Fd.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process/Fd.json deleted file mode 100644 index 7fbf56531..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process/Fd.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "fd", - "type": "java.lang.Long", - "description": "Process-specific file descriptor number" - }, - { - "name": "path", - "type": "java.lang.Long", - "description": "Filesystem path of descriptor" - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process/Namespace.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process/Namespace.json deleted file mode 100644 index 6f3c8306a..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process/Namespace.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "cgroup_namespace", - "type": "java.lang.String", - "description": "cgroup namespace inode" - }, - { - "name": "ipc_namespace", - "type": "java.lang.String", - "description": "ipc namespace inode" - }, - { - "name": "mnt_namespace", - "type": "java.lang.String", - "description": "mnt namespace inode" - }, - { - "name": "net_namespace", - "type": "java.lang.String", - "description": "net namespace inode" - }, - { - "name": "pid_namespace", - "type": "java.lang.String", - "description": "mnt namespace inode" - }, - { - "name": "user_namespace", - "type": "java.lang.String", - "description": "user namespace inode" - }, - { - "name": "uts_namespace", - "type": "java.lang.String", - "description": "uts namespace inode" - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process/Socket.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process/Socket.json deleted file mode 100644 index bdb2c6100..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Process/Socket.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "fd", - "type": "java.lang.Long", - "description": "Process-specific file descriptor number", - "osquery": "process_open_sockets.fd" - }, - { - "name": "socket", - "type": "java.lang.Long", - "description": "Socket handle or inode number", - "osquery": "process_open_sockets.socket" - }, - { - "name": "family", - "type": "java.lang.Long", - "description": "Network protocol (IPv4, IPv6)", - "osquery": "process_open_sockets.family" - }, - { - "name": "protocol", - "type": "java.lang.Long", - "description": "Transport protocol (TCP/UDP)", - "osquery": "process_open_sockets.protocol" - }, - { - "name": "local_address", - "type": "java.lang.String", - "description": "Socket local address", - "osquery": "process_open_sockets.local_address" - }, - { - "name": "remote_address", - "type": "java.lang.String", - "description": "Socket remote address", - "osquery": "process_open_sockets.remote_address" - }, - { - "name": "local_port", - "type": "java.lang.Integer", - "description": "Socket local port", - "osquery": "process_open_sockets.local_port" - }, - { - "name": "remote_port", - "type": "java.lang.Integer", - "description": "Socket remote port", - "osquery": "process_open_sockets.remote_port" - }, - { - "name": "path", - "type": "java.lang.String", - "description": "For UNIX sockets (family=AF_UNIX), the domain path", - "osquery": "process_open_sockets.path" - }, - { - "name": "state", - "type": "java.lang.String", - "description": "TCP socket state", - "osquery": "process_open_sockets.state" - }, - { - "name": "net_namespace", - "type": "java.lang.String", - "description": "The inode number of the network namespace", - "osquery": "process_open_sockets.net_namespace" - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Sensor.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Sensor.json deleted file mode 100644 index da6e6caa2..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Sensor.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "fan_speed", - "type": "java.lang.Integer", - "description": null - }, - { - "name": "temperature", - "type": "java.lang.Double", - "description": null - }, - { - "name": "voltage", - "type": "java.lang.Double", - "description": null - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/SoundCard.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/SoundCard.json deleted file mode 100644 index 5436a2edb..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/SoundCard.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "driver_version", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "name", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "codec", - "type": "java.lang.String", - "description": null - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/UsbDevice.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/UsbDevice.json deleted file mode 100644 index acbdcc186..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/UsbDevice.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "name", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "vendor", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "vendor_id", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "product_id", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "serial_number", - "type": "java.lang.String", - "immutable": true, - "description": null - }, - { - "name": "children", - "type": "/profile/*/osquery/usb_device" - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/User.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/User.json deleted file mode 100644 index ad9a60f21..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/User.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "uid", - "type": "java.lang.Long", - "description": "User ID", - "osquery": "users.uid" - }, - { - "name": "gid", - "type": "java.lang.Long", - "description": "Group ID", - "osquery": "users.gid" - }, - { - "name": "username", - "type": "java.lang.String", - "description": "Username", - "osquery": "users.username" - }, - { - "name": "description", - "type": "java.lang.String", - "description": "Description", - "osquery": "users.description" - }, - { - "name": "directory", - "type": "java.lang.String", - "description": "Home directory", - "osquery": "users.directory" - }, - { - "name": "shell", - "type": "java.lang.String", - "description": "The user's default shell", - "osquery": "users.shell" - } -]} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/UserGroup.json b/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/UserGroup.json deleted file mode 100644 index 2c4b2a670..000000000 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/UserGroup.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "collection": true, - "attributes": [ - { - "name": "gid", - "type": "java.lang.Integer", - "description": "Unsigned int64 group ID", - "osquery": "groups.gid" - }, - { - "name": "name", - "type": "java.lang.String", - "description": "Canonical local group name", - "osquery": "groups.groupname" - }, - { - "name": "group_sid", - "type": "java.lang.String", - "description": "Unique group ID", - "osquery": "groups.group_sid" - }, - { - "name": "comment", - "type": "java.lang.String", - "description": "Remarks or comments associated with the group", - "osquery": "groups.comment" - } - ] -} \ No newline at end of file diff --git a/core/ext/sandpolis-core-ext-systemd/src/main/java/org/s7s/core/integration/systemd/Systemctl.java b/core/ext/sandpolis-core-ext-systemd/src/main/java/org/s7s/core/integration/systemd/Systemctl.java deleted file mode 100644 index cf6391510..000000000 --- a/core/ext/sandpolis-core-ext-systemd/src/main/java/org/s7s/core/integration/systemd/Systemctl.java +++ /dev/null @@ -1,60 +0,0 @@ -//============================================================================// -// // -// Copyright © 2015 - 2022 Sandpolis Software Foundation // -// // -// This source file is subject to the terms of the Mozilla Public License // -// version 2. You may not use this file except in compliance with the MPLv2. // -// // -//============================================================================// -package org.s7s.core.integration.systemd; - -import java.nio.file.Path; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import org.s7s.core.foundation.S7SFile; -import org.s7s.core.foundation.S7SProcess; -import org.s7s.core.foundation.S7SSystem; - -public record Systemctl(Path executable) { - - private static final Logger log = LoggerFactory.getLogger(Systemctl.class); - - public static boolean isAvailable() { - switch (S7SSystem.OS_TYPE) { - case LINUX: - return S7SFile.which("systemctl").isPresent(); - default: - return false; - } - } - - public static Systemctl load() { - if (!isAvailable()) { - throw new IllegalStateException(); - } - - return new Systemctl(S7SFile.which("systemctl").get().path()); - } - - public void enable(SystemdService service) { - S7SProcess.exec(executable, "enable", service.path().getFileName().toString()); - } - - public void disable(SystemdService service) { - S7SProcess.exec(executable, "disable", service.path().getFileName().toString()); - } - - public void start(SystemdService service) { - S7SProcess.exec(executable, "start", service.path().getFileName().toString()); - } - - public void stop(SystemdService service) { - S7SProcess.exec(executable, "stop", service.path().getFileName().toString()); - } - - public void restart(SystemdService service) { - S7SProcess.exec(executable, "restart", service.path().getFileName().toString()); - } -} diff --git a/core/ext/sandpolis-core-ext-systemd/src/main/java/org/s7s/core/integration/systemd/SystemdLog.java b/core/ext/sandpolis-core-ext-systemd/src/main/java/org/s7s/core/integration/systemd/SystemdLog.java deleted file mode 100644 index 94d29c086..000000000 --- a/core/ext/sandpolis-core-ext-systemd/src/main/java/org/s7s/core/integration/systemd/SystemdLog.java +++ /dev/null @@ -1,24 +0,0 @@ -//============================================================================// -// // -// Copyright © 2015 - 2022 Sandpolis Software Foundation // -// // -// This source file is subject to the terms of the Mozilla Public License // -// version 2. You may not use this file except in compliance with the MPLv2. // -// // -//============================================================================// -package org.s7s.core.integration.systemd; - -import java.io.IOException; -import java.nio.file.Path; -import java.util.stream.Stream; - -import com.fasterxml.jackson.databind.ObjectMapper; -import org.s7s.core.foundation.S7SProcess; - -public record SystemdLog(Path log) { - - public Stream stream() throws IOException { - new ObjectMapper().createParser(S7SProcess.exec("journalctl", "-o", "json").process().getInputStream()); - return null; - } -} diff --git a/core/ext/sandpolis-core-ext-systemd/src/main/java/org/s7s/core/integration/systemd/SystemdService.java b/core/ext/sandpolis-core-ext-systemd/src/main/java/org/s7s/core/integration/systemd/SystemdService.java deleted file mode 100644 index 868b45818..000000000 --- a/core/ext/sandpolis-core-ext-systemd/src/main/java/org/s7s/core/integration/systemd/SystemdService.java +++ /dev/null @@ -1,69 +0,0 @@ -//============================================================================// -// // -// Copyright © 2015 - 2022 Sandpolis Software Foundation // -// // -// This source file is subject to the terms of the Mozilla Public License // -// version 2. You may not use this file except in compliance with the MPLv2. // -// // -//============================================================================// -package org.s7s.core.integration.systemd; - -import java.nio.file.Path; -import java.util.function.Consumer; - -import org.s7s.core.foundation.S7SProcess; - -public record SystemdService(Path path, String Type, boolean RemainAfterExit) { - - public static enum Type { - SIMPLE, EXEC, FORKING, ONESHOT, DBUS, NOTIFY, IDLE; - } - - public static enum Restart { - NO, ALWAYS, ON_SUCCESS, ON_FAILURE, ON_ABNORMAL, ON_ABORT, ON_WATCHDOG; - } - - public static enum OOMPolicy { - CONTINUE, STOP, KILL; - } - - public static class SystemdServiceStruct { - public Type Type; - public boolean RemainAfterExit; - public boolean GuessMainPID; - public Path PIDFile; - public String BusName; - public String[] ExecStart; - public String[] ExecStartPre; - public String[] ExecStartPost; - public String[] ExecCondition; - public String[] ExecReload; - public String[] ExecStop; - public String[] ExecStopPost; - public int RestartSec; - public int TimeoutStartSec; - public int TimeoutStopSec; - public int TimeoutAbortSec; - public int TimeoutSec; - public int RuntimeMaxSec; - public int WatchdogSec; - public Restart Restart; - public int[] SuccessExitStatus; - public int[] RestartPreventExitStatus; - public int[] RestartForceExitStatus; - public boolean RootDirectoryStartOnly; - public boolean NonBlocking; - public int FileDescriptorStoreMax; - public OOMPolicy OOMPolicy = SystemdService.OOMPolicy.CONTINUE; - } - - public static SystemdService of(Consumer configurator) { - - return null; - } - - public static SystemdService of(Path service) { - return null; - } - -} diff --git a/plugin/sandpolis-plugin-device/README.md b/plugin/sandpolis-plugin-device/README.md deleted file mode 100644 index ba15823aa..000000000 --- a/plugin/sandpolis-plugin-device/README.md +++ /dev/null @@ -1,8 +0,0 @@ -## Sandpolis Device Plugin - -_This plugin module is a part of -[Sandpolis](https://github.com/sandpolis/sandpolis)._ - -The device plugin integrates with various non-Sandpolis devices on the network. -These devices (called subagents) do not run an agent instance, instead -connecting to agent instances via well-known protocols like SSH or HTTP. diff --git a/plugin/sandpolis-plugin-filesystem/src/main/java/org/s7s/plugin/filesystem/cmd/FilesystemCmd.java b/plugin/sandpolis-plugin-filesystem/src/main/java/org/s7s/plugin/filesystem/cmd/FilesystemCmd.java deleted file mode 100644 index 7207be183..000000000 --- a/plugin/sandpolis-plugin-filesystem/src/main/java/org/s7s/plugin/filesystem/cmd/FilesystemCmd.java +++ /dev/null @@ -1,33 +0,0 @@ -//============================================================================// -// // -// Copyright © 2015 - 2022 Sandpolis Software Foundation // -// // -// This source file is subject to the terms of the Mozilla Public License // -// version 2. You may not use this file except in compliance with the MPLv2. // -// // -//============================================================================// -package org.s7s.plugin.filesystem.cmd; - -import org.s7s.core.instance.cmdlet.Cmdlet; - -/** - * Contains filesystem commands. - * - * @author cilki - * @since 5.0.2 - */ -public final class FilesystemCmd extends Cmdlet { - - /** - * Prepare for an asynchronous command. - * - * @return A configurable object from which all asynchronous (nonstatic) - * commands in {@link FilesystemCmd} can be invoked - */ - public static FilesystemCmd async() { - return new FilesystemCmd(); - } - - private FilesystemCmd() { - } -} diff --git a/plugin/sandpolis-plugin-filesystem/src/main/java/org/s7s/plugin/filesystem/mount/FuseDriver.java b/plugin/sandpolis-plugin-filesystem/src/main/java/org/s7s/plugin/filesystem/mount/FuseDriver.java deleted file mode 100644 index b6783913b..000000000 --- a/plugin/sandpolis-plugin-filesystem/src/main/java/org/s7s/plugin/filesystem/mount/FuseDriver.java +++ /dev/null @@ -1,42 +0,0 @@ -//============================================================================// -// // -// Copyright © 2015 - 2022 Sandpolis Software Foundation // -// // -// This source file is subject to the terms of the Mozilla Public License // -// version 2. You may not use this file except in compliance with the MPLv2. // -// // -//============================================================================// -package org.s7s.plugin.filesystem.mount; - -import static org.s7s.core.integration.fuse.fuse_lowlevel_h.fuse_session_new; -import static jdk.incubator.foreign.CLinker.C_LONG; -import static jdk.incubator.foreign.CLinker.C_POINTER; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodType; - -import org.s7s.core.integration.fuse.fuse_lowlevel_ops; - -import jdk.incubator.foreign.CLinker; -import jdk.incubator.foreign.FunctionDescriptor; -import jdk.incubator.foreign.MemoryAddress; - -public class FuseDriver { - - public static void ll_open(MemoryAddress req, long ino, MemoryAddress fi) { - - } - - fuse_lowlevel_ops fuse_ops = new fuse_lowlevel_ops(); - - public void test() throws Exception { - - MethodHandle comparHandle = MethodHandles.lookup().findStatic(FuseDriver.class, "ll_open", - MethodType.methodType(void.class, MemoryAddress.class, long.class, MemoryAddress.class)); - - CLinker.getInstance().upcallStub(comparHandle, FunctionDescriptor.ofVoid(C_POINTER, C_LONG, C_POINTER), null); - - var session = fuse_session_new(null, null, 0, null); - } -} diff --git a/sandpolis/Cargo.toml b/sandpolis/Cargo.toml index 8d2393441..210a966fd 100644 --- a/sandpolis/Cargo.toml +++ b/sandpolis/Cargo.toml @@ -45,9 +45,9 @@ egui = { version = "0.30.0", optional = true } sysinfo = { version = "0.33.0", optional = true } [features] +# Instances server = [ "dep:axum", "dep:axum-server", "dep:axum-macros", "dep:rcgen", "local-database" ] agent = [ "dep:sysinfo" ] -probe = [ "agent" ] client = [ "dep:bevy", "dep:bevy_rapier2d", "dep:bevy_egui", "dep:egui" ] # Layers @@ -60,6 +60,8 @@ layer-inventory = [] layer-logging = [] layer-packages = [] layer-shell = [] +layer-sysinfo = [] +layer-probe = [] # renamed device default = [ "local-database", "layer-desktop", "layer-filesystem", "layer-shell", "layer-inventory", "layer-account", "layer-logging" ] local-database = [] diff --git a/sandpolis/src/client/ui/layer/mod.rs b/sandpolis/src/client/ui/layer/mod.rs index 86d210617..40deb4055 100644 --- a/sandpolis/src/client/ui/layer/mod.rs +++ b/sandpolis/src/client/ui/layer/mod.rs @@ -1,2 +1,4 @@ #[cfg(feature = "layer-desktop")] pub mod desktop; +#[cfg(feature = "layer-packages")] +pub mod package; diff --git a/sandpolis/src/core/layer/mod.rs b/sandpolis/src/core/layer/mod.rs index 8b82703e2..e657aab7f 100644 --- a/sandpolis/src/core/layer/mod.rs +++ b/sandpolis/src/core/layer/mod.rs @@ -1 +1,8 @@ +#[cfg(feature = "layer-packages")] pub mod package; +#[cfg(feature = "layer-shell")] +pub mod shell; +#[cfg(feature = "layer-probe")] +pub mod probe; +#[cfg(feature = "layer-desktop")] +pub mod desktop; diff --git a/sandpolis/src/core/layer/device.rs b/sandpolis/src/core/layer/probe/mod.rs similarity index 71% rename from sandpolis/src/core/layer/device.rs rename to sandpolis/src/core/layer/probe/mod.rs index ca585efe7..c5a313f52 100644 --- a/sandpolis/src/core/layer/device.rs +++ b/sandpolis/src/core/layer/probe/mod.rs @@ -1,30 +1,18 @@ -//============================================================================// -// // -// Copyright © 2015 - 2022 Sandpolis Software Foundation // -// // -// This source file is subject to the terms of the Mozilla Public License // -// version 2. You may not use this file except in compliance with the MPLv2. // -// // -//============================================================================// -syntax = "proto3"; - -package plugin.device; +// An enumeration of all available communicator types. +pub enum ProbeType { + Ssh, + Snmp, + Ipmi, + Http, + Onvif, + Rtsp, + Wol, +} -option java_package = "org.s7s.plugin.device"; // Request that the receiver scan its local network for message RQ_FindSubagents { - // An enumeration of all available communicator types. - enum CommunicatorType { - SSH = 0; - SNMP = 1; - IPMI = 2; - HTTP = 3; - ONVIF = 4; - RTSP = 5; - WOL = 6; - } // If specified, the search will be restricted to the given networks (CIDR) repeated string network = 1; diff --git a/sandpolis/src/core/layer/sysinfo/applications/firefox.rs b/sandpolis/src/core/layer/sysinfo/applications/firefox.rs new file mode 100644 index 000000000..3c63c8808 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/applications/firefox.rs @@ -0,0 +1,30 @@ +/// The local user that owns the addon +pub uid: java.lang.String, +/// Addon display name +pub name: java.lang.String, +/// Addon identifier +pub identifier: java.lang.String, +/// Addon-supported creator string +pub creator: java.lang.String, +/// Extension, addon, webapp +pub type: java.lang.String, +/// Addon-supplied version string +pub version: java.lang.String, +/// Addon-supplied description string +pub description: java.lang.String, +/// URL that installed the addon +pub source_url: java.lang.String, +/// Whether the addon is shown in the browser +pub visible: java.lang.Boolean, +/// Whether the addon is active +pub active: java.lang.Boolean, +/// Whether the addon is disabled +pub disabled: java.lang.Boolean, +/// Whether the addon is applies background updates +pub autoupdate: java.lang.Boolean, +/// Whether the addon includes binary components +pub native_addon: java.lang.Boolean, +/// Global, profile location +pub location: java.lang.String, +/// Path to plugin bundle +pub path: java.lang.String, diff --git a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Battery.json b/sandpolis/src/core/layer/sysinfo/hardware/battery.rs similarity index 55% rename from core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Battery.json rename to sandpolis/src/core/layer/sysinfo/hardware/battery.rs index 4a71363b9..220926d2b 100644 --- a/core/ext/sandpolis-core-ext-osquery/src/main/json/Profile/Battery.json +++ b/sandpolis/src/core/layer/sysinfo/hardware/battery.rs @@ -1,42 +1,29 @@ +pub struct Battery { + /// Manufacturer's name + pub manufacturer: Option, + + /// The date the battery was manufactured UNIX Epoch + pub manufacture_date: Option, + + /// Model number + pub model: Option, + + /// Serial number + pub serial_number: Option, + + /// Number of charge/discharge cycles + pub cycle_count: Option, + + /// Whether the battery is currently being changed by a power source + pub charging: Option, + + /// Whether the battery is completely charged + pub charged: Option, +} + { "collection": true, "attributes": [ - { - "name": "manufacturer", - "type": "java.lang.String", - "description": "The battery manufacturer's name", - "osquery": "battery.manufacturer" - }, - { - "name": "manufacture_date", - "type": "java.lang.Long", - "description": "The date the battery was manufactured UNIX Epoch", - "osquery": "battery.manufacture_date" - }, - { - "name": "model", - "type": "java.lang.String", - "description": "The battery's model number", - "osquery": "battery.model" - }, - { - "name": "serial_number", - "type": "java.lang.String", - "description": "The battery's unique serial number", - "osquery": "battery.serial_number" - }, - { - "name": "cycle_count", - "type": "java.lang.Integer", - "description": "The number of charge/discharge cycles", - "osquery": "battery.cycle_count" - }, - { - "name": "charging", - "type": "java.lang.Boolean", - "description": "Whether the battery is currently being changed by a power source", - "osquery": "battery.charging" - }, { "name": "charged", "type": "java.lang.Boolean", @@ -79,4 +66,4 @@ "description": "The battery's current voltage in mV", "osquery": "battery.voltage" } -]} \ No newline at end of file +]} diff --git a/sandpolis/src/core/layer/sysinfo/hardware/cpu.rs b/sandpolis/src/core/layer/sysinfo/hardware/cpu.rs new file mode 100644 index 000000000..31d2555a5 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/hardware/cpu.rs @@ -0,0 +1,21 @@ +/// null +pub model: java.lang.String, +/// null +pub vendor: java.lang.String, +/// The specified frequency in Hertz +pub frequency_spec: java.lang.Integer, +/// The size of the L1 cache in bytes +pub l1_cache: java.lang.Integer, +/// The size of the L2 cache in bytes +pub l2_cache: java.lang.Integer, +/// The size of the L3 cache in bytes +pub l3_cache: java.lang.Integer, +/// The size of the L4 cache in bytes +pub l4_cache: java.lang.Integer, + +pub struct Core { +/// The core's usage between 0.0 and 1.0 +pub usage: java.lang.Double, +/// The core's temperature in Celsius +pub temperature: java.lang.Double, +} diff --git a/sandpolis/src/core/layer/sysinfo/hardware/disk/mod.rs b/sandpolis/src/core/layer/sysinfo/hardware/disk/mod.rs new file mode 100644 index 000000000..200ff74d3 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/hardware/disk/mod.rs @@ -0,0 +1,26 @@ +/// null +pub name: java.lang.String, +/// null +pub model: java.lang.String, +/// null +pub serial: java.lang.String, +/// The disk's total size in bytes +pub size: java.lang.Long, +/// null +pub reads: java.lang.Long, +/// null +pub read_bytes: java.lang.Long, +/// null +pub writes: java.lang.Long, +/// null +pub write_bytes: java.lang.Long, +/// null +pub queue_length: java.lang.Long, +/// null +pub transfer_time: java.lang.Long, +/// null +pub model_family: java.lang.String, +/// null +pub firmware_version: java.lang.String, +/// null +pub read_error_rate: java.lang.Long, diff --git a/sandpolis/src/core/layer/sysinfo/hardware/disk/partition.rs b/sandpolis/src/core/layer/sysinfo/hardware/disk/partition.rs new file mode 100644 index 000000000..0d9c7dd62 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/hardware/disk/partition.rs @@ -0,0 +1,16 @@ +/// null +pub identification: java.lang.String, +/// null +pub name: java.lang.String, +/// null +pub description: java.lang.String, +/// The partition's UUID +pub uuid: java.lang.String, +/// The partition's total size in bytes +pub size: java.lang.Long, +/// null +pub major: java.lang.Integer, +/// null +pub minor: java.lang.Integer, +/// The partition's mount point +pub mount: java.lang.String, diff --git a/sandpolis/src/core/layer/sysinfo/hardware/disk/smart.rs b/sandpolis/src/core/layer/sysinfo/hardware/disk/smart.rs new file mode 100644 index 000000000..cc4971742 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/hardware/disk/smart.rs @@ -0,0 +1,34 @@ +/// Drive rotations per minute +pub rotation_rate: java.lang.Long, +/// null +pub spin_up_time: java.lang.Long, +/// null +pub start_stop_cycles: java.lang.Long, +/// null +pub reallocated_sectors: java.lang.Long, +/// null +pub seek_error_rate: java.lang.Long, +/// null +pub power_on_time: java.lang.Long, +/// null +pub spin_retries: java.lang.Long, +/// null +pub calibration_retries: java.lang.Long, +/// null +pub power_cycles: java.lang.Long, +/// null +pub poweroff_retracts: java.lang.Long, +/// null +pub load_cycles: java.lang.Long, +/// null +pub temperature: java.lang.Long, +/// null +pub reallocated_events: java.lang.Long, +/// null +pub current_pending_sector: java.lang.Long, +/// null +pub offline_uncorrectable: java.lang.Long, +/// null +pub crc_errors: java.lang.Long, +/// null +pub multizone_error_rate: java.lang.Long, diff --git a/sandpolis/src/core/layer/sysinfo/hardware/display.rs b/sandpolis/src/core/layer/sysinfo/hardware/display.rs new file mode 100644 index 000000000..20c21e331 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/hardware/display.rs @@ -0,0 +1,12 @@ +/// The display's name +pub name: java.lang.String, +/// null +pub edid: java.lang.String, +/// The display's resolution +pub resolution: java.lang.String, +/// The display's physical size in pixels +pub size: java.lang.String, +/// Refresh frequency in Hertz +pub refresh_frequency: java.lang.Integer, +/// null +pub bit_depth: java.lang.Integer, diff --git a/sandpolis/src/core/layer/sysinfo/hardware/firmware.rs b/sandpolis/src/core/layer/sysinfo/hardware/firmware.rs new file mode 100644 index 000000000..2b17a8976 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/hardware/firmware.rs @@ -0,0 +1,14 @@ +/// null +pub name: java.lang.String, +/// The BIOS manufacturer title +pub manufacturer: java.lang.String, +/// The BIOS description +pub description: java.lang.String, +/// The BIOS version number +pub version: java.lang.String, +/// The BIOS revision number +pub revision: java.lang.String, +/// The BIOS release date +pub release_date: java.lang.String, +/// Whether the BIOS supports UEFI mode +pub uefi: java.lang.Boolean, diff --git a/sandpolis/src/core/layer/sysinfo/hardware/mainboard.rs b/sandpolis/src/core/layer/sysinfo/hardware/mainboard.rs new file mode 100644 index 000000000..0ddbdf354 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/hardware/mainboard.rs @@ -0,0 +1,8 @@ +/// null +pub model: java.lang.String, +/// null +pub manufacturer: java.lang.String, +/// null +pub version: java.lang.String, +/// null +pub serial_number: java.lang.String, diff --git a/sandpolis/src/core/layer/sysinfo/hardware/memory.rs b/sandpolis/src/core/layer/sysinfo/hardware/memory.rs new file mode 100644 index 000000000..9257a8eec --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/hardware/memory.rs @@ -0,0 +1,40 @@ +/// Handle, or instance number, associated with the structure in SMBIOS +pub handle: java.lang.String, +/// The memory array that the device is attached to +pub array_handle: java.lang.String, +/// Implementation form factor for this memory device +pub form_factor: java.lang.String, +/// Total width, in bits, of this memory device, including any check or error-correction bits +pub total_width: java.lang.Integer, +/// Data width, in bits, of this memory device +pub data_width: java.lang.Integer, +/// Size of memory device in bytes +pub size: java.lang.Integer, +/// Identifies if memory device is one of a set of devices. A value of 0 indicates no set affiliation. +pub set: java.lang.Integer, +/// String number of the string that identifies the physically-labeled socket or board position where the memory device is located +pub device_location: java.lang.String, +/// String number of the string that identifies the physically-labeled bank where the memory device is located +pub bank_location: java.lang.String, +/// Type of memory used +pub memory_type: java.lang.String, +/// Additional details for memory device +pub memory_type_details: java.lang.String, +/// Max speed of memory device in megatransfers per second (MT/s) +pub max_speed: java.lang.Integer, +/// Configured speed of memory device in megatransfers per second (MT/s) +pub configured_clock_speed: java.lang.Integer, +/// Manufacturer ID string +pub manufacturer: java.lang.String, +/// Serial number of memory device +pub serial_number: java.lang.String, +/// Manufacturer specific asset tag of memory device +pub asset_tag: java.lang.String, +/// Manufacturer specific serial number of memory device +pub part_number: java.lang.String, +/// Minimum operating voltage of device in millivolts +pub min_voltage: java.lang.Integer, +/// Maximum operating voltage of device in millivolts +pub max_voltage: java.lang.Integer, +/// Configured operating voltage of device in millivolts +pub configured_voltage: java.lang.Integer, diff --git a/sandpolis/src/core/layer/sysinfo/hardware/nic.rs b/sandpolis/src/core/layer/sysinfo/hardware/nic.rs new file mode 100644 index 000000000..303bb8846 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/hardware/nic.rs @@ -0,0 +1,56 @@ +/// The interface's name +pub name: java.lang.String, +/// The interface's description +pub description: java.lang.String, +/// The interface's maximum transmission unit in bytes +pub mtu: java.lang.Integer, +/// The interface's MAC address +pub mac: java.lang.String, +/// null +pub virtual: java.lang.Boolean, +/// The interface's IPv4 addresses +pub ipv4: java.lang.String, +/// The interface's IPv6 addresses +pub ipv6: java.lang.String, +/// null +pub broadcast: java.lang.String, +/// The interface's subnet mask +pub netmask: java.lang.String, +/// The number of bytes read from the interface +pub read_bytes: java.lang.Long, +/// The number of bytes written to the interface +pub write_bytes: java.lang.Long, +/// The number of packets read from the interface +pub read_packets: java.lang.Long, +/// The number of packets written to the interface +pub write_packets: java.lang.Long, +/// The number of read errors +pub read_errors: java.lang.Long, +/// The number of write errors +pub write_errors: java.lang.Long, +/// The number of read drops +pub read_drops: java.lang.Long, +/// The number of write drops +pub write_drops: java.lang.Long, +/// The number of write collisions +pub write_collisions: java.lang.Long, +/// The interface's maximum speed in bytes +pub link_speed: java.lang.Long, +/// null +pub default_gateway: java.lang.Boolean, +/// null +pub flag_up: java.lang.Boolean, +/// null +pub flag_running: java.lang.Boolean, +/// null +pub flag_loopback: java.lang.Boolean, +/// null +pub flag_multicast: java.lang.Boolean, +/// The interface's locally unique identifier +pub luid: java.lang.Long, +/// The interface's globally unique identifier +pub guid: java.lang.String, +/// Whether the interface is in a paused state +pub paused: java.lang.Boolean, +/// Whether the interface is in a low-power state +pub low_power: java.lang.Boolean, diff --git a/sandpolis/src/core/layer/sysinfo/hardware/sensor.rs b/sandpolis/src/core/layer/sysinfo/hardware/sensor.rs new file mode 100644 index 000000000..9e7ec52ba --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/hardware/sensor.rs @@ -0,0 +1,6 @@ +/// null +pub fan_speed: java.lang.Integer, +/// null +pub temperature: java.lang.Double, +/// null +pub voltage: java.lang.Double, diff --git a/sandpolis/src/core/layer/sysinfo/hardware/sound.rs b/sandpolis/src/core/layer/sysinfo/hardware/sound.rs new file mode 100644 index 000000000..377c5d0e0 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/hardware/sound.rs @@ -0,0 +1,6 @@ +/// null +pub driver_version: java.lang.String, +/// null +pub name: java.lang.String, +/// null +pub codec: java.lang.String, diff --git a/sandpolis/src/core/layer/sysinfo/hardware/usb.rs b/sandpolis/src/core/layer/sysinfo/hardware/usb.rs new file mode 100644 index 000000000..24852db23 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/hardware/usb.rs @@ -0,0 +1,12 @@ +/// null +pub name: java.lang.String, +/// null +pub vendor: java.lang.String, +/// null +pub vendor_id: java.lang.String, +/// null +pub product_id: java.lang.String, +/// null +pub serial_number: java.lang.String, +/// null +pub children: /profile/*/osquery/usb_device, diff --git a/sandpolis/src/core/layer/sysinfo/os/block_device.rs b/sandpolis/src/core/layer/sysinfo/os/block_device.rs new file mode 100644 index 000000000..d0f3c3572 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/block_device.rs @@ -0,0 +1,18 @@ +/// Block device name +pub name: java.lang.String, +/// Block device parent name +pub parent: java.lang.String, +/// Block device vendor string +pub vendor: java.lang.String, +/// Block device model string identifier +pub model: java.lang.String, +/// Block device size in blocks +pub size: java.lang.Long, +/// Block size in bytes +pub block_size: java.lang.Integer, +/// Block device Universally Unique Identifier +pub uuid: java.lang.String, +/// Block device type string +pub type: java.lang.String, +/// Block device label string +pub label: java.lang.String, diff --git a/sandpolis/src/core/layer/sysinfo/os/group.rs b/sandpolis/src/core/layer/sysinfo/os/group.rs new file mode 100644 index 000000000..b1ec78edf --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/group.rs @@ -0,0 +1,8 @@ +/// Unsigned int64 group ID +pub gid: java.lang.Integer, +/// Canonical local group name +pub name: java.lang.String, +/// Unique group ID +pub group_sid: java.lang.String, +/// Remarks or comments associated with the group +pub comment: java.lang.String, diff --git a/sandpolis/src/core/layer/sysinfo/os/kernel_module.rs b/sandpolis/src/core/layer/sysinfo/os/kernel_module.rs new file mode 100644 index 000000000..7fcaa3901 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/kernel_module.rs @@ -0,0 +1,10 @@ +/// Module name +pub name: java.lang.String, +/// Size of module content +pub size: java.lang.String, +/// Module reverse dependencies +pub used_by: java.lang.String, +/// Kernel module status +pub status: java.lang.String, +/// Kernel module address +pub address: java.lang.String, diff --git a/sandpolis/src/core/layer/sysinfo/os/memory.rs b/sandpolis/src/core/layer/sysinfo/os/memory.rs new file mode 100644 index 000000000..105432391 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/memory.rs @@ -0,0 +1,18 @@ +/// The amount of physical RAM in bytes +pub total: java.lang.Long, +/// The amount of physical RAM, in bytes, left unused by the system +pub free: java.lang.Long, +/// The amount of physical RAM, in bytes, used for file buffers +pub file_buffers: java.lang.Long, +/// The amount of physical RAM, in bytes, used as cache memory +pub cached: java.lang.Long, +/// The amount of sawp, in bytes, used as cache memory +pub swap_cached: java.lang.Long, +/// The total amount of buffer or page cache memory, in bytes, that is in active use +pub active: java.lang.Long, +/// The total amount of buffer or page cache memory, in bytes, that are free and available +pub inactive: java.lang.Long, +/// The total amount of swap available, in bytes +pub swap_total: java.lang.Long, +/// The total amount of swap free, in bytes +pub swap_free: java.lang.Long, diff --git a/sandpolis/src/core/layer/sysinfo/os/mod.rs b/sandpolis/src/core/layer/sysinfo/os/mod.rs new file mode 100644 index 000000000..cbe0ea184 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/mod.rs @@ -0,0 +1,20 @@ +/// Distribution name +pub name: java.lang.String, +/// The operating system's family +pub family: java.lang.String, +/// The operating system's manufacturer +pub manufacturer: java.lang.String, +/// The operating system's register width in bits +pub bitness: java.lang.Integer, +/// The operating system's primary version +pub version: java.lang.String, +/// Major release version +pub major_version: java.lang.Integer, +/// Minor release version +pub minor_version: java.lang.Integer, +/// The operating system's code name +pub codename: java.lang.String, +/// The operating system's build number +pub build_number: java.lang.String, +/// OS architecture +pub arch: java.lang.String, diff --git a/sandpolis/src/core/layer/sysinfo/os/mountpoint.rs b/sandpolis/src/core/layer/sysinfo/os/mountpoint.rs new file mode 100644 index 000000000..53abedbec --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/mountpoint.rs @@ -0,0 +1,22 @@ +/// Mounted device +pub device: java.lang.String, +/// Mounted device alias +pub device_alias: java.lang.String, +/// Mounted device path +pub path: java.lang.String, +/// Mounted device type +pub type: java.lang.String, +/// Block size in bytes +pub blocks_size: java.lang.Long, +/// Mounted device used blocks +pub blocks: java.lang.Long, +/// Mounted device free blocks +pub blocks_free: java.lang.Long, +/// Mounted device available blocks +pub blocks_available: java.lang.Long, +/// Mounted device used inodes +pub inodes: java.lang.Long, +/// Mounted device free inodes +pub inodes_free: java.lang.Long, +/// Mounted device flags +pub flags: java.lang.String, diff --git a/sandpolis/src/core/layer/sysinfo/os/network/arp.rs b/sandpolis/src/core/layer/sysinfo/os/network/arp.rs new file mode 100644 index 000000000..ed3c9f51b --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/network/arp.rs @@ -0,0 +1,8 @@ +/// IPv4 address target +pub address: java.lang.String, +/// MAC address of broadcasted address +pub mac: java.lang.String, +/// Interface of the network for the MAC +pub interface_id: java.lang.String, +/// Whether the ARP entry is permanent +pub permanent: java.lang.Boolean, diff --git a/sandpolis/src/core/layer/sysinfo/os/network/bound_port.rs b/sandpolis/src/core/layer/sysinfo/os/network/bound_port.rs new file mode 100644 index 000000000..195619406 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/network/bound_port.rs @@ -0,0 +1,18 @@ +/// Process (or thread) ID +pub pid: java.lang.Integer, +/// Transport layer port +pub port: java.lang.Integer, +/// Transport protocol (TCP/UDP) +pub protocol: java.lang.Integer, +/// Network protocol (IPv4, IPv6) +pub family: java.lang.Integer, +/// Specific address for bind +pub address: java.lang.String, +/// Socket file descriptor number +pub fd: java.lang.Long, +/// Socket handle or inode number +pub socket: java.lang.Long, +/// Path for UNIX domain sockets +pub path: java.lang.Long, +/// The inode number of the network namespace +pub net_namespace: java.lang.Long, diff --git a/sandpolis/src/core/layer/sysinfo/os/network/hosts.rs b/sandpolis/src/core/layer/sysinfo/os/network/hosts.rs new file mode 100644 index 000000000..e238cdfbf --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/network/hosts.rs @@ -0,0 +1,4 @@ +/// IP address mapping +pub address: java.lang.String, +/// Raw hosts mapping +pub hostnames: java.lang.String, diff --git a/sandpolis/src/core/layer/sysinfo/os/network/mod.rs b/sandpolis/src/core/layer/sysinfo/os/network/mod.rs new file mode 100644 index 000000000..2a9576bdd --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/network/mod.rs @@ -0,0 +1,6 @@ +/// The host's hostname +pub hostname: java.lang.String, +/// The host's fully-qualified domain name +pub fqdn: java.lang.String, +/// The host's DNS servers +pub dns: java.lang.String, diff --git a/sandpolis/src/core/layer/sysinfo/os/network/route.rs b/sandpolis/src/core/layer/sysinfo/os/network/route.rs new file mode 100644 index 000000000..99237c661 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/network/route.rs @@ -0,0 +1,20 @@ +/// Destination IP address +pub destination: java.lang.String, +/// Netmask length +pub netmask: java.lang.Integer, +/// Route gateway +pub gateway: java.lang.Integer, +/// Route source +pub source: java.lang.Integer, +/// Flags to describe route +pub flags: java.lang.Integer, +/// Route local interface +pub interface_id: java.lang.String, +/// Maximum Transmission Unit for the route +pub mtu: java.lang.Integer, +/// Cost of route. Lowest is preferred +pub metric: java.lang.Integer, +/// Type of route +pub type: java.lang.String, +/// Max hops expected +pub hopcount: java.lang.Integer, diff --git a/sandpolis/src/core/layer/sysinfo/os/process/fd.rs b/sandpolis/src/core/layer/sysinfo/os/process/fd.rs new file mode 100644 index 000000000..346de03c2 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/process/fd.rs @@ -0,0 +1,4 @@ +/// Process-specific file descriptor number +pub fd: java.lang.Long, +/// Filesystem path of descriptor +pub path: java.lang.Long, diff --git a/sandpolis/src/core/layer/sysinfo/os/process/mod.rs b/sandpolis/src/core/layer/sysinfo/os/process/mod.rs new file mode 100644 index 000000000..13b9aaf6a --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/process/mod.rs @@ -0,0 +1,42 @@ +/// null +pub name: java.lang.String, +/// null +pub path: java.lang.String, +/// null +pub command: java.lang.String, +/// null +pub working_directory: java.lang.String, +/// null +pub user: java.lang.String, +/// null +pub user_id: java.lang.String, +/// null +pub group: java.lang.String, +/// null +pub group_id: java.lang.String, +/// null +pub state: java.lang.String, +/// The process's process ID +pub pid: java.lang.Integer, +/// null +pub parent_pid: java.lang.Integer, +/// null +pub thread_count: java.lang.Integer, +/// null +pub priority: java.lang.Integer, +/// null +pub virtual_size: java.lang.Long, +/// The resident memory size in bytes +pub resident_set_size: java.lang.Long, +/// The number of milliseconds the process has executed in kernel mode +pub kernel_time: java.lang.Long, +/// The number of milliseconds the process has executed in user mode +pub user_time: java.lang.Long, +/// The epoch timestamp of the process start time +pub start_time: java.lang.Long, +/// The number of bytes the process has read from disk +pub bytes_read: java.lang.Long, +/// The number of bytes the process has written to disk +pub bytes_written: java.lang.Long, +/// The number of file handles that the process owns +pub handle_count: java.lang.Long, diff --git a/sandpolis/src/core/layer/sysinfo/os/process/namespace.rs b/sandpolis/src/core/layer/sysinfo/os/process/namespace.rs new file mode 100644 index 000000000..999574037 --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/process/namespace.rs @@ -0,0 +1,14 @@ +/// cgroup namespace inode +pub cgroup_namespace: java.lang.String, +/// ipc namespace inode +pub ipc_namespace: java.lang.String, +/// mnt namespace inode +pub mnt_namespace: java.lang.String, +/// net namespace inode +pub net_namespace: java.lang.String, +/// mnt namespace inode +pub pid_namespace: java.lang.String, +/// user namespace inode +pub user_namespace: java.lang.String, +/// uts namespace inode +pub uts_namespace: java.lang.String, diff --git a/sandpolis/src/core/layer/sysinfo/os/process/socket.rs b/sandpolis/src/core/layer/sysinfo/os/process/socket.rs new file mode 100644 index 000000000..60b3769cf --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/process/socket.rs @@ -0,0 +1,22 @@ +/// Process-specific file descriptor number +pub fd: java.lang.Long, +/// Socket handle or inode number +pub socket: java.lang.Long, +/// Network protocol (IPv4, IPv6) +pub family: java.lang.Long, +/// Transport protocol (TCP/UDP) +pub protocol: java.lang.Long, +/// Socket local address +pub local_address: java.lang.String, +/// Socket remote address +pub remote_address: java.lang.String, +/// Socket local port +pub local_port: java.lang.Integer, +/// Socket remote port +pub remote_port: java.lang.Integer, +/// For UNIX sockets (family=AF_UNIX), the domain path +pub path: java.lang.String, +/// TCP socket state +pub state: java.lang.String, +/// The inode number of the network namespace +pub net_namespace: java.lang.String, diff --git a/sandpolis/src/core/layer/sysinfo/os/user.rs b/sandpolis/src/core/layer/sysinfo/os/user.rs new file mode 100644 index 000000000..9e954826e --- /dev/null +++ b/sandpolis/src/core/layer/sysinfo/os/user.rs @@ -0,0 +1,12 @@ +/// User ID +pub uid: java.lang.Long, +/// Group ID +pub gid: java.lang.Long, +/// Username +pub username: java.lang.String, +/// Description +pub description: java.lang.String, +/// Home directory +pub directory: java.lang.String, +/// The user's default shell +pub shell: java.lang.String, diff --git a/sandpolis/src/core/mod.rs b/sandpolis/src/core/mod.rs index cffef4ecf..8306971e2 100644 --- a/sandpolis/src/core/mod.rs +++ b/sandpolis/src/core/mod.rs @@ -35,9 +35,6 @@ pub enum InstanceType { /// A headless application that installs or updates an agent or probe Deployer, - /// A headless application that provides read-only access to a host - Probe, - /// A headless application that coordinates interaction among instances Server, } @@ -49,7 +46,6 @@ impl InstanceType { InstanceType::BootAgent => 0b00000010, InstanceType::Client => 0b00000100, InstanceType::Deployer => 0b00001000, - InstanceType::Probe => 0b00010000, InstanceType::Server => 0b00100000, } } @@ -82,9 +78,10 @@ impl InstanceId { } } +/// Layers are optional feature-sets that may be enabled on instances. #[derive(Serialize, Deserialize, Clone, Copy, EnumIter, Debug, PartialEq, Eq)] pub enum Layer { - /// View accounts. + /// Manage accounts. #[cfg(feature = "layer-account")] Account, @@ -96,7 +93,8 @@ pub enum Layer { Desktop, // Docker, - /// Manipulate filesystem contents. + + /// Mount and manipulate filesystems. #[cfg(feature = "layer-filesystem")] Filesystem, @@ -119,7 +117,13 @@ pub enum Layer { Network, #[cfg(feature = "layer-packages")] Packages, - /// Interact with shell prompts / macros. + + /// Support for probe devices which do not run agent software. Instead they + /// connect through a "gateway" instance over a well known protocol. + #[cfg(feature = "layer-probe")] + Probe, + + /// Interact with shell prompts / snippets. #[cfg(feature = "layer-shell")] Shell, // Tunnel,