# semgrep **Repository Path**: software-reverse-engineering/semgrep ## Basic Information - **Project Name**: semgrep - **Description**: No description available - **Primary Language**: Unknown - **License**: LGPL-2.1 - **Default Branch**: EJ-2307-php-metavar - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 0 - **Created**: 2021-10-25 - **Last Updated**: 2022-04-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: 静态分析, 漏洞分析, 污点分析 ## README
Go · Java · JavaScript · JSON · Python · Ruby
TypeScript · JSX · TSX Visit Supported languages for the complete list.
### Getting started To install Semgrep use Homebrew or pip, or run without installation via Docker: ```sh # For macOS $ brew install semgrep # For Ubuntu/WSL/Linux/macOS $ python3 -m pip install semgrep # To try Semgrep without installation run via Docker $ docker run --rm -v "${PWD}:/src" returntocorp/semgrep --help ``` Once installed, Semgrep can run with single rules or entire rulesets. Visit [Running rules](https://semgrep.dev/docs/running-rules/) to learn more or try the following: ```sh # Check for Python == where the left and right hand sides are the same (often a bug) $ semgrep -e '$X == $X' --lang=py path/to/src # Run the r2c-ci ruleset (with rules for many languages) on your own code! $ semgrep --config=p/r2c-ci path/to/src ``` Visit [Getting started](https://semgrep.dev/docs/getting-started/) to learn more. ### Rule examples Visit [Rule examples](https://semgrep.dev/docs/writing-rules/rule-ideas/) for use cases and ideas. There is also an excellent [interactive tutorial](https://semgrep.dev/learn). | Use case | Semgrep rule | | :-------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Ban dangerous APIs | [Prevent use of exec](https://semgrep.dev/s/clintgibler:no-exec) | | Search routes and authentication | [Extract Spring routes](https://semgrep.dev/s/clintgibler:spring-routes) | | Enforce the use secure defaults | [Securely set Flask cookies](https://semgrep.dev/s/dlukeomalley:flask-set-cookie) | | Enforce project best-practices | [Use assertEqual for == checks](https://semgrep.dev/s/dlukeomalley:use-assertEqual-for-equality), [Always check subprocess calls](https://semgrep.dev/s/dlukeomalley:unchecked-subprocess-call) | | Codify project-specific knowledge | [Verify transactions before making them](https://semgrep.dev/s/dlukeomalley:verify-before-make) | | Audit security hotspots | [Finding XSS in Apache Airflow](https://semgrep.dev/s/ievans:airflow-xss), [Hardcoded credentials](https://semgrep.dev/s/dlukeomalley:hardcoded-credentials) | | Audit configuration files | [Find S3 ARN uses](https://semgrep.dev/s/dlukeomalley:s3-arn-use) | | Migrate from deprecated APIs | [DES is deprecated](https://semgrep.dev/editor?registry=java.lang.security.audit.crypto.des-is-deprecated), [Deprecated Flask APIs](https://semgrep.dev/editor?registry=python.flask.maintainability.deprecated.deprecated-apis), [Deprecated Bokeh APIs](https://semgrep.dev/editor?registry=python.bokeh.maintainability.deprecated.deprecated_apis) | | Apply automatic fixes | [Use listenAndServeTLS](https://semgrep.dev/s/clintgibler:use-listenAndServeTLS) ### Integrations Visit [Integrations](https://semgrep.dev/docs/integrations/) to learn about Semgrep editor, commit, and CI integrations. When integrated into CI and configured to scan pull requests, Semgrep will only report issues introduced by that pull request; this lets you start using Semgrep without fixing or ignoring pre-existing issues! ### More * [Frequently asked questions (FAQs)](https://semgrep.dev/docs/faq/) * [Contributing](https://semgrep.dev/docs/contributing/) * [Ask questions in the r2c Community Slack](https://r2c.dev/slack) * [CLI usage and exit codes](https://semgrep.dev/docs/cli-usage) * [r2c YouTube channel with Semgrep presentation videos](https://www.youtube.com/channel/UC5ahcFBorwzUTqPipFhjkWg) * [License (LGPL-2.1)](LICENSE) ### Upgrading To upgrade, run the command below associated with how you installed Semgrep: ```sh # Using Homebrew $ brew upgrade semgrep # Using pip $ python3 -m pip install --upgrade semgrep # Using Docker $ docker pull returntocorp/semgrep:latest ```