Commit Graph
5 Commits
Author SHA1 Message Date
Beenu AroraandBeenu Arora e78f31768c Move all fourteen ruff declarations to 0.16, and stop the lint gate at services/ (#861)
* Reformat the tree under ruff 0.16, excluding the subtree nobody may edit

Mechanical. `ruff format` with no other change, so the diff can be read as
"the formatter moved" rather than reviewed line by line: 218 files, 862
insertions against 1075 deletions, almost all of it collapsing calls that
0.4.10 wrapped and 0.16 fits inside the 140-column limit.

`plans/` is excluded in `ruff.toml` rather than reformatted. It is the
archived prototype subtree that `.github/workflows/codeql.yml` already
excludes and `scripts/check_mypy_baseline.py` excludes from every coverage
direction, and the project rules forbid editing anything under it -- so
formatting it would be a diff nobody may take. 844 lint findings and ~280
unformatted files live there. They are excluded because they cannot be
fixed, which is a different statement from saying the code is clean.

* Move all fourteen ruff declarations to 0.16, and stop the lint gate at services/

The bump alone reds every open pull request: `ruff format --check` is a hard
gate on the required `Python - Lint & Type-check` job and 0.16 formats
differently from 0.4.10. The reformat is the previous commit; this one moves
the pin, fixes the findings, and answers the scope question.

Fourteen declarations now read `>=0.16.8,<0.17` -- seven manifests, three
workflows, `.devcontainer/Dockerfile`, and the three `poetry.lock` files that
resolve it (now 0.16.9, which is byte-identical to 0.16.8 on both format and
lint across this tree).

The three findings 0.16 reports on `services/` are fixed, not suppressed: two
`C420` comprehensions become `dict.fromkeys` (both values are string literals,
so the shared-value hazard does not apply) and one `UP031` percent-format
becomes an f-string in a test that counts characters. All three rewrites were
asserted equal to the originals before being kept.

Scope. `ruff check services/` left `scripts/` -- every CI gate in this
repository, the code the rest of its claims are verified by -- linted by
nothing. Lint now covers `services/ scripts/ tests/ tools/`, the trees the
root `ruff.toml` governs that nothing else lints, and `ruff format --check .`
covers everything, because formatting has no semantic content and `.` needs
no edit when a tree is added. That surfaced 17 findings outside `services/`,
each fixed at the source: two `B007` loops switched to `.values()`, a `B904`
re-raise in `security_audit.py` now chains `from exc`, two `E402` imports
that genuinely follow a `sys.path` mutation carry a reason next to the
marker, and two over-length lines were wrapped.

`E501` is ignored for the two detection-spec data modules. Both open their
rule table with `# fmt: off`, so the formatter is already opted out of that
layout deliberately, and all 199 long lines are single dict or string
literals -- 72 positive fixtures, 66 negative, 50 `match_when` clauses, 11
descriptions. Two named files, not `scripts/`.

`packages/` and `plugins/` stay outside the lint gate, and the gap is a
number rather than a shrug: 91 findings and 2. Two of the five packages are
linted by their own workflows under their own configs, and bringing the
three published SDKs under this gate means behaviour-touching fixes that
belong in a change reviewed as such.

* Make packages/aisoc-detections clean under the ruff its own workflow now installs

`python-detections.yml` lints `aisoc_detections detections tests` under the
pin this PR moved, so the package has to be clean under 0.16 too. Two
findings, both fixed at the source rather than silenced: `Callable` moves to
`collections.abc`, and a `# noqa: BLE001` that 0.16 correctly reports as
unused becomes the sentence it was standing in for -- a detection module is
third-party content, so any exception at import is the author's and becomes a
DetectionError naming the file.

---------

Co-authored-by: Beenu Arora <beenu@MacBook-Pro-3.local>
2026-09-24 19:36:59 -07:00
Beenu AroraandBeenu Arora e8ab790e34 A scoreboard that can go stale loudly, and two modules go get can resolve (#738)
Waves 8 and 9 of v9.0.

The public scoreboard sat frozen at 2026-07-13 / v7.5.0 for ten weeks across
three releases while the page above it advertised weekly rows, and every
check in the repository passed throughout. Three reasons, all of them the
same mistake in different places.

check_scoreboard's "freshness" meant the accuracy value was current. Nothing
ever read a row's date. It also took the first substrate row in file order
rather than the newest by date, so a row appended in the wrong place would
silently have become the one every check measured.

--refresh rewrote only mitre_accuracy, leaving date, commit_sha and
agent_version untouched — so a refreshed row described today's code and
claimed to have been measured in July, which is a worse state than a stale
number because it looks current.

And there was no writer at all. wet-eval rewrites benchmark.md and a snapshot
and never touches scoreboard.json; live-agent-eval runs a real Ollama-hosted
agent and had permissions: contents: read, so it could not have published its
result if it tried. The docs promise an auto-PR appending a row and nothing
implemented it.

The ceiling is 45 days rather than 7 because the weekly job needs a funded
provider key it does not have, and a gate that reds main permanently for a
reason no contributor can fix is one people route around.

Separately: both published Go SDKs declared github.com/beenuar/aisoc/<name> —
wrong case against a case-sensitive VCS path, and missing the packages/
prefix — so go get resolved neither and neither was installable by anyone
outside this repository. Every in-repo consumer used a replace directive,
which is the shape that hides this: the tree builds perfectly and the
published artifact does not exist.

Co-authored-by: Beenu Arora <beenu@MacBook-Pro-3.local>
2026-09-23 15:09:41 -07:00
Beenu Arora 6fce93f7b9 feat: Stage-2 connector + surface wave (Wazuh, Auditd, Live Actions, NL→ES|QL, MISP push, GCP Terraform, postmortem) (#97)
Stage-2 connector + surface wave landing into main.

Highlights:
- Wazuh SIEM connector (poll + alert normalization) with marketplace plugin + docs
- Linux auditd EDR connector + 4 detection rules with positive/negative fixtures
- Live response actions framework (block IP, isolate host, kill process, disable user)
- Natural-language → ES|QL translator with grammar fallback and eval harness
- MISP threat-intel push integration with audit + retry
- GCP Terraform module for production deploys
- Automated case postmortem generation
- Docker compose hardening: vendored nl_query into services/api/app/_vendor/
  with sync script + CI guard so the aisoc-api image stays self-contained
- Full docs site updates (8 new pages), CHANGELOG + ROADMAP refresh,
  marketplace/index.json regeneration

26 CI checks green, 1 skipped, 0 failing.
2026-05-13 06:34:15 +08:00
Beenu Arora ebe2d5ea03 docs: rebrand to AiSOC community + fix repo URLs and metadata
Sweep the repository for stale Cyble Inc. authorship/branding,
outdated cyble-inc/AiSOC GitHub URLs, demo email/workspace strings,
and missing environment-variable docs. External integration
references (e.g. Cyble Vision threat-intel client) are intentionally
preserved as legitimate vendor product names.

Highlights:
- LICENSE, package.json, services/*/pyproject.toml, services/mcp,
  packages/sdk-{py,ts}/README, packages/types, packages/ui:
  copyright + author lines moved to AiSOC contributors / community.
- Service file headers (Python, Go, TypeScript) updated.
- README.md, ROADMAP.md, SECURITY.md, AGENTS.md, CONTRIBUTING.md,
  CHANGELOG.md: trim Cyble-only voice; reflect current OSS state.
- apps/docs/* (Docusaurus): config + docs pages refreshed,
  cyble-inc/AiSOC -> beenuar/AiSOC across links, deployment env-vars
  doc filled in for the realtime service.
- apps/web: layout/metadata, settings panel ("About AiSOC"), demo
  banner, copilot, alerts, cases workspace, marketplace view, footer,
  hero, sidebar, logo asset — Cyble-marketing strings replaced with
  open-source community framing.
- Plugins (plugins/*/plugin.yaml): homepage URLs corrected;
  marketplace/index.json regenerated from yamls.
- infra/ (docker-compose, helm chart, terraform): images and
  metadata aligned.
- schemas/playbook.schema.json: $id updated to new repo URL.
- scripts/export_openapi.py: header reauthored.
- services/api: main.py service description, demo_mode middleware,
  v1 endpoints (api_keys, plugins, graph, services, config) and
  default org/email values point at the OSS project.
- services/threatintel: client headers (CISA KEV, MISP, OTX, TAXII,
  STIX parsers, storage backends) re-attributed to community.
2026-05-04 10:18:32 -07:00
Beenu Arora 040eb2f36e feat: ship 200+ detections, 50+ playbooks, 15 plugins, marketplace
- Add ~200 detection rules across application, cloud, endpoint,
  identity, network, and data-exfiltration categories, plus
  community fixtures
- Add 50+ response playbooks (packs/ + community/) covering
  containment, eradication, recovery, and notification flows
- Add 15 plugins (Go and Python implementations) with manifests:
  cloudflare-waf, datadog-incidents, github-audit, gitlab-audit,
  jamf-mdm, mttr-widget, notion-incidents, okta-connector,
  onepassword-events, pagerduty-paging, slack-quarantine,
  snowflake-events, tailscale-acl, twilio-sms, yara-enricher
- Add marketplace builder + JSON index served from web app and root
- Wire MarketplaceView frontend onto the new index format
- Add detection/playbook generators, lint/validate scripts, and
  GitHub Actions workflows (validate-detections, validate-playbooks,
  sync-marketplace)
- Add plugin SDK widget primitive (packages/plugin-sdk-go)
- Ignore plugin Go test/build binaries
2026-05-04 04:19:51 -07:00