28 Commits

Author SHA1 Message Date
Dan Guido 41508a016c chore: replace mypy with ty in Makefile lint targets
Update lint-component target to use ty (Astral type checker) instead of mypy:
- Run ty check for all components uniformly
- Add fuzzer_runner to available components list
- Simplify type checking logic

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 10:59:15 +01:00
Henrik Brodin 91656f0ca8 Fix port-forward cleanup to only kill specific process (#405)
Previously, `send-integration-task` and `send-libpng-task` used
`pkill -f "kubectl port-forward"` which killed ALL kubectl port-forward
processes. This was problematic when other port-forwards were running.

Now each target captures the PID of the port-forward it starts and kills
only that specific process when done.
2025-12-15 09:32:37 +01:00
Arsalan c7c0e98d4b Add warnings about SigNoz re-deployment (#365) 2025-10-07 09:19:33 +02:00
Riccardo Schirone 5253cc2e1e Do not ask for deployment confirmation in CI (#358)
* Do not ask for deployment confirmation in CI
* add otel token to CI
* remove unnecessary comment
* approve patch
2025-09-16 17:19:06 +02:00
Riccardo Schirone ba9f0e5571 Add Tailscale support to the custom scripts (#354) 2025-09-16 15:14:35 +02:00
Riccardo Schirone 143a59c236 fuzzer_runner: split fuzzer's dependencies (#320)
Before this commit, the fuzzer dependend on clusterfuzz, which uses
protobuf 3.20. Since fuzzer-bot depended on common subpackage as well
and also common (and the other packages) require protobuf, we had to use
protobuf 3.20 everywhere. This old dependency however means that a lot
of packages can't be used in their "newer" versions, because they depend
on newer protobuf versions.

This commit splits the fuzzer into a separate fuzzer-runner that is
executed in a separate process inside a separate venv. fuzzer-runner
executes the clusterfuzz-heavy operations (e.g. fuzzing) and isolates the
clusterfuzz dependency, so that the rest of the system can use newer
protobuf version.

* split `fuzzer-bot` in `fuzzer-runner` and `fuzzer-bot`
* have a "full" optional dependency group in `common`, including `openlit`
  and `protobuf`, so that `fuzzer-runner` can use the lite version of `common`
  without bringing those heavy deps
* move `FuzzConfiguration`/`BuildConfiguration` in a separate common file
  that doesn't require to load all protobuf files. Again, in this way
  other components can just depend on the `common` "lite" version and not
  require protobuf stuff
* add `fuzzer-runner` as a separate venv inside the `fuzzer-bot` container
* add `RunnerProxy` class in fuzzer package to provide an interface to
  interact with the fuzzer-runner binary.
2025-09-10 09:52:08 +02:00
Riccardo Schirone 3fd777063b Test and improve AKS deployment (#336)
* Test configuration for Azure deployment
* ci: re-enable docker build/push
* ci: docker push labeled PRs
* Use `make deploy` for both local and azure deployments
* doc: update AKS_DEPLOYMENT doc
* add confirmation in Makefile
* Make resource group location configurable
2025-09-08 16:57:08 +02:00
Evan Downing b1a558da0f Update location and name of cscope (#246)
* Update location and name of cscope

* Update README and add quick test script

* Add architecture check and disable full test for now

* Remove test script. Enable libpng integration test

---------

Co-authored-by: Michael D Brown <michael.brown@trailofbits.com>
2025-08-14 21:44:22 -04:00
Riccardo Schirone a8ed0ccbbe feat: Add local SigNoz deployment support (#232)
* feat: Add simplified SigNoz integration using official Helm chart

- Add SigNoz as a Helm dependency with conditional deployment
- Enable SigNoz by default for minikube environments
- Auto-configure OTEL to use internal SigNoz when enabled
- Update Docker Compose to include existing SigNoz stack
- Minimal configuration following the official chart approach

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>

* Configure local signoz

* do not deploy signoz in ci

* makefile: ensure signoz is available

* feat: Simplify SigNoz integration for improved user experience

- Remove external SigNoz configuration prompts from setup-local script
- Make local SigNoz deployment the default for quickstart experience
- Move external SigNoz configuration to MANUAL_SETUP.md for advanced users
- Streamline README log access section to focus on local SigNoz UI
- Relocate kubectl commands to QUICK_REFERENCE.md as alternative method
- Improve documentation structure for better user onboarding

Addresses feedback from @michaelbrownuc to simplify the integration
before merging.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>

* Update MANUAL_SETUP.md

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>
2025-08-06 09:35:53 -04:00
Brad Swain c350d95221 Enforce mypy on fuzzer component (#229)
* Enforce mypy on fuzzer component

- Add mypy type checking enforcement for fuzzer component in Makefile
- Fix 39 type errors across 9 files in fuzzer component:
  - Add missing return type annotations (-> None, -> bool, -> int)
  - Fix Beautiful Soup union type issues with proper casting and None checks
  - Fix TemporaryDirectory path usage by using .name attribute
  - Add type annotations for function parameters and variables
  - Handle potential None values in registry and XML parsing

All fuzzer component files now pass strict mypy type checking.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Brad Swain <BradSwain@users.noreply.github.com>

* fix tests

* Update fuzzer/src/buttercup/fuzzing_infra/builder_bot.py

Co-authored-by: Riccardo Schirone <562321+ret2libc@users.noreply.github.com>

* Update fuzzer/src/buttercup/fuzzing_infra/builder_bot.py

Co-authored-by: Riccardo Schirone <562321+ret2libc@users.noreply.github.com>

* use pathlike[str] instead of tmpdir

* update test to use Path directly

* fix type annotation

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Brad Swain <BradSwain@users.noreply.github.com>
Co-authored-by: Riccardo Schirone <562321+ret2libc@users.noreply.github.com>
2025-08-04 16:49:36 -04:00
Brad Swain 627ea06507 make lint fail if any component lint fails. (#242)
Previously the failure would be printed but the loop would continue.
The final exit code only depended on the last component checked.
2025-08-04 15:39:36 -04:00
Disconnect3d c72b76575b make web-ui: explicitly show web-ui url (#239) 2025-08-04 18:19:25 +02:00
Riccardo Schirone 7eb017a6ad Makefile: add a web-ui target to open the UI (#234) 2025-08-04 09:08:00 -04:00
Riccardo Schirone 3cd643e667 ci: reenable example-libpng integration test (#222)
* ci: try to reenable example-libpng integration test

* ci: try to use GITHUB_TOKEN

* ci: deploy the cluster

* ci: try private runner

* ci: no need for kubeconfig setting anymore

* Makefile: make all targets namespace flexible

* ci: use the right github token secret

* Makefile: make send-* targets return 0

* ci: use buttercup-ui and don't kill port-forward

* orchestrator/ui: add /webhook/sarif endpoint

* orchestrator/ui: model dump the broadcast

* ui: implement a few other competition-api endpoints

* ui: fix bundle apis
2025-08-04 09:07:20 -04:00
Riccardo Schirone 9060bc7a1e enforce: Add mypy type checking to seed-gen component (#225)
* enforce: Add mypy type checking to seed-gen component

- Add seed-gen to mypy enforcement in Makefile (line 181)
- Update Makefile comment to reflect current mypy-enabled components
- Fix critical type errors:
  - Add return type annotations to functions
  - Add null safety checks for settings.server in CLI
  - Fix OutputParserException string formatting
  - Add type annotation for Command objects
- Reduce mypy errors from 65 to 51

The seed-gen component now enforces mypy type checking during linting,
matching the standard applied to common, patcher, orchestrator, and
program-model components.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>

* ci: enable seed-gen mypy

* fix: Resolve all mypy type checking issues in seed-gen component

- Move @tool decorated functions outside of classes to fix self parameter issues
- Add proper type annotations and type casting for BaseTaskState subclasses
- Fix return type mismatches with type ignore comments where appropriate
- Resolve attribute access issues using cast() for proper type narrowing
- Update import statements to include required BaseTaskState type
- Fix Redis return type handling in task counter
- Address unreachable code warnings in CLI module

All 51 mypy errors have been resolved, enabling full type checking compliance.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: trigger CI rebuild after mypy fixes

All mypy issues in seed-gen have been resolved but CI may need
a fresh build to recognize the changes.

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>

* fix: Move BaseTaskState class definition before @tool functions

Resolves forward reference issue where BaseTaskState was referenced
in @tool decorated functions before being defined.

Changes:
- Move BaseTaskState class to appear after imports, before Task class
- Use forward references for types not yet defined (HarnessInfo, ToolCallResult, Task)
- Remove duplicate class definition
- Update method signatures to use direct class references

Co-authored-by: Alessandro Gario <alessandrogario@users.noreply.github.com>

* fix: Address review comments for mypy type checking

- Add types-redis to pyproject.toml dev dependencies
- Remove unnecessary comment from __init__.py
- Move cast imports to top of files and add type assertions
- Improve type safety with proper casting and assertions

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>

* fix mypy manually

* common: reintroduce removed line by mistake

* fix overrides

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Alessandro Gario <alessandrogario@users.noreply.github.com>
2025-08-04 09:05:01 -04:00
Alessandro Gario dd472e325b make: Halt deployment if there are uninitialized submodules (#217) 2025-08-01 08:17:09 +02:00
Riccardo Schirone c9d49f76f7 feat: save CRS artifacts to run-data directories (#206)
* feat: save CRS artifacts to run-data directories

Add functionality to automatically save POVs, patches, and bundles
received from the CRS into organized run-data-<timestamp> directories
structured by task-id as requested in issue #205.

Changes:
- Add run_data_dir configuration setting to Settings
- Implement save_artifact() utility function with proper base64 decoding
- Modify bundle, patch, and POV endpoints to save artifacts to disk
- Create directory structure: run-data-YYYYMMDDHHMMSS/<task-id>/{povs,patches,bundles}/
- Handle different file types: .json for bundles, .patch for patches, .bin for POVs

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>

* feat: add hostPath volume for buttercup-ui run data access

- Add run-data-volume hostPath mount to UI deployment for minikube
- Maps container /tmp/buttercup-run-data to host /data/buttercup-run-data
- Enables external access to CRS artifacts (POVs, patches, bundles)
- Falls back to emptyDir for non-minikube environments

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>

* fix: add BUTTERCUP_UI_RUN_DATA_DIR environment variable to UI deployment

- Set BUTTERCUP_UI_RUN_DATA_DIR to /tmp/buttercup-run-data to match volume mount
- Ensures UI application saves run data artifacts to the correct directory
- Run data will now be accessible outside Kubernetes cluster via hostPath volume

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>

* fix save-artifact feature

* orchestrator: fix lint

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>
Co-authored-by: Michael D Brown <michael.brown@trailofbits.com>
2025-07-31 10:10:59 -04:00
Riccardo Schirone 5cfa9bd26e Add support for ARM (#207)
* Fix integration-test run

* use the proper oss-fuzz-aixcc commit to run integration-test
* determine OSS_FUZZ_CONTAINER_ORG at runtime
* use `git diff` in the patcher to create the patch to fix a problem
  with patches affecting non-newline terminated files

* fix parsing

* fix program-model lint

* Modify CRS to work on MacOS/ARM

* Use LibUCL for testing

* use example-libpng

* fix linting

* common: fix tests
2025-07-31 09:55:36 -04:00
Riccardo Schirone 744a5ae2e6 Makefile: enable mypy for orchestrator (#213) 2025-07-31 15:46:22 +02:00
Riccardo Schirone 4f41f4de11 Remove just tool completely and migrate all functionality to Makefiles (#210)
* Remove just tool completely and migrate all functionality to Makefiles

- Added install-cscope, lint-python, and lint-python-all targets to main Makefile
- Created program-model/Makefile with all justfile functionality
- Removed justfiles from both main and program-model directories
- Updated all documentation to use make commands instead of just
- Removed just installation and checking functions from setup scripts
- All functionality preserved with equivalent make targets

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>

* Remove duplicate lint-python targets from Makefile

These targets duplicated existing lint and lint-component targets.
Updated CLAUDE.md to reference the correct make targets.

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>

* Fix remaining references to removed lint-python targets in documentation

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>

* Fix Makefile: Add missing targets to .PHONY declaration

Added lint, lint-component, clean-local, wait-crs, check-crs,
crs-instance-id, status, and send-integration-task to .PHONY
to ensure they work correctly even if files with those names exist.

Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>

* ci: remove just references

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Riccardo Schirone <ret2libc@users.noreply.github.com>
Co-authored-by: Michael D Brown <michael.brown@trailofbits.com>
2025-07-31 09:41:02 -04:00
Brad Swain 8be0290a6c Cleanup make commands (#191)
* add 'status' make command to check deployment status
* unify make commands
* rename `make test` to `make send-integration-task`
* add check-crs message
2025-07-30 09:45:42 +02:00
Brad Swain 703c7e7e76 make lint match ci checks (#199) 2025-07-30 09:18:46 +02:00
Evan Downing 0428c66377 Update challenge urls and docs (#162) 2025-07-22 11:01:47 -04:00
Riccardo Schirone 1d385cf89f Make deployment easier (#158)
* deployment: just use the value in values.template

* ci: disable integration tests and private settings

* Download trailofbits cscope, not aixcc-finals one

* ci: fix docker login to ghcr.io

* Changes to allow non aixcc deployment

* buttercup-ui: basic skeleton for a CRS interface

* file-server implementation

* add ui to k8s

* other apis

* try to fix k8s

* remove some labels

* fix ui

* small fixes to doc

* ui: support for cloning private repos

* Add setup scripts for easy deployment

* update scripts

* update make/readme

* small adj

* address review

* we need 0.0.0.0 for k8s
2025-07-11 07:31:57 -04:00
Ronald Eytchison cb62a10313 Add makefile and update stimulate-fuzzer-test command 2025-01-27 16:12:13 -05:00
Riccardo Schirone dee20dd7b6 Introduce Buttercup namespace for CRS components (#5)
* orchestrator: create pkg under 'buttercup' namespace

* fix compose file
2025-01-17 08:59:16 +01:00
Riccardo Schirone c10a041b6e orchestrator: update code 2025-01-14 13:32:00 +01:00
Riccardo Schirone 9601bb52e8 crs_api: initial skeleton of crs_api component 2025-01-13 18:43:31 +01:00