Skip to content

Latest commit

Β 

History

History
59 lines (45 loc) Β· 1.67 KB

File metadata and controls

59 lines (45 loc) Β· 1.67 KB

Contributing to Aegis

Thanks for helping secure the AI era!

Getting Started

git clone https://github.com/luoowei/aegis.git
cd aegis
go build -o aegis ./cmd/aegis
./aegis scan .

Adding New Rules

  1. Open internal/rules/rules.go
  2. Add a new Rule struct entry in All()
  3. Pick a unique ID following the pattern: AEG-XXX
  4. Write a Go-compatible regex pattern (no lookahead/behind)
  5. Provide a clear FixHint telling users what to do

Rule guidelines:

  • Minimize false positives β€” test against real code before submitting
  • Prefer specific patterns over broad ones
  • Always include (?i) for case-insensitive matching where appropriate
  • Category constants are in the same file

Project Structure

aegis/
β”œβ”€β”€ cmd/aegis/main.go       # CLI entry point (Cobra)
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ rules/rules.go      # Security rule definitions
β”‚   β”œβ”€β”€ scanner/scanner.go  # File walker + parallel scanning engine
β”‚   β”œβ”€β”€ report/report.go    # Terminal + JSON output formatting
β”‚   └── hook/hook.go        # Git hook + GitHub Actions installers
β”œβ”€β”€ docs/                   # Landing page (GitHub Pages)
└── install.sh              # One-line installer

Code Style

  • go fmt, go vet, go lint
  • Descriptive variable names
  • Comments on exported functions
  • Small, focused functions

Pull Request Process

  1. Fork and create a feature branch
  2. Add your changes
  3. Verify build: go build ./...
  4. Run self-scan: ./aegis scan .
  5. Open a PR with a clear description

Questions?

Open an Issue or start a Discussion.