Files
harpia/CONTRIBUTING.md

3.8 KiB

Contributing to Harpia

English · Português

Thanks for helping. Harpia is a continuous attack surface and vulnerability audit engine built around deterministic evidence and least-privilege operation. The most useful contributions right now are tests, fixtures, documentation, and well-scoped engine components.

  1. Authorized auditing only. Harpia is defensive software for networks you own or are explicitly authorized to audit. Do not introduce scanning techniques, collection mechanisms, or evasion methods that hide scope, bypass authorization checks, or perform destructive testing.
  2. Deterministic evidence is part of the feature. Every vulnerability finding and service detection must record its exact inputs, raw banners, candidate CPEs, and matching rules. A score or finding without a reproducible JSON evidence record is not accepted.
  3. Be transparent about what works. If a feature is a stub, restricted to Linux NET_RAW, or represents a degraded mode (such as nativo-sem-raw), document it clearly in the README, CLI help, and test suite.
  4. 100% English codebase. Source code, comments, scripts, workflows, and commit messages are in English. The web dashboard remains bilingual (PT-BR source and English via i18n-en.js).

Workflow

scripts/install-hooks.sh
scripts/check.sh

check.sh validates code formatting, clippy with warnings as errors, UI translation coverage, shell script syntax, workflow YAML files, SemVer consistency and docker compose config in about a minute; scripts/check.sh --full also runs the workspace tests and cargo audit.

Interface and translation

The interface source text is Portuguese. English translations reside in apps/gui/ui/i18n-en.js and are applied at runtime by i18n.js. When adding or updating visible text, run node scripts/check-ui-i18n.mjs and supply the English translation pair.

Untrusted input and fuzzing

Everything Harpia reads from the network, from feeds or from the group form is hostile until parsed: it must come back as an error, never a panic. crates/harpia-core/tests/untrusted_input.rs checks this with property tests on every cargo test, and the diff engine's guarantees (no removal from a partial sweep, no closed port that was not scanned, disappearance exactly at the threshold) are properties in diff.rs. A new parser gets an entry in both places plus a target in fuzz/.

For longer runs (nightly toolchain and cargo install cargo-fuzz):

cargo +nightly fuzz run der_certificate -- -max_total_time=300

The Weekly workflow fuzzes every target for ten minutes on a persistent corpus and runs cargo audit. A crash becomes a regression test before the fix.

Documentation

Always maintain document pairs: every *.md and docs/* file has an English version and a Portuguese version (*.pt-BR.md, docs/pt-BR/). File names are translated only when the word changes (e.g. architecture.md → arquitetura.md).

The screenshots in docs/img are generated, not hand-made: run scripts/screenshots.sh to retake them from the current build (a synthetic Apache 2.4.25 service scanned for real, correlated with the real NVD and CISA KEV feeds, which are cached after the first run). Run it again whenever the interface, the name or the version shown on screen changes.

Commits and releases

Commits follow Conventional Commits 1.0.0 in English (feat:, fix:, chore:, ci:, docs:, refactor:, test:, perf:, build:). Versions follow SemVer 2.0.0.

Releases are published as multi-arch container images (linux/amd64 and linux/arm64) to the Gitea registry. Pushing a v* tag triggers the release workflow, publishing the container image and attaching CLI binaries.

License

By contributing, you agree to license your work under MIT or Apache-2.0, matching the rest of the project.