Documentation
¶
Overview ¶
Package mapper builds a model-free map of a target: its languages, frameworks, entry points, trust boundaries, and how to build and test it. The planner and investigators start from this map instead of rediscovering the layout on every run.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ProofLanguages = map[string]bool{"go": true, "python": true, "javascript": true, "typescript": true}
ProofLanguages are the languages with full find, demonstrate and fix support in v0.1. Other languages get findings and analysis only.
Functions ¶
This section is empty.
Types ¶
type Boundary ¶
type Boundary struct {
Kind string `json:"kind"` // http-input|env|process|database|outbound-http|filesystem|deserialization
File string `json:"file"`
Line int `json:"line"`
}
Boundary is a line where data crosses a trust boundary.
type EntryPoint ¶
type EntryPoint struct {
Kind string `json:"kind"` // http-route|main|cli|handler
File string `json:"file"`
Line int `json:"line"`
Detail string `json:"detail"`
}
EntryPoint is a place where execution or outside input enters the program.
type Harness ¶
type Harness struct {
Language string `json:"language,omitempty"` // primary language: go|python|javascript|typescript
TestCommand string `json:"test_command,omitempty"`
BuildCommand string `json:"build_command,omitempty"`
HasTests bool `json:"has_tests"`
}
Harness says how the target is built and tested, as far as can be told without running anything.
type Map ¶
type Map struct {
Commit string `json:"commit,omitempty"`
FileCount int `json:"file_count"`
Languages []LangCount `json:"languages"`
Frameworks []string `json:"frameworks,omitempty"`
Entry []EntryPoint `json:"entry_points,omitempty"`
Boundaries []Boundary `json:"trust_boundaries,omitempty"`
InfraFiles []string `json:"infra_files,omitempty"`
Tests Harness `json:"tests"`
Skipped []walk.Skip `json:"skipped,omitempty"`
// Files is the listing the map was built from. It is not cached: it
// holds absolute paths, which belong to one machine.
Files []walk.File `json:"-"`
}
Map describes a target on disk.
func (Map) LanguageNames ¶
LanguageNames returns the language names, most files first.