Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
adonm authored Feb 22, 2024
1 parent 80bc12a commit cd6d14a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 10 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Release notes

<!-- do not remove -->

## 1.3.0

Updated to include api clients and msticpy. Also adjusted build env to use python 3.11


19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# SIEM Query Utils


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Install

``` sh
pip install https://github.com/wagov/nbdev-squ/archive/refs/heads/main.tar.gz
pip install https://github.com/wagov/nbdev-squ/archive/refs/tags/v1.3.0.tar.gz
```

## How to use

***<mark style="background-color: lightblue"> Note: If you create/use a Github Codespace on any of the wagov repos, SQU_CONFIG should be configured automatically. </mark>***
*Note: If you create/use a Github Codespace on any of the wagov repos,
SQU_CONFIG should be configured automatically.*

Before using, config needs to be loaded into `squ.core.cache`, which can
be done automatically from json in a keyvault by setting the env var
Expand All @@ -21,7 +23,7 @@ export SQU_CONFIG="{{ keyvault }}/{{ tenantid }}"
```

``` python
from nbdev_squ import api, clients
from nbdev_squ import api
import io, pandas

# Load workspace info from datalake blob storage
Expand All @@ -46,14 +48,17 @@ print(len(api.azcli(["account", "list"])))
# Various pre-configured api clients

# RunZero
#response = clients.runzero.get("/export/org/assets.csv", params={"search": "has_public:t AND alive:t AND (protocol:rdp OR protocol:vnc OR protocol:teamviewer OR protocol:telnet OR protocol:ftp)"})
#runzero_assets = pandas.read_csv(io.StringIO(response.text))
response = api.clients.runzero.get("/export/org/assets.csv", params={"search": "has_public:t AND alive:t AND (protocol:rdp OR protocol:vnc OR protocol:teamviewer OR protocol:telnet OR protocol:ftp)"})
pandas.read_csv(io.StringIO(response.text)).head(10)

# Jira
#issues = clients.jira.jql("updated > -1d")["issues"]
pandas.json_normalize(api.clients.jira.jql("updated > -1d")["issues"]).head(10)

# AbuseIPDB
#clients.abuseipdb.check_ip("1.1.1.1")
api.clients.abuseipdb.check_ip("1.1.1.1")

# TenableIO
pandas.DataFrame(api.clients.tio.scans.list()).head(10)
```

``` python
Expand Down
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ npm install
npm run build
nbdev_clean
nbdev_export
nbdev_readme
nbdev_install_hooks

1 change: 1 addition & 0 deletions nbdev_squ/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Clients:
"""
@cached_property
def config(self):
login()
return cache.get("config", load_config())

@cached_property
Expand Down
1 change: 1 addition & 0 deletions nbs/01_api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
" \"\"\"\n",
" @cached_property\n",
" def config(self):\n",
" login()\n",
" return cache.get(\"config\", load_config())\n",
"\n",
" @cached_property\n",
Expand Down
4 changes: 3 additions & 1 deletion nbs/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"metadata": {},
"source": [
"```sh\n",
"pip install nbdev_squ\n",
"pip install https://github.com/wagov/nbdev-squ/archive/refs/tags/v1.3.0.tar.gz\n",
"```"
]
},
Expand All @@ -46,6 +46,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"*Note: If you create/use a Github Codespace on any of the wagov repos, SQU_CONFIG should be configured automatically.*\n",
"\n",
"Before using, config needs to be loaded into `squ.core.cache`, which can be done automatically from json in a keyvault by setting the env var `SQU_CONFIG` to `\"keyvault/tenantid\"`.\n",
"\n",
"```bash\n",
Expand Down
3 changes: 1 addition & 2 deletions nbs/sidebar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ website:
contents:
- index.ipynb
- 00_core.ipynb
- 01_api.ipynb
- 02_clients.ipynb
- 01_api.ipynb

0 comments on commit cd6d14a

Please sign in to comment.