Thank you for your interest in contributing to vulnz. This project is a high-performance vulnerability data aggregator focused on EU Cyber Resilience Act (CRA) and NIS2 compliance.
- Fork the repository and clone your fork
- Install dependencies:
make deps - Run tests:
make test - Run linters:
make lint - Create a feature branch and open a PR
The provider architecture is designed to be easily extensible. Here's how to add a new data source:
Create a new directory under internal/provider/<name>/ with the following files:
internal/provider/<name>/
├── provider.go # Provider implementation
├── manager.go # Data fetching and parsing logic
├── provider_test.go # Tests
└── *_suite_test.go # Ginkgo test suite
Your provider must implement the provider.Provider interface:
type Provider interface {
Name() string
Update(ctx context.Context, lastUpdated *time.Time) ([]string, int, error)
}Example structure:
package myprovider
import (
"context"
"time"
"github.com/shift/vulnz/internal/provider"
)
type Provider struct {
*provider.Base
config provider.Config
}
func init() {
provider.Register("myprovider", NewProvider)
}
func NewProvider(config provider.Config) (provider.Provider, error) {
return &Provider{
Base: provider.NewBase(config),
config: config,
}, nil
}
func (p *Provider) Name() string {
return "myprovider"
}
func (p *Provider) Tags() []string {
return []string{"os", "linux"} // Classify your provider
}
func (p *Provider) Update(ctx context.Context, lastUpdated *time.Time) ([]string, int, error) {
// 1. Fetch data from upstream API
// 2. Parse and normalize to vulnerability schema
// 3. Write results to storage
return urls, count, nil
}Add a blank import in internal/providers/register.go:
import (
_ "github.com/shift/vulnz/internal/provider/myprovider"
)All provider output must conform to the vulnerability schema at:
docs/schema/vulnerability-1.0.3.json
The schema is validated at runtime using santhosh-tekuri/jsonschema/v6.
Use Ginkgo/Gomega for BDD-style tests:
func TestMyProvider(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "MyProvider Suite")
}Test at minimum:
- Successful data fetch and parsing
- Error handling (network failures, invalid responses)
- Schema compliance
- Add your provider to the table in
README.md - Create a
README.mdin your provider directory explaining the data source
- Go 1.25+ required
- Run
make lintbefore submitting PRs - Follow existing code style and conventions
- Use
context.Contextfor all I/O operations - Write meaningful commit messages (conventional commits preferred)
See docs/ARCHITECTURE.md for a comprehensive overview of the system design.
Key components:
- Provider Framework (
internal/provider/) - Plugin system for data sources - Storage Backends (
internal/storage/) - Flat-file and SQLite - HTTP Client (
internal/http/) - Rate limiting, retry, connection pooling - Schema Validation (
internal/schema/) - JSON Schema enforcement - Workspace Management (
internal/workspace/) - State, locks, checksums
# Build
make build
# Run tests
make test
# Run linters
make lint
# Clean build artifacts
make clean
# Run a specific provider
./vulnz run kev
# Run all providers
./vulnz run --all --parallel 8- Security vulnerabilities: See
SECURITY.mdfor responsible disclosure - Bugs: Open a GitHub issue with steps to reproduce
- Feature requests: Open an issue with the
enhancementlabel
By contributing to vulnz, you agree that your contributions will be licensed under the AGPL-3.0 license.