From d43d0babea6f244130cdfcf61c96941db4103168 Mon Sep 17 00:00:00 2001 From: behobu Date: Wed, 3 Jun 2026 15:47:20 -0600 Subject: [PATCH 1/5] feat(scripts): add scripts area with per-script docs and TLS cert tool Establish a home for scripts that interact with Monad via its API, with a convention that every script ships usage and limitations documentation. - scripts/: one directory per script, each with a required README; a catalog table (with a Category column) in scripts/README.md; a copy-to-start _template/ (doc template + script stub with API-key/curl-config conventions). - CONTRIBUTING.md: how to add a script + PR checklist (Limitations section required; no committed secrets; dry-run for state-changing scripts). - LICENSE: add MIT. - README.md: fix stale clone URL (monad-community/monad-community -> monad-inc/community) and add a Scripts section. - First script: tls-cert-to-syslog-input (registers device TLS cert SHA-256 fingerprints on a pipeline's Syslog input for SNI-less routing) with full usage + limitations README. Co-Authored-By: Claude Opus 4.8 --- CONTRIBUTING.md | 55 +++ LICENSE | 21 + README.md | 17 +- scripts/README.md | 39 ++ scripts/_template/README.md | 61 +++ scripts/_template/script.sh | 62 +++ scripts/tls-cert-to-syslog-input/README.md | 111 +++++ .../monad-tls-cert-to-pipeline.sh | 416 ++++++++++++++++++ 8 files changed, 780 insertions(+), 2 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 scripts/README.md create mode 100644 scripts/_template/README.md create mode 100644 scripts/_template/script.sh create mode 100644 scripts/tls-cert-to-syslog-input/README.md create mode 100755 scripts/tls-cert-to-syslog-input/monad-tls-cert-to-pipeline.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d46a9ea --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,55 @@ +# Contributing + +Thanks for adding to the Monad Community repo. This guide covers contributing +**scripts** (the `scripts/` directory); for blog assets, just add files under +`blog/`. + +## Adding a script + +Every script lives in its own directory under `scripts//` and ships with a +`README.md` documenting **how to use it and its limitations**. A script without +that documentation will not be merged. + +1. **Scaffold from the template:** + ```bash + cp -r scripts/_template scripts/ + ``` + Use a short, descriptive `kebab-case` slug (e.g. `tls-cert-to-syslog-input`). + +2. **Add your script** to that directory (`.sh`, `.py`, etc.). Keep it + self-contained; put sample inputs/outputs under an `examples/` subfolder. + +3. **Fill in `scripts//README.md`** — every section of the template, + especially **Limitations & caveats**. Be honest about what the script does + *not* do, what permissions it needs, and any edge cases. + +4. **Register it** in the catalog table in [`scripts/README.md`](scripts/README.md) + (one row: script, purpose, language, Monad API surface, category, link). + +5. **Open a PR.** See the checklist below. + +## Conventions + +- **Secrets never get committed.** Read credentials from an environment variable + (e.g. `MONAD_API_KEY`), a secrets manager, or an interactive prompt — never a + literal in the script or examples. Keep API keys out of the process list where + practical (e.g. pass headers to `curl` via `--config`, not the command line). +- **Be portable and dependency-light.** Note the interpreter and required tools + (and versions) in the README. For Bash, target `bash` 3.2 (macOS default) where + feasible. +- **Offer a dry run** for anything that writes/changes Monad state, so users can + preview before committing. +- **Document the Monad API surface** the script touches (endpoints, MCP tools, or + connectors) and the API-key permissions required. +- **Commits** follow [Conventional Commits](https://www.conventionalcommits.org/): + `feat(scripts): add `, `fix(scripts): …`, `docs(scripts): …`. Branch names + mirror the type: `feat/`, `fix/`. + +## PR checklist + +- [ ] Script lives in `scripts//` with a populated `README.md`. +- [ ] **Limitations & caveats** section is filled in (not left as a placeholder). +- [ ] No secrets committed; credentials sourced from env/secret manager/prompt. +- [ ] Usage examples included; a dry-run path exists for state-changing scripts. +- [ ] Added a row to `scripts/README.md`. +- [ ] Conventional Commit message and matching branch name. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bc7b5b7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Monad, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 79ee445..f823de7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Welcome to the **Monad Community** repo, a central hub for all public-facing tec This repo contains a variety of public assets aimed at enhancing understanding and usability of data engineering concepts for cybersecurity. Key categories include: - **Log Samples**: Real-world before-and-after examples of log transformations, such as flattening, masking, and filtering. -- **Code Snippets**: Ready-to-use scripts and configurations to help you implement and optimize your data pipelines. +- **Code Snippets**: Ready-to-use scripts and configurations to help you implement and optimize your data pipelines. See [`scripts/`](scripts/). - **Transformation Examples**: JSON examples to showcase how data can be cleaned, normalized, and structured for better usability and actionability. - **Technical Assets**: Additional technical resources relevant to Monad’s security data platform and ecosystem. @@ -21,13 +21,26 @@ This repo contains a variety of public assets aimed at enhancing understanding a 2. **Download or Clone**: - Clone the repository locally using: ```bash - git clone https://github.com/monad-community/monad-community.git + git clone https://github.com/monad-inc/community.git ``` - Or download the specific files you’re interested in. 3. **Learn and Experiment**: Use the provided examples to improve your workflows, whether it’s optimizing log transformations, implementing cost-efficient data routing, or enhancing alert prioritization. --- +## 🧰 Scripts + +Utility scripts that interact with Monad (REST API, MCP tools, or connectors) +live under [`scripts/`](scripts/). Each script has its own directory with a +`README.md` documenting its usage and limitations, and the catalog in +[`scripts/README.md`](scripts/README.md) lists what's available. + +To add one, see [`CONTRIBUTING.md`](CONTRIBUTING.md) — copy `scripts/_template/`, +fill in the README (including its **Limitations** section), and register it in the +catalog. + +--- + ## 🚀 How This Can Help You The assets provided in this repository are tailored to support security teams in: diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..c8a01bb --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,39 @@ +# Scripts + +Utility scripts that interact with Monad (its REST API, MCP tools, or +connectors). Each script lives in its own directory with a `README.md` covering +its usage and limitations. + +## Catalog + +| Script | Purpose | Language | Monad API surface | Category | Docs | +|---|---|---|---|---|---| +| [`tls-cert-to-syslog-input`](tls-cert-to-syslog-input/) | Register device TLS-certificate SHA-256 fingerprints on a pipeline's Syslog input so SNI-less sources route correctly | Bash | `GET /v1/organizations`, `GET /v2/{org}/pipelines/{id}`, `GET /v1/{org}/inputs/{id}`, `PATCH /v2/{org}/inputs/{id}` | Inputs / routing | [README](tls-cert-to-syslog-input/README.md) | + +## Layout + +``` +scripts/ +├── README.md # this catalog +├── _template/ # copy this to start a new script +│ ├── README.md # per-script doc template (fill every section) +│ └── script.sh # script header/convention stub +└── / # one directory per script + ├── README.md # required: usage + limitations + ├──