Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
xvnpw committed Dec 7, 2024
1 parent ebb1513 commit 606617a
Show file tree
Hide file tree
Showing 27 changed files with 73 additions and 73 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: poetry run ruff check --output-format=github .

- name: Run MyPy
run: poetry run mypy ai_create_project_sec_design
run: poetry run mypy ai_security_analyzer

- name: Test with pytest
run: poetry run pytest -m "not integration"
Expand All @@ -47,5 +47,5 @@ jobs:

- name: Test docker
run: |
docker build . -t test-ai-create-project-sec-design
docker run test-ai-create-project-sec-design -h
docker build . -t test-ai-security-analyzer
docker run test-ai-security-analyzer -h
6 changes: 3 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: poetry run ruff check --output-format=github .

- name: Run MyPy
run: poetry run mypy ai_create_project_sec_design
run: poetry run mypy ai_security_analyzer

- name: Test with pytest
run: poetry run pytest -m "not integration"
Expand All @@ -57,8 +57,8 @@ jobs:

- name: Test docker
run: |
docker build . -t test-ai-create-project-sec-design
docker run test-ai-create-project-sec-design -h
docker build . -t test-ai-security-analyzer
docker run test-ai-security-analyzer -h
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<div align="center">

# AI Create Project Security Design
# AI Security Analyzer


<a href="https://github.com/xvnpw/ai-create-project-sec-design">
<a href="https://github.com/xvnpw/ai-security-analyzer">
<img src="./images/logo.webp" alt="logo" width="200" height="200"/>
</a>

[![CI](https://github.com/xvnpw/ai-create-project-sec-design/actions/workflows/ci.yaml/badge.svg)](https://github.com/xvnpw/ai-create-project-sec-design/actions/workflows/ci.yaml)
[![GitHub release](https://img.shields.io/github/release/xvnpw/ai-create-project-sec-design.svg)](https://github.com/xvnpw/ai-create-project-sec-design/releases)
[![CI](https://github.com/xvnpw/ai-security-analyzer/actions/workflows/ci.yaml/badge.svg)](https://github.com/xvnpw/ai-security-analyzer/actions/workflows/ci.yaml)
[![GitHub release](https://img.shields.io/github/release/xvnpw/ai-security-analyzer.svg)](https://github.com/xvnpw/ai-security-analyzer/releases)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

🤖 **AI Create Project Security Design** is a powerful tool that leverages AI to automatically generate comprehensive security design documentation for your projects.
🤖 **AI Security Analyzer** is a powerful tool that leverages AI to automatically generate comprehensive security design documentation for your projects.

**🎥 Demo:**

Expand All @@ -21,7 +21,7 @@

## Overview

**AI Create Project Security Design** is a Python-based tool that analyzes your project's codebase and automatically generates detailed security design documentation. It supports multiple project types and utilizes advanced language models (LLMs) to create insightful security design documents tailored to your project's specific needs.
**AI Security Analyzer** is a Python-based tool that analyzes your project's codebase and automatically generates detailed security design documentation. It supports multiple project types and utilizes advanced language models (LLMs) to create insightful security design documents tailored to your project's specific needs.

## Features

Expand All @@ -47,10 +47,10 @@
Clone the repository and install dependencies using the provided script:

```bash
git clone git@github.com:xvnpw/ai-create-project-sec-design.git
cd ai-create-project-sec-design
git clone git@github.com:xvnpw/ai-security-analyzer.git
cd ai-security-analyzer
./build.sh # Installs Python and Node.js dependencies
poetry run python ai_create_project_sec_design/app.py --help
poetry run python ai_security_analyzer/app.py --help
```

### Using Docker
Expand All @@ -62,7 +62,7 @@ You can run the application using Docker without installing Python or Node.js lo
```powershell
docker run -v C:\path\to\your\project:/target `
-e OPENAI_API_KEY=$Env:OPENAI_API_KEY `
ghcr.io/xvnpw/ai-create-project-sec-design:v0.0.1 `
ghcr.io/xvnpw/ai-security-analyzer:v0.0.1 `
-v -t /target -o /target/security_design.md
```

Expand All @@ -71,7 +71,7 @@ docker run -v C:\path\to\your\project:/target `
```bash
docker run -v ~/path/to/your/project:/target \
-e OPENAI_API_KEY=$OPENAI_API_KEY \
ghcr.io/xvnpw/ai-create-project-sec-design:v0.0.1 \
ghcr.io/xvnpw/ai-security-analyzer:v0.0.1 \
-v -t /target -o /target/security_design.md
```

Expand All @@ -89,7 +89,7 @@ This application may consume a significant number of tokens due to its workflow:

1. **Always Start with Dry Run**
```bash
poetry run python ai_create_project_sec_design/app.py \
poetry run python ai_security_analyzer/app.py \
-t /path/to/your/project \
--dry-run
```
Expand Down Expand Up @@ -204,7 +204,7 @@ Set one of the following environment variables based on your chosen LLM provider
Generate a security design document for a Python project:

```bash
poetry run python ai_create_project_sec_design/app.py \
poetry run python ai_security_analyzer/app.py \
-t /path/to/your/project \
-o security_design.md
```
Expand All @@ -214,7 +214,7 @@ poetry run python ai_create_project_sec_design/app.py \
Exclude the `tests` directory and `LICENSE` file:

```bash
poetry run python ai_create_project_sec_design/app.py \
poetry run python ai_security_analyzer/app.py \
-t /path/to/your/project \
-o security_design.md \
--exclude "LICENSE,**/tests/**"
Expand All @@ -225,7 +225,7 @@ poetry run python ai_create_project_sec_design/app.py \
Use Anthropic's Claude model:
```bash
poetry run python ai_create_project_sec_design/app.py \
poetry run python ai_security_analyzer/app.py \
-t /path/to/your/project \
-o security_design.md \
--agent-provider anthropic \
Expand All @@ -239,7 +239,7 @@ poetry run python ai_create_project_sec_design/app.py \
See which files would be analyzed without making API calls:
```bash
poetry run python ai_create_project_sec_design/app.py \
poetry run python ai_security_analyzer/app.py \
-t /path/to/your/project \
--dry-run
```
Expand Down Expand Up @@ -273,7 +273,7 @@ This warning indicates that some document chunks exceed the LLM's context window
**Example:**

```bash
poetry run python ai_create_project_sec_design/app.py \
poetry run python ai_security_analyzer/app.py \
-t /path/to/your/project \
--files-chunk-size 50000 \
--files-context-window 70000
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import tiktoken
from langchain_text_splitters import CharacterTextSplitter

from ai_create_project_sec_design.agents import CreateProjectSecurityDesignAgent
from ai_create_project_sec_design.base_agent import BaseAgent
from ai_create_project_sec_design.config import AppConfig
from ai_create_project_sec_design.documents import DocumentFilter, DocumentProcessor
from ai_create_project_sec_design.dry_run import DryRunAgent
from ai_create_project_sec_design.llms import LLMProvider
from ai_create_project_sec_design.markdowns import MarkdownMermaidValidator
from ai_security_analyzer.agents import CreateProjectSecurityDesignAgent
from ai_security_analyzer.base_agent import BaseAgent
from ai_security_analyzer.config import AppConfig
from ai_security_analyzer.documents import DocumentFilter, DocumentProcessor
from ai_security_analyzer.dry_run import DryRunAgent
from ai_security_analyzer.llms import LLMProvider
from ai_security_analyzer.markdowns import MarkdownMermaidValidator

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
from langgraph.graph.state import CompiledStateGraph
from tiktoken import Encoding

from ai_create_project_sec_design.base_agent import BaseAgent
from ai_create_project_sec_design.documents import DocumentFilter, DocumentProcessor
from ai_create_project_sec_design.llms import LLMProvider
from ai_create_project_sec_design.loaders import RepoDirectoryLoader
from ai_create_project_sec_design.markdowns import MarkdownMermaidValidator
from ai_security_analyzer.base_agent import BaseAgent
from ai_security_analyzer.documents import DocumentFilter, DocumentProcessor
from ai_security_analyzer.llms import LLMProvider
from ai_security_analyzer.loaders import RepoDirectoryLoader
from ai_security_analyzer.markdowns import MarkdownMermaidValidator

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import logging
import sys

from ai_create_project_sec_design.agent_builder import AgentBuilder
from ai_create_project_sec_design.config import AppConfig
from ai_create_project_sec_design.graphs import GraphExecutorFactory
from ai_create_project_sec_design.llms import LLMProvider
from ai_security_analyzer.agent_builder import AgentBuilder
from ai_security_analyzer.config import AppConfig
from ai_security_analyzer.graphs import GraphExecutorFactory
from ai_security_analyzer.llms import LLMProvider

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -195,11 +195,11 @@ def main() -> None:
config = parse_arguments()
setup_logging(config.verbose, config.debug)

logger.info("Starting AI Create Project Security Design")
logger.info("Starting AI Security Analyzer")

app(config)

logger.info("AI Create Project Security Design completed successfully")
logger.info("AI Security Analyzer completed successfully")

except Exception as e:
logger.error(f"Application error: {e}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from langchain_text_splitters import CharacterTextSplitter
from langgraph.graph.state import CompiledStateGraph

from ai_create_project_sec_design.documents import DocumentFilter, DocumentProcessor
from ai_create_project_sec_design.llms import LLMProvider
from ai_create_project_sec_design.markdowns import MarkdownMermaidValidator
from ai_security_analyzer.documents import DocumentFilter, DocumentProcessor
from ai_security_analyzer.llms import LLMProvider
from ai_security_analyzer.markdowns import MarkdownMermaidValidator

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pydantic import BaseModel, ConfigDict, Field, field_validator
from typing_extensions import Literal

from ai_create_project_sec_design.utils import find_node_binary
from ai_security_analyzer.utils import find_node_binary


class AppConfig(BaseModel):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
from langgraph.graph.state import CompiledStateGraph
from tiktoken import Encoding

from ai_create_project_sec_design.agents import (
from ai_security_analyzer.agents import (
CreateProjectSecurityDesignAgent,
AgentState,
)
from ai_create_project_sec_design.documents import DocumentFilter, DocumentProcessor
from ai_create_project_sec_design.llms import LLMProvider
from ai_create_project_sec_design.markdowns import MarkdownMermaidValidator
from ai_security_analyzer.documents import DocumentFilter, DocumentProcessor
from ai_security_analyzer.llms import LLMProvider
from ai_security_analyzer.markdowns import MarkdownMermaidValidator

logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Any, Final, List

from langgraph.graph.state import CompiledStateGraph
from ai_create_project_sec_design.config import AppConfig
from ai_security_analyzer.config import AppConfig
from langchain_core.documents import Document

logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from langchain_core.language_models.chat_models import BaseChatModel
from langchain_openai import ChatOpenAI

from ai_create_project_sec_design import constants
from ai_create_project_sec_design.config import AppConfig
from ai_security_analyzer import constants
from ai_security_analyzer.config import AppConfig

logger = logging.getLogger(__name__)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ if [ -n "$GITHUB_WORKSPACE" ]; then
echo "Detected GitHub runner"
fi

exec /usr/local/bin/python /app/ai_create_project_sec_design/app.py "$@"
exec /usr/local/bin/python /app/ai_security_analyzer/app.py "$@"
8 changes: 4 additions & 4 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| Name | Type | File |
| --- | ---| --- |
| [caddy](https://github.com/caddyserver/caddy) - Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS<br/><details><summary>command...</summary>`python ai_create_project_sec_design/app.py -t caddy/ -v --project-type go -o examples/CADDY-o1-preview.md --agent-model o1-preview --agent-temperature 1`</details> | go | [o1-preview](./CADDY-o1-preview.md), [gpt-4o](./CADDY-gpt-4o.md), [threat model - o1-preview](./TM-CADDY-o1-preview.md)
| [screenshot-to-code](https://github.com/abi/screenshot-to-code) - Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)<br/><details><summary>command...</summary>`python ai_create_project_sec_design/app.py -t screenshot-to-code/ -v -o examples/SCREENSHOT_TO_CODE-o1-preview.md --agent-model o1-preview --agent-temperature 1`</details> | python | [o1-preview](./SCREENSHOT-TO-CODE-o1-preview.md), [gpt-4o](./SCREENSHOT-TO-CODE-gpt-4o.md), [threat model - o1-preview](./TM-SCREENSHOT-TO-CODE-o1-preview.md) |
| [requests](https://github.com/psf/requests) - A simple, yet elegant, HTTP library<br/><details><summary>command...</summary>`python ai_create_project_sec_design/app.py -t requests/ -v --exclude "**/ISSUE_TEMPLATE*,**/CODE_OF_CONDUCT.md,**/CONTRIBUTING.md,**/FUNDING.yml" --include "**/*.cfg,**/*.rst" -o examples/REQUESTS-o1-preview.md --agent-model o1-preview --agent-temperature 1`</details> | python | [gpt-4o](./REQUESTS-gpt-4o.md), [o1-preview](./REQUESTS-o1-preview.md), [threat model - o1-preview](./TM-REQUESTS-o1-preview.md) |
| [flask](https://github.com/pallets/flask) - The Python micro framework for building web applications<br/><details><summary>command...</summary>`python ai_create_project_sec_design/app.py -t ../flask/ -v --exclude "**/pull_request_template.md,**/ISSUE_TEMPLATE*,**/CODE_OF_CONDUCT.md" --include "**/requirements/*.txt,**/*.rst" -o examples/FLASK-o1-preview.md --agent-model o1-preview --agent-temperature 1`</details> | python | [gpt-4o](./FLASK-gpt-4o.md), [o1-preview](./FLASK-o1-preview.md), [threat model - o1-preview](./TM-FLASK-o1-preview.md) |
| [caddy](https://github.com/caddyserver/caddy) - Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS<br/><details><summary>command...</summary>`python ai_security_analyzer/app.py -t caddy/ -v --project-type go -o examples/CADDY-o1-preview.md --agent-model o1-preview --agent-temperature 1`</details> | go | [o1-preview](./CADDY-o1-preview.md), [gpt-4o](./CADDY-gpt-4o.md), [threat model - o1-preview](./TM-CADDY-o1-preview.md)
| [screenshot-to-code](https://github.com/abi/screenshot-to-code) - Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)<br/><details><summary>command...</summary>`python ai_security_analyzer/app.py -t screenshot-to-code/ -v -o examples/SCREENSHOT_TO_CODE-o1-preview.md --agent-model o1-preview --agent-temperature 1`</details> | python | [o1-preview](./SCREENSHOT-TO-CODE-o1-preview.md), [gpt-4o](./SCREENSHOT-TO-CODE-gpt-4o.md), [threat model - o1-preview](./TM-SCREENSHOT-TO-CODE-o1-preview.md) |
| [requests](https://github.com/psf/requests) - A simple, yet elegant, HTTP library<br/><details><summary>command...</summary>`python ai_security_analyzer/app.py -t requests/ -v --exclude "**/ISSUE_TEMPLATE*,**/CODE_OF_CONDUCT.md,**/CONTRIBUTING.md,**/FUNDING.yml" --include "**/*.cfg,**/*.rst" -o examples/REQUESTS-o1-preview.md --agent-model o1-preview --agent-temperature 1`</details> | python | [gpt-4o](./REQUESTS-gpt-4o.md), [o1-preview](./REQUESTS-o1-preview.md), [threat model - o1-preview](./TM-REQUESTS-o1-preview.md) |
| [flask](https://github.com/pallets/flask) - The Python micro framework for building web applications<br/><details><summary>command...</summary>`python ai_security_analyzer/app.py -t ../flask/ -v --exclude "**/pull_request_template.md,**/ISSUE_TEMPLATE*,**/CODE_OF_CONDUCT.md" --include "**/requirements/*.txt,**/*.rst" -o examples/FLASK-o1-preview.md --agent-model o1-preview --agent-temperature 1`</details> | python | [gpt-4o](./FLASK-gpt-4o.md), [o1-preview](./FLASK-o1-preview.md), [threat model - o1-preview](./TM-FLASK-o1-preview.md) |
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "ai-create-project-sec-design"
name = "ai-security-analyzer"
version = "0.0.1"
description = ""
authors = ["xvnpw <17719543+xvnpw@users.noreply.github.com>"]
Expand Down
12 changes: 6 additions & 6 deletions tests/test_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

import pytest

from ai_create_project_sec_design.agent_builder import AgentBuilder
from ai_create_project_sec_design.agents import (
from ai_security_analyzer.agent_builder import AgentBuilder
from ai_security_analyzer.agents import (
CreateProjectSecurityDesignAgent,
GraphNodeType,
)
from ai_create_project_sec_design.base_agent import BaseAgent
from ai_create_project_sec_design.documents import DocumentFilter, DocumentProcessor
from ai_create_project_sec_design.llms import LLM, LLMProvider, ModelConfig
from ai_create_project_sec_design.markdowns import MarkdownMermaidValidator
from ai_security_analyzer.base_agent import BaseAgent
from ai_security_analyzer.documents import DocumentFilter, DocumentProcessor
from ai_security_analyzer.llms import LLM, LLMProvider, ModelConfig
from ai_security_analyzer.markdowns import MarkdownMermaidValidator
from langchain_core.documents import Document


Expand Down
2 changes: 1 addition & 1 deletion tests/test_documents.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from langchain_core.documents import Document

from ai_create_project_sec_design.documents import DocumentProcessor, DocumentFilter
from ai_security_analyzer.documents import DocumentProcessor, DocumentFilter


# Mock Tokenizer for testing
Expand Down
4 changes: 2 additions & 2 deletions tests/test_graphs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest.mock import Mock
from ai_create_project_sec_design.graphs import RunGraphExecutor, DryRunGraphExecutor, GraphExecutorFactory
from ai_create_project_sec_design.config import AppConfig
from ai_security_analyzer.graphs import RunGraphExecutor, DryRunGraphExecutor, GraphExecutorFactory
from ai_security_analyzer.config import AppConfig
from langgraph.graph.state import CompiledStateGraph
from langchain_core.documents import Document

Expand Down
4 changes: 2 additions & 2 deletions tests/test_llms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import pytest
from langchain_core.language_models.chat_models import BaseChatModel

from ai_create_project_sec_design import constants
from ai_create_project_sec_design.llms import LLMProvider
from ai_security_analyzer import constants
from ai_security_analyzer.llms import LLMProvider


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion tests/test_loaders.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pathlib import Path

from ai_create_project_sec_design.loaders import RepoDirectoryLoader
from ai_security_analyzer.loaders import RepoDirectoryLoader


def _in_path(substring, paths):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_markdowns.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ai_create_project_sec_design.markdowns import MarkdownMermaidValidator
from ai_create_project_sec_design.utils import find_node_binary
from ai_security_analyzer.markdowns import MarkdownMermaidValidator
from ai_security_analyzer.utils import find_node_binary

NODE_PATH = find_node_binary()
if not NODE_PATH:
Expand Down

0 comments on commit 606617a

Please sign in to comment.