Commit graph

80 commits

Author SHA1 Message Date
Eli Peter
c4ce08b452
fix: Exclude 'docs/' directory from package inclusion in Cargo.toml (#34) 2026-02-25 21:29:26 -05:00
Eli Peter
1bbe4b1cfb
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
2026-02-25 21:16:36 -05:00
Eli Peter
19b578c5c4
Feat/configurable sanitizers and js precision (#32)
* chore: Exclude CLAUDE.md from Cargo.toml

* feat: Add configurable analysis rules and CLI commands for custom sanitizers and terminators

* feat: Enhance resource management and analysis efficiency

- Implemented parallel summary merging in `scan_filesystem` using rayon for improved performance.
- Introduced `GlobalSummaries::merge()` for efficient merging of summaries.
- Optimized file reading and hashing to eliminate redundant I/O operations.
- Added `should_scan_with_hash()` and `upsert_file_with_hash()` methods to streamline file processing.
- Enhanced taint analysis with in-place mutations to reduce memory allocations.
- Updated resource acquisition patterns to exclude false positives for `freopen` and wrapper functions.

* feat: Implement severity downgrade for findings in non-production paths and add source kind inference

* feat: Update versioning information in SECURITY.md for new stable line

* feat: Update categories in Cargo.toml to include parser-implementations and text-processing

* feat: Update dependencies in Cargo.lock for improved compatibility and performance

* feat: Update dependencies in Cargo.lock and Cargo.toml for improved compatibility
2026-02-25 04:02:11 -05:00
Eli Peter
f96a89e7c1
Feat/full cfg (#30)
* feat: Enhance control flow analysis with function summaries and taint analysis

* feat: Update taint analysis to utilize function summaries for enhanced tracking

* Refactor `walk.rs` batch processing and override handling:

- Renamed `Batcher` to `BatchSender` for clarity.
- Added `BatchSender::new` constructor for cleaner initialization.
- Simplified batch size management in `BatchSender`.
- Extracted `build_overrides` function for reusable override construction.
- Improved error handling and validation in override building.
- Enhanced performance with directory and file type filtering in `walk`.

* Improve logging and streamline directory walk process:

- Added detailed `tracing` logs for debugging batch flushes, override construction, and walk initialization/completion.
- Optimized and simplified `filter_entry` logic for directory and file type filters.
- Improved metadata checks and max file size enforcement during the scan.

* Refactor and optimize taint tracking, label rules, and directory walk process:

- Replaced `DefaultHasher` with `blake3::Hasher` for improved taint hashing.
- Enhanced sorting and hashing logic in `taint.rs` for consistency and efficiency.
- Removed unused `set_hash` function and redundant imports across files.
- Improved batch sender logic in `walk.rs`, renaming key components for clarity.
- Unified `spawn_senders` and `spawn_file_walker` with thread handling and channel tuple return.
- Expanded label rules with additional matchers for sources, sanitizers, and sinks.
- Deprecated `dump_cfg` and specific logging utilities in `cfg.rs` for code cleanup.

* fix: fixed let chains error in walk.rs

* fix: updated dependencies

* fix: updated dependencies

* chore: Remove standard error in scan.rs

* feat: Introduce function summaries for enhanced taint and control flow analysis

* feat: Enhance taint analysis with interop support and function summaries

* feat: Add configuration analysis module and enhance matcher rules

* feat: Add arity column to function_summaries and handle schema migration

* fix: fixed clippy &PathBuf warnings

* chore: Update dependencies and versioning in Cargo files

* docs: Update README to enhance clarity and detail on features and analysis modes

* chore: Update CHANGELOG for version 0.2.0 with new features, changes, and fixes

* docs: Update SECURITY.md to clarify version support status

---------

Co-authored-by: elipeter <eli.peter@es.fcm.travel>
2026-02-24 23:44:07 -05:00
Eli Peter
8cbbec7d90
Update README.md to clarify config files (#27) 2025-07-03 17:02:57 +02:00
Eli Peter
3be352abb7
Update README.md (#26) 2025-07-03 15:49:20 +02:00
Eli Peter
6f78f95efb
Create SECURITY.md (#25) 2025-06-28 18:34:22 +02:00
Eli Peter
aedd4a90a1
Potential fix for code scanning alert no. 2: Workflow does not contain permissions (#24)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-06-28 18:18:10 +02:00
elipeter
cc33a9cfd9 chore: Add GPL-3.0 to license list in about.toml 2025-06-28 17:41:47 +02:00
Eli Peter
3c21efba75
Added experimental control flow analysis and syntax classification for rust lang (#22)
* Introduce control flow graph (CFG) support:

- Added `cfg.rs` with CFG generation and analysis utilities.
- Integrated `petgraph` library for graph-based computations.
- Updated `ast.rs` to utilize CFG for function analysis.
- Modified `Cargo.toml` and `Cargo.lock` to include new dependencies.
- Improved static analysis with taint tracking through CFG paths.

* feat: enhance control flow analysis with taint tracking and node labeling

* feat: improve control flow graph with enhanced node handling and new tests

* Remove unnecessary reference marker in `byte_offset_to_point` comment.

* Remove unnecessary reference marker in `byte_offset_to_point` comment.

* Refactor `ast.rs` for performance and clarity; enhance `cfg.rs` with recursive CFG generation and improved classification logic for AST analysis.

* Refactor CFG and taint tracking logic:

- Enhanced `cfg.rs` with inline helper function `text_of` for cleaner UTF-8 handling in AST nodes.
- Expanded `labels.rs` rules with detailed `Sources`, `Sanitizers`, and `Sinks` for improved classification.
- Refined `push_node` to handle method call expressions with object-function pairing.
- Simplified code handling in trivia skipping and debug-only logic.

* Enhance `cfg.rs` with `first_call_ident` helper and improve identifier extraction logic in `push_node`.

* Add targeted CFG taint-tracking tests to enhance analysis coverage.

* Enhance CFG generation with loop expression handling and improve taint tracking logic. Add new sanitization example in `examples/sanitize/example.rs`.

* Update README with installation instructions for Cargo and GitHub releases.

* Expand taint-tracking with precise `def-use` computation and enhance `labels.rs` for detailed classification. Extend `examples/sanitize` with realistic scenarios demonstrating new rules.

* Refactor `labels.rs`:

- Removed redundant `LabelRule` entries for cleaner rule definitions.
- Adjusted matching logic to prioritize suffix and prefix matches effectively.

* Refactor `labels.rs`:

- Removed redundant `LabelRule` entries for cleaner rule definitions.
- Adjusted matching logic to prioritize suffix and prefix matches effectively.

* Add test for taint tracking with multiple sources in `cfg.rs`.

* Add `function_summaries` table and implement summary upsert/load methods. Refactor to handle summary storage and retrieval efficiently, with placeholder clean/drop logic.

* refactor: split `labels.rs` into modular structure with language-specific files

* refactor: split `labels.rs` into modular structure with language-specific files

* refactor: clean up SQL table definitions in `database.rs` for better readability

* refactor: simplify CFG structure by removing lifetime parameters and enhancing taint metadata handling

* refactor: update TODO comments in `cfg.rs` to clarify future enhancements for cap labels and function details

* refactor: remove redundant header from README.md for improved clarity

* feat: add PHF-based syntax classifiers and Kind enum for efficient syntax mapping across languages

* feat: introduce analysis modes for enhanced scanner configuration and diagnostics

* feat: define Kind enum for syntax classification in control flow analysis

* feat: bump version to 0.2.0-alpha and update CHANGELOG for new features and fixes

* refactor: clean up imports and formatting in AST and CFG modules for improved readability

* refactor: simplify function signatures and improve code readability in CFG and module files

* fix: correct rayon_thread_stack_size comment to reflect actual value of 8 MiB

* refactor: update string formatting in clean and project modules for consistency

* refactor: fix indentation in clean.rs for improved readability

---------

Co-authored-by: elipeter <eli.peter@es.fcm.travel>
2025-06-28 17:36:14 +02:00
Eli Peter
fd65360818
Update licensing to GPL-3: (#19)
* Update licensing to GPL-3:

- Changed project license from "MIT OR Apache-2.0" to "GPL-3".
- Added LICENSE file with GNU GPL-3 full text.
- Removed MIT and Apache-2.0 license files from the repository.

* docs: Update license badge in README to reflect GPL v3

* Update Cargo.toml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* docs: updated README.md for new license

* docs: update license information to GPL-3.0 in README and Cargo.toml

---------

Co-authored-by: elipeter <eli.peter@es.fcm.travel>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-25 17:23:31 +02:00
elipeter
cdd89dab4a docs: Update badges in README to reflect crates.io links and license information 2025-06-25 03:56:07 +02:00
elipeter
eb5bd2a244 fix: Update author email in Cargo.toml for consistency 2025-06-25 03:50:27 +02:00
Eli Peter
0366f66b42
Fix/updated binary name (#18)
* feat: Add binary configuration for nyx in Cargo.toml

* fix: Set default binary to nyx in Cargo.toml
2025-06-25 03:46:21 +02:00
Eli Peter
423e6bffd1
fix: Clarify changelog entry for Windows zip command issue in release pipeline (#17) 2025-06-25 03:37:39 +02:00
Eli Peter
ef0a6f80bb
Rename CHANGELOG.MD to CHANGELOG.md (#16) 2025-06-25 02:52:06 +02:00
Eli Peter
238ed095a3
Fix/update release pipeline (#15)
* fix: Enhance release packaging for cross-platform compatibility

* fix: Resolve pipeline bug with zip command on Windows

* fix: Clarify changelog entry for Windows zip command issue in release pipeline

* Update CHANGELOG.MD

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-25 02:49:09 +02:00
Eli Peter
e221fdd7d6
ci: Update license generation command to use output flag for consistency (#14) 2025-06-25 02:37:06 +02:00
elipeter
cd8ae3c47e ci: Update license generation command to use output flag for consistency 2025-06-25 02:26:59 +02:00
elipeter
c6c41bf0ce ci: Update license generation command to use handlebars template 2025-06-25 02:17:01 +02:00
Eli Peter
faf70b9eb6
ci: Update license generation format to use handlebars (#13) 2025-06-25 02:13:28 +02:00
Eli Peter
90fa775a48
docs: Add third-party licenses documentation and update build process (#12) 2025-06-25 02:05:15 +02:00
Eli Peter
9c76fd1e9f
Delete THIRDPARTY-LICENSES.html (#11) 2025-06-25 01:54:23 +02:00
Eli Peter
d50684e31b
docs: Add section on advantages of using Nyx in README (#10)
* docs: Add section on advantages of using Nyx in README

* ci: Update branch references from 'main' to 'master' in CI configuration

* docs: Add third-party licenses documentation and update build process

* Update .github/workflows/release-build.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* docs: Add third-party licenses documentation and update build process

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-25 01:42:10 +02:00
elipeter
a614e157b3 ci: Update CI workflow with matrix strategy, security checks, and linting rules adjustments 2025-06-25 00:49:29 +02:00
elipeter
24689be6f7 ci: Add rust-cache action to improve build performance 2025-06-25 00:37:36 +02:00
elipeter
47d4f589af Refactor CI workflow: rename file, update job name, and remove verbose flag from cargo build 2025-06-25 00:33:58 +02:00
elipeter
4872c5acb5 docs: Add initial CHANGELOG with project release history and key updates 2025-06-25 00:31:30 +02:00
elipeter
0efc26d28d chore: Add dual licensing information and contribution guidelines 2025-06-25 00:24:05 +02:00
Eli Peter
72ca7fa45d
test: Add unit tests for index building and scanning functionality (#9) 2025-06-24 23:57:27 +02:00
Eli Peter
46c4732f6e
test: Add unit tests for file handling and configuration merging (#7)
* test: Add unit tests for file handling and configuration merging

* test: Update IO error conversion test to use new error creation method
2025-06-24 23:38:32 +02:00
Eli Peter
8497800b13
test: Add unit tests for config merging and project name sanitization (#6)
* test: Add unit tests for config merging and project name sanitization

* Update src/utils/project.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* test: Update assertion for follow_symlinks in scanner configuration

* test: Fix typo in test function name for project info retrieval

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-24 23:18:01 +02:00
Eli Peter
a0c9d0f9d4
Merge pull request #2 from ecpeter23/bug/fix-max-results
fix: Limit diagnostics output on non indexed scan to a maximum number…
2025-06-24 22:51:30 +02:00
elipeter
a75b6cfabe fix: Remove unnecessary whitespace in diagnostics output handling 2025-06-24 22:51:16 +02:00
elipeter
ebe78b270c fix: Limit diagnostics output on non indexed scan to a maximum number of results based on configuration 2025-06-24 22:44:57 +02:00
elipeter
e309b956c3 Enhance release build workflow with improved binary path resolution and error messaging 2025-06-24 22:28:47 +02:00
elipeter
0876209834 Refactor release build workflow to include OS mapping for targets and improve error handling for binary packaging 2025-06-24 22:26:41 +02:00
elipeter
34e8174003 Add support for aarch64-apple-darwin target and define binary name in release build workflow 2025-06-24 22:22:03 +02:00
elipeter
aecf37163f Add target specification to Rust toolchain setup in release build workflow 2025-06-24 22:14:25 +02:00
elipeter
3d744ae44f Improve release build workflow by adding error handling and dynamic binary path resolution 2025-06-24 22:13:52 +02:00
elipeter
95b934ad39 Add target installation step to release build workflow 2025-06-24 22:05:46 +02:00
elipeter
4bb61aba8b Update default configuration handling and integrate NyxResult into config.rs
- Introduced `DEFAULT_CONFIG_TOML` to simplify default configuration loading.
- Replaced `show_progress` with `quiet` in configuration for improved clarity.
- Refactored `create_example_config` to use `NyxResult` and streamline logic with fallback handling.
- Added `default-nyx.conf` file for default configuration management.
- Enhanced `merge_configs` to include new parameters like `scan_timeout_secs` and `quiet`.
2025-06-24 21:43:26 +02:00
elipeter
14a549ac39 Refactor codebase for consistent indentation and formatting
- Standardized spacing and indentation across multiple modules for improved readability.
- Reorganized `patterns` and `utils` imports for consistency.
- Updated `NyxError` and `NyxResult` related implementations to maintain consistent formatting.
- Enhanced readability in AST patterns for better clarity and maintainability.
2025-06-24 20:27:06 +02:00
elipeter
b3870997d7 Add Ruby AST support using tree-sitter-ruby
- Added `tree-sitter-ruby` dependency to `Cargo.toml` and `Cargo.lock`.
- Introduced `patterns/ruby.rs` with Ruby-specific AST patterns for vulnerability detection.
- Updated `patterns/mod.rs` and `ast.rs` to support Ruby AST parsing and pattern registry initialization.
2025-06-24 18:53:31 +02:00
elipeter
484f4b6d05 Added release-build.yml to automate releases 2025-06-24 18:09:50 +02:00
elipeter
f4544d261e Fixed clippy errors 2025-06-24 18:06:02 +02:00
elipeter
16b469c16f Renamed file.rs to ast.rs to more accurately represent what that code does 2025-06-24 17:56:26 +02:00
elipeter
bd788a8373 Refactor error handling with NyxResult and enhance debugging
- Replaced `Result` with `NyxResult` across the codebase for consistent error management.
- Enhanced `NyxError` with new variants and utility conversions for better flexibility.
- Added detailed `tracing::debug` logs in `file.rs` and `walk.rs` for improved traceability.
- Simplified conditionals and improved path handling in `file.rs`.
- Refined severity filtering logic in `scan.rs`.
2025-06-23 20:59:49 +02:00
elipeter
0a66a0ae2d Add error handling with NyxError and refactor console output formatting
- Introduced `NyxError` and `NyxResult` for unified error handling across modules.
- Refactored `scan.rs`, `index.rs`, and `walk.rs` with improved error management and consistent formatting.
- Replaced existing error handling in `database.rs` with `NyxResult`.
- Improved database maintenance by integrating `vacuum` and `clear` methods into workflows.
- Added `dashmap` for efficient parallel diagnostics result aggregation in `scan_with_index_parallel`.
- Enhanced readability and formatting of console outputs in multiple modules.
2025-06-23 20:27:16 +02:00
elipeter
75a20eaa2a Simplify console output formatting in index.rs by removing redundant characters in success message. 2025-06-23 19:39:38 +02:00