Skip to content

Commit

Permalink
Init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinguy committed Dec 20, 2024
0 parents commit 03ca772
Show file tree
Hide file tree
Showing 3,765 changed files with 545,683 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
AGPL-3.0 License

The GNU Affero General Public License (AGPL) version 3.0, or any later version, applies to this software.

This software is free to use, modify, and distribute under the terms of the AGPL-3.0 License. For the full text of the license, please visit:

https://www.gnu.org/licenses/agpl-3.0.html
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include README.md
include setup.cfg
recursive-include aigraphcodescan *
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# AIGraphCodeScan

**AIGraphCodeScan** is a tool designed for performing security reviews of codebases using graph analysis. The package utilizes Neo4j and Fast GraphRAG to query and visualize relationships within the code, helping identify potential security risks and vulnerabilities by analyzing the structure and flow of the code.

## Features

- **Graph-based Code Analysis**: Leverages graph theory to analyze code relationships and interactions.
- **Neo4j Integration**: Stores and queries code structure and data flow in a Neo4j graph database.
- **Security Review**: Helps identify potential security vulnerabilities based on the code's structure and relationships.

## Installation

### Prerequisites

Ensure you have Python 3.6 or higher installed. You will also need a Neo4j instance running to store and query code-related data.

### Installation Steps

Clone the repository and install the required dependencies:

```bash
git clone https://github.com/tcosolutions/aigraphcodescan.git
cd aigraphcodescan
pip install -e .
```

### Requirements

- Python 3.6+
- `neo4j >= 4.0.0`
- `fast_graphrag >= 0.1.0`
- `argparse`, `logging`, `json`

## Usage

Once installed, you can use the `aigraphcodescan` command to run the security review.

```bash
aigraphcodescan --debug
```

The command will start the graph-based security review process. The `--debug` option enables more detailed logging output.

## Example Workflow

1. **Run the security scan**: Use the `aigraphcodescan` command to analyze your codebase.
2. **Review findings**: Based on the graph analysis, the tool will provide insights into potential security vulnerabilities, such as unexpected interactions between modules, exposed endpoints, or insecure data flows.
3. **Improve your code**: Use the output to guide security improvements in your codebase.

## Contributing

We welcome contributions to **AIGraphCodeScan**. If you find a bug or have a suggestion, please open an issue or submit a pull request.

## License

This project is licensed under the AGPL 3.0 License - see the [LICENSE](LICENSE) file for details.
70 changes: 70 additions & 0 deletions aigraphcodescan/src/aigraphcodescan.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Metadata-Version: 2.1
Name: aigraphcodescan
Version: 1.1.5
Summary: A tool for security review of code using graph-based analysis
Home-page: https://github.com/tcosolutions/aigraphcodescan
Author: Marcin Kozlowski
Author-email: [email protected]
License: AGPL 3.0
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE

# AIGraphCodeScan

**AIGraphCodeScan** is a tool designed for performing security reviews of codebases using graph analysis. The package utilizes Neo4j and Fast GraphRAG to query and visualize relationships within the code, helping identify potential security risks and vulnerabilities by analyzing the structure and flow of the code.

## Features

- **Graph-based Code Analysis**: Leverages graph theory to analyze code relationships and interactions.
- **Neo4j Integration**: Stores and queries code structure and data flow in a Neo4j graph database.
- **Security Review**: Helps identify potential security vulnerabilities based on the code's structure and relationships.

## Installation

### Prerequisites

Ensure you have Python 3.6 or higher installed. You will also need a Neo4j instance running to store and query code-related data.

### Installation Steps

Clone the repository and install the required dependencies:

```bash
git clone https://github.com/tcosolutions/aigraphcodescan.git
cd aigraphcodescan
pip install -e .
```

### Requirements

- Python 3.6+
- `neo4j >= 4.0.0`
- `fast_graphrag >= 0.1.0`
- `argparse`, `logging`, `json`

## Usage

Once installed, you can use the `aigraphcodescan` command to run the security review.

```bash
aigraphcodescan --debug
```

The command will start the graph-based security review process. The `--debug` option enables more detailed logging output.

## Example Workflow

1. **Run the security scan**: Use the `aigraphcodescan` command to analyze your codebase.
2. **Review findings**: Based on the graph analysis, the tool will provide insights into potential security vulnerabilities, such as unexpected interactions between modules, exposed endpoints, or insecure data flows.
3. **Improve your code**: Use the output to guide security improvements in your codebase.

## Contributing

We welcome contributions to **AIGraphCodeScan**. If you find a bug or have a suggestion, please open an issue or submit a pull request.

## License

This project is licensed under the AGPL 3.0 License - see the [LICENSE](LICENSE) file for details.
12 changes: 12 additions & 0 deletions aigraphcodescan/src/aigraphcodescan.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
LICENSE
MANIFEST.in
README.md
pyproject.toml
setup.cfg
aigraphcodescan/src/aigraphcodescan/__main__.py
aigraphcodescan/src/aigraphcodescan/app.py
aigraphcodescan/src/aigraphcodescan.egg-info/PKG-INFO
aigraphcodescan/src/aigraphcodescan.egg-info/SOURCES.txt
aigraphcodescan/src/aigraphcodescan.egg-info/dependency_links.txt
aigraphcodescan/src/aigraphcodescan.egg-info/entry_points.txt
aigraphcodescan/src/aigraphcodescan.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 2 additions & 0 deletions aigraphcodescan/src/aigraphcodescan.egg-info/entry_points.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[console_scripts]
aigraphcodescan = aigraphcodescan.__main__:main
1 change: 1 addition & 0 deletions aigraphcodescan/src/aigraphcodescan.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

6 changes: 6 additions & 0 deletions aigraphcodescan/src/aigraphcodescan/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# src/aigraphcodescan/__main__.py
from .app import main

if __name__ == "__main__":
main()
25 changes: 25 additions & 0 deletions aigraphcodescan/src/aigraphcodescan/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# src/aigraphcodescan/app.py
import json
import os
import uuid
import logging
import argparse
from neo4j import GraphDatabase
from fast_graphrag import GraphRAG

def get_logger():
parser = argparse.ArgumentParser(description="Run graph extraction.")
parser.add_argument('--debug', action='store_true', help='Enable debug logging')
args, unknown = parser.parse_known_args()

# Default level is ERROR, no normal logs or debug logs unless --debug is used
logging_level = logging.DEBUG if args.debug else logging.ERROR
logging.basicConfig(level=logging_level)

# Main logic that could be executed by __main__.py
def main():
get_logger()
print("Running graph extraction logic...")

# Placeholder for your actual logic
Binary file added dist/aigraphcodescan-1.1.5-py3-none-any.whl
Binary file not shown.
Binary file added dist/aigraphcodescan-1.1.5.tar.gz
Binary file not shown.
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

36 changes: 36 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

[metadata]
name = aigraphcodescan
version = 1.1.5
author = Marcin Kozlowski
author_email = [email protected]
description = A tool for security review of code using graph-based analysis
long_description = file: README.md
long_description_content_type = text/markdown
license = AGPL 3.0
url = https://github.com/tcosolutions/aigraphcodescan
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Operating System :: OS Independent

[options]
packages = find:
package_dir =
= aigraphcodescan/src
[options.packages.find]
where = src




python_requires = >=3.6
install_requires =
neo4j >= 4.0.0
fast_graphrag >= 0.0.4
logging
argparse

[options.entry_points]
console_scripts =
aigraphcodescan = aigraphcodescan.__main__:main
Loading

0 comments on commit 03ca772

Please sign in to comment.