-
Notifications
You must be signed in to change notification settings - Fork 6
File filtering rework + bugfix for loading cli arg environment variables from .env + workflow Python version pin #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ernatives to CLI arguments are properly populated
…ault 1000) with cli flags --skip-line-length-check and --max-line-length
…nclude + refactor filtering into FilterRules class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Application Security Assessment Summary
Critical Security Issues
Environment File Security
We identified a critical vulnerability in the saist/util/argparsing.py file where the application loads environment variables from a hardcoded '.env' file without proper security validation. This implementation fails to verify the file source or check file permissions, creating a significant security exposure. Attackers could potentially inject malicious environment variables by modifying or replacing the .env file, leading to system compromise or unauthorized access.
Immediate remediation is required to implement proper file path validation, enforce strict file permission checks, and provide users with configurable environment file paths that include appropriate security controls.
It's complaining about using .env, this is irrelevant and not a security risk
SimonGurney
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🏆
This pull request introduces the following features:
utils.filteringto introduce:--excludeand--includeCLI arguments can now be passed to SAIST to include extra file filtering rules on the fly, which are also parsed in .gitignore format and are appended to any rules gathered from saist.ignore/saist.include. (fixes Add command line file filtering #63)--max-line-length(default: 1000), are filtered out from analysis to avoid formatting issues with PDF generation and to avoid wasting tokens on processing minified code. This filter rule can be disabled for all files using--skip-line-length-check(fixes Truncate file lines greater than n characters #31)--dry-runCLI argument can be used to load filtering rules and gather files to analyse, but exit before any analysis is done, which is useful in combination with verbose debug logging to see which files would be included for analysis in order to validate rule configuration.And includes fixes for the following bugs:
load_dotenv()inutils.argparserto ensure command line arguments that can be alternatively supplied using an environment variable, such asSAIST_LLM_API_KEYcan be loaded from the .env file