mirror of
https://github.com/elicpeter/nyx.git
synced 2026-07-18 21:21:03 +02:00
Phase 1 (#33)
* chore: Exclude CLAUDE.md from Cargo.toml * feat: add callgraph module and integrate into main analysis flow * feat: enhance CLI with new severity filtering and analysis modes * feat: update CHANGELOG with recent enhancements and fixes to severity filtering and output handling * feat: implement state-model dataflow analysis for resource lifecycle and auth state * feat: enhance diagnostic output formatting and add evidence structure * feat: implement attack surface ranking for diagnostics with scoring and sorting * feat: add comprehensive documentation for installation, usage, and rules reference * feat: add multiple language support for command execution and evaluation endpoints * feat: implement inline suppression for findings using `nyx:ignore` comments * feat: add confidence levels to AST patterns and update output structure * feat: implement low-noise prioritization system with category filtering, rollup grouping, and configurable budgets * feat: bump version to 0.4.0 and update changelog with new features and improvements * feat: add dead code allowances to various functions in mod.rs and real_world_tests.rs
This commit is contained in:
parent
19b578c5c4
commit
1bbe4b1cfb
456 changed files with 25628 additions and 1228 deletions
|
|
@ -8,7 +8,17 @@ pub static RULES: &[LabelRule] = &[
|
|||
label: DataLabel::Source(Cap::all()),
|
||||
},
|
||||
LabelRule {
|
||||
matchers: &["http.Request", "r.FormValue", "r.URL"],
|
||||
matchers: &[
|
||||
"http.Request",
|
||||
"r.FormValue",
|
||||
"r.URL",
|
||||
"r.Body",
|
||||
"r.Header",
|
||||
"r.URL.Query",
|
||||
"r.URL.Query.Get",
|
||||
"Request.FormValue",
|
||||
"Request.URL",
|
||||
],
|
||||
label: DataLabel::Source(Cap::all()),
|
||||
},
|
||||
// ───────── Sanitizers ──────────
|
||||
|
|
@ -17,18 +27,40 @@ pub static RULES: &[LabelRule] = &[
|
|||
label: DataLabel::Sanitizer(Cap::HTML_ESCAPE),
|
||||
},
|
||||
LabelRule {
|
||||
matchers: &["url.QueryEscape"],
|
||||
matchers: &["url.QueryEscape", "url.PathEscape"],
|
||||
label: DataLabel::Sanitizer(Cap::URL_ENCODE),
|
||||
},
|
||||
LabelRule {
|
||||
matchers: &["filepath.Clean", "filepath.Base"],
|
||||
label: DataLabel::Sanitizer(Cap::FILE_IO),
|
||||
},
|
||||
// ─────────── Sinks ─────────────
|
||||
LabelRule {
|
||||
matchers: &["exec.Command"],
|
||||
label: DataLabel::Sink(Cap::SHELL_ESCAPE),
|
||||
},
|
||||
LabelRule {
|
||||
matchers: &["db.Query", "db.Exec"],
|
||||
matchers: &["db.Query", "db.Exec", "db.QueryRow", "db.Prepare"],
|
||||
label: DataLabel::Sink(Cap::SHELL_ESCAPE),
|
||||
},
|
||||
LabelRule {
|
||||
matchers: &["fmt.Fprintf", "fmt.Sprintf", "fmt.Printf"],
|
||||
label: DataLabel::Sink(Cap::FMT_STRING),
|
||||
},
|
||||
LabelRule {
|
||||
matchers: &[
|
||||
"os.Open",
|
||||
"os.OpenFile",
|
||||
"os.Create",
|
||||
"ioutil.ReadFile",
|
||||
"os.ReadFile",
|
||||
],
|
||||
label: DataLabel::Sink(Cap::FILE_IO),
|
||||
},
|
||||
LabelRule {
|
||||
matchers: &["template.HTML"],
|
||||
label: DataLabel::Sink(Cap::HTML_ESCAPE),
|
||||
},
|
||||
];
|
||||
|
||||
pub static KINDS: Map<&'static str, Kind> = phf_map! {
|
||||
|
|
@ -46,6 +78,16 @@ pub static KINDS: Map<&'static str, Kind> = phf_map! {
|
|||
"statement_list" => Kind::Block,
|
||||
"function_declaration" => Kind::Function,
|
||||
"method_declaration" => Kind::Function,
|
||||
"func_literal" => Kind::Function,
|
||||
"expression_switch_statement" => Kind::Block,
|
||||
"type_switch_statement" => Kind::Block,
|
||||
"expression_case" => Kind::Block,
|
||||
"type_case" => Kind::Block,
|
||||
"default_case" => Kind::Block,
|
||||
"select_statement" => Kind::Block,
|
||||
"communication_case" => Kind::Block,
|
||||
"go_statement" => Kind::Block,
|
||||
"defer_statement" => Kind::Block,
|
||||
|
||||
// data-flow
|
||||
"call_expression" => Kind::CallFn,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue