CodeGuardian is a powerful VSCode extension that helps developers write secure code by providing real-time vulnerability detection and comprehensive security insights. Powered by local AI through LMStudio, it analyzes your code without compromising privacy or performance.
- Gokuleshwaran Narayanan - Computer Scientist
- Adithyah Nair - Computer Scientist
This repository contains the core TypeScript files responsible for CodeGuardian's functionality:
analyzer.ts
: Handles the static code analysis and vulnerability detection.diagnostics.ts
: Manages the reporting of detected vulnerabilities.extension.ts
: Entry point of the VSCode extension, setting up interactions and integrations.types.ts
: Defines the types and interfaces used within the extension.example/example.py
: Sample vulnerable application for testing CodeGuardian.
- Install Visual Studio Code if not already installed.
- Clone this repository:
git clone https://github.com/gokulnpc/codeguardian.git cd codeguardian
- Install dependencies:
npm install
- Download and install LMStudio from LMStudio.
- Configure LMStudio to run locally for code analysis.
- Open Visual Studio Code.
- Run the following command to install the extension locally:
npm run build code --install-extension codeguardian.vsix
- Enable CodeGuardian and allow it to scan files for vulnerabilities.
To verify the installation and setup:
- Navigate to the
example
directory in the repository. - Open
example.py
in Visual Studio Code. - CodeGuardian should now highlight vulnerabilities in real-time.
- On the top search bar, enter
>CodeGuardian: Analyze Current File
- Check CodeGuardian’s security panel in VS Code to view detected vulnerabilities.
Once the application is set up, follow these steps:
- Open any code file in VS Code.
- As you type, CodeGuardian provides real-time security feedback.
- View detailed vulnerability reports in the CodeGuardian Security Panel.
- Apply suggested fixes to improve code security.
- Use the detected issues to validate security best practices.
Now you have successfully installed and tested CodeGuardian! 🚀