Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/i2z1/airfleet

FleetDM API wrapper for threat hunting with R
https://github.com/i2z1/airfleet

fleetdm mdm osquery r

Last synced: 3 months ago
JSON representation

FleetDM API wrapper for threat hunting with R

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

```{r generate_hex, include=FALSE, fig.path="man/figures/hex-"}
library(hexSticker)
library(ggplot2)
library(ggforce)

up_line <- function(x,b,r){
y <- x + b
df <- data.frame(x = x,
y = y,
r = r)
return(df)
}

df <- data.frame(x = c(1,3,5),
y = c(1,3,5),
r = c(0.75,0.75,0.75))
df_up <- up_line(x = c(1.3,3.3), b = 2, r = 0.35)
df_down <- up_line(x = c(3,5), b = -1.8, r = 0.35)

df_all <- rbind(df, df_up, df_down)

p <- ggplot(df_all, aes(x0 = x, y0 = y, r =r)) +
geom_circle(color = "red", fill = "darkred") +
ggplot2::theme_void() +
scale_size(range = c(1, -1)) +
coord_fixed()

pic <- p + theme_void() + theme_transparent()

hexSticker::sticker(pic, package="airfleet",
p_size=22,
p_y=1.55,
s_x=1,
s_y=.85,
s_width=1.7,
s_height=1,
h_fill = "#000000",
p_color = "#0d8b9f",
h_color = "#e13ed3", #border
p_family = "teko",
filename="man/figures/hex.png")
```

# aiRfleet

Fleet device management API wrapper for R.

[FleetDM](https://fleetdm.com/) is a centralized MDM open-source solution for gathering hosts data via [osquery](https://osquery.io/) and presenting it in normalized table view.

This package is inspired by [osqueryr](https://github.com/hrbrmstr/osqueryr) R package.

## Installation

You can install the development version of aiRfleet from [GitHub](https://github.com/) with:

``` r
# install.packages("pak")
pak::pak("i2z1/airfleet")
```

or

``` r
# install.packages("devtools")
devtools::install_github("i2z1/airfleet")
```

## Usage

### Get Fleet hosts as dataframe

``` r
flt_con <- flt_connection(host = Sys.getenv("FLEET_HOST"),
apitoken = Sys.getenv("FLEET_TOKEN"))

hosts_df <- get_hosts(flt_con)
```

### List Fleet queries

``` r
queries_df = query_list(flt_con)
```

### Create query

``` r
query_create(flt_con, name = "users_qry", query = "SELECT * from users;")
```

### Delete query

``` r
query_delete(flt_con, id=51)
```