AI-Powered Security Analysis CLI with GitHub Integration and Universal Language Support
Project description
SecureCLI - Comprehensive Multi-Language Security Analysis Platform
Enterprise-grade security analysis for modern development teams
Supporting 10+ programming languages with 20+ integrated security tools
๐ก๏ธ Overview
SecureCLI is a comprehensive security analysis platform that provides unified security scanning across multiple programming languages and frameworks. Built for modern development workflows, it integrates seamlessly with CI/CD pipelines and provides actionable security insights.
๐ Key Features
- ๐ Multi-Language Support: Python, JavaScript/TypeScript, Java, C/C++, Rust, Ruby, Go, C#/.NET, Solidity, Vyper
- ๐ง 20+ Security Tools: Bandit, Semgrep, ESLint, SpotBugs, Gosec, Slither, DevSkim, and more
- ๐ Smart Contract Security: Specialized analysis for Ethereum, Vyper, and EVM-compatible contracts
- ๐ Multiple Output Formats: JSON, Markdown, CSV, HTML reports
- โก Fast & Scalable: Parallel processing and intelligent caching
- ๐ CI/CD Integration: GitHub Actions, GitLab CI, Jenkins ready
- ๐ Enterprise Features: CVSS scoring, vulnerability tracking, compliance reporting
๐ Quick Start
Installation
# Install SecureCLI
pip install securecli
# Install security analysis tools
./scripts/install-security-tools.sh # Linux/WSL
# OR
.\scripts\install-security-tools.ps1 # Windows PowerShell (as admin)
# Verify installation
python scripts/validate-tools.py
Basic Usage
# Scan current directory
securecli scan .
# Scan specific file
securecli scan app.py
# Generate JSON report
securecli scan . --format json --output security-report.json
# High-severity findings only
securecli scan . --severity-min HIGH
# Verbose output
securecli scan . --verbose
Example Output
๐ SecureCLI Security Analysis Report
๐ Scanned: ./my-project (42 files)
๐ Duration: 23.4s
๐ง Tools: bandit, semgrep, gosec, eslint, slither
๐ Summary:
๐ด Critical: 2
๐ High: 5
๐ก Medium: 8
๐ข Low: 3
๐ด Critical Issues:
SQL Injection in user_auth.py:45
Hardcoded Secret in config.js:12
๐ High Issues:
Command Injection in file_handler.py:78
Reentrancy Vulnerability in Token.sol:134
...
๐ก Run with --verbose for detailed recommendations
๐ Supported Languages & Tools
| Language | Extensions | Primary Tools | Additional Tools |
|---|---|---|---|
| Python | .py |
Bandit, Semgrep | Safety, pip-audit |
| JavaScript/TypeScript | .js, .ts, .jsx, .tsx |
ESLint Security, Semgrep | npm audit, retire.js |
| Java | .java, .jsp |
SpotBugs, PMD | Find Security Bugs |
| C/C++ | .c, .cpp, .h, .hpp |
Clang Static Analyzer | CppCheck |
| Rust | .rs, .toml |
Clippy, Cargo Audit | RustSec Advisory |
| Ruby | .rb |
Brakeman, RuboCop Security | bundler-audit |
| Go | .go |
Gosec, Staticcheck | go-critic |
| C#/.NET | .cs, .razor |
DevSkim, Roslyn Analyzers | Security Code Scan |
| Solidity | .sol |
Slither, solc | Pattern-based analysis |
| Vyper | .vy |
Vyper compiler | Pattern-based analysis |
๐ง Installation Guide
Automated Installation (Recommended)
Linux/WSL
git clone <repository-url>
cd SecureCLI
chmod +x scripts/install-security-tools.sh
./scripts/install-security-tools.sh
Windows PowerShell (Run as Administrator)
git clone <repository-url>
cd SecureCLI
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.\scripts\install-security-tools.ps1
Manual Installation
Python Dependencies
pip install -r requirements-dev.txt
Language-Specific Tools
# Rust tools
rustup component add clippy
cargo install cargo-audit
# Ruby tools
gem install brakeman rubocop rubocop-security bundler-audit
# Go tools
go install github.com/securecodewarrior/gosec/v2/cmd/gosec@latest
go install honnef.co/go/tools/cmd/staticcheck@latest
# .NET tools
dotnet tool install --global Microsoft.CST.DevSkim.CLI
# Smart contract tools
npm install -g solc
pip install slither-analyzer vyper
Verification
# Run comprehensive test
python scripts/comprehensive-test.py
# Validate specific tools
python scripts/validate-tools.py
๐ Language-Specific Examples
Python Security Analysis
# Basic Python scan
securecli scan app.py
# Django project scan
securecli scan . --include="*.py" --exclude="venv,migrations"
# Focus on high-severity issues
securecli scan . --language python --severity-min HIGH
Smart Contract Security
# Solidity contract analysis
securecli scan contracts/ --include="*.sol"
# Vyper contract analysis
securecli scan contracts/ --include="*.vy"
# Comprehensive DeFi audit
securecli scan . --include="*.sol,*.vy" --format json --output defi-audit.json
Web Application Security
# Full-stack JavaScript application
securecli scan . --include="*.js,*.ts,*.jsx,*.tsx"
# Backend API security
securecli scan backend/ --language java,python
# Frontend security scan
securecli scan frontend/ --language javascript --tools eslint,semgrep
โ๏ธ Configuration
Configuration File
Create securecli.yml:
# SecureCLI Configuration
project:
name: "My Project"
version: "1.0.0"
scanning:
parallel_jobs: 4
timeout: 300
exclude_paths:
- "node_modules/"
- "venv/"
- "target/"
- "*.test.*"
tools:
bandit:
enabled: true
config_file: ".bandit"
semgrep:
enabled: true
rules: ["auto", "security", "secrets"]
slither:
enabled: true
detectors: ["all"]
exclude_detectors: ["solc-version"]
gosec:
enabled: true
include_tests: false
reporting:
format: "json"
output_file: "security-report.json"
include_code_snippets: true
severity_filter: "MEDIUM"
cvss:
enabled: true
version: "4.0"
compliance:
standards: ["OWASP", "CWE", "NIST"]
Tool-Specific Configuration
Bandit (Python)
.bandit:
[bandit]
exclude = /tests/,/venv/
skips = B101,B601
ESLint (JavaScript)
.eslintrc.js:
module.exports = {
extends: ['@microsoft/eslint-plugin-security'],
rules: {
'security/detect-object-injection': 'error',
'security/detect-non-literal-fs-filename': 'warn'
}
};
๐ Reporting & Output Formats
JSON Report
{
"summary": {
"scan_id": "scan_20240101_120000",
"timestamp": "2024-01-01T12:00:00Z",
"duration": 23.4,
"files_scanned": 42,
"tools_used": ["bandit", "semgrep", "gosec"],
"findings_count": {
"critical": 2,
"high": 5,
"medium": 8,
"low": 3
}
},
"findings": [
{
"id": "FINDING_001",
"tool": "bandit",
"rule_id": "B602",
"title": "Use of subprocess with shell=True",
"severity": "HIGH",
"confidence": "HIGH",
"file_path": "app/utils.py",
"line_number": 45,
"column_number": 12,
"code_snippet": "subprocess.call(cmd, shell=True)",
"description": "Use of subprocess with shell=True can lead to command injection",
"cwe_id": "CWE-78",
"cvss_score": 8.1,
"recommendation": "Use subprocess without shell=True or validate input"
}
]
}
Markdown Report
# Security Analysis Report
## Summary
- **Scan ID**: scan_20240101_120000
- **Files Scanned**: 42
- **Duration**: 23.4s
- **Critical**: 2 ๐ด
- **High**: 5 ๐
## Critical Findings
### Command Injection in app/utils.py
- **Line**: 45
- **Tool**: bandit
- **CVSS**: 8.1
- **CWE**: CWE-78
```python
subprocess.call(cmd, shell=True) # โ Vulnerable
Recommendation: Use subprocess without shell=True
### CSV Export
```csv
ID,Tool,Rule,Severity,File,Line,Description,CWE,CVSS
FINDING_001,bandit,B602,HIGH,app/utils.py,45,Command injection,CWE-78,8.1
FINDING_002,semgrep,javascript.express.security.audit.express-session-secret.express-session-secret,MEDIUM,server.js,23,Hardcoded session secret,CWE-798,6.5
๐ CI/CD Integration
GitHub Actions
name: Security Analysis
on: [push, pull_request]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install SecureCLI
run: |
pip install securecli
./scripts/install-security-tools.sh
- name: Security Scan
run: |
securecli scan . --format json --output security-report.json
- name: Upload Results
uses: actions/upload-artifact@v3
with:
name: security-report
path: security-report.json
- name: Comment PR
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
script: |
// Add security results to PR comment
GitLab CI
security_scan:
stage: test
image: python:3.11
before_script:
- pip install securecli
- ./scripts/install-security-tools.sh
script:
- securecli scan . --format json --output security-report.json
artifacts:
reports:
junit: security-report.json
paths:
- security-report.json
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
Jenkins Pipeline
pipeline {
agent any
stages {
stage('Security Analysis') {
steps {
sh 'pip install securecli'
sh './scripts/install-security-tools.sh'
sh 'securecli scan . --format json --output security-report.json'
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: '.',
reportFiles: 'security-report.json',
reportName: 'Security Report'
])
}
}
}
}
๐งช Testing & Validation
Comprehensive Test Suite
# Run full test suite
python scripts/comprehensive-test.py
# Test specific languages
securecli scan tests/samples/ --language python,javascript
# Performance benchmarking
securecli scan large-project/ --benchmark --parallel 8
Sample Vulnerable Code
The repository includes sample vulnerable code for testing:
tests/samples/
โโโ python/
โ โโโ sql_injection.py
โ โโโ command_injection.py
โ โโโ hardcoded_secrets.py
โโโ javascript/
โ โโโ xss_vulnerability.js
โ โโโ prototype_pollution.js
โโโ java/
โ โโโ SQLInjection.java
โ โโโ PathTraversal.java
โโโ solidity/
โ โโโ Reentrancy.sol
โ โโโ AccessControl.sol
โโโ ...
๐ Documentation
- Installation Guide - Comprehensive setup instructions
- Usage Guide - Detailed usage examples and best practices
- Smart Contract Security - Blockchain security analysis
- Architecture - System design and architecture
- API Reference - API documentation and integration guides
- Contributing - Development and contribution guidelines
๐ก๏ธ Security Features
Vulnerability Detection
- Code Injection: SQL, Command, Code injection detection
- Cryptographic Issues: Weak algorithms, hardcoded secrets
- Authentication Flaws: Access control bypasses, session issues
- Smart Contract Vulnerabilities: Reentrancy, integer overflow, access control
- Dependency Vulnerabilities: Known CVEs in dependencies
- Configuration Issues: Insecure defaults, misconfigurations
Compliance Standards
- OWASP Top 10: Web application security risks
- CWE: Common Weakness Enumeration mapping
- NIST: Cybersecurity framework alignment
- SANS: Security best practices
- GDPR: Data protection compliance checks
Enterprise Features
- Role-Based Access: Team and organizational access controls
- Custom Rules: Organization-specific security policies
- Audit Trails: Complete security scanning history
- Integration APIs: REST APIs for enterprise integration
- Compliance Reporting: Automated compliance documentation
๐ค Contributing
We welcome contributions from the security community! Ways to contribute:
- ๐ Bug Reports: Report issues and bugs
- โจ Feature Requests: Suggest new features and improvements
- ๐ง Tool Integration: Add support for new security tools
- ๐ Language Support: Add new programming language analyzers
- ๐ Documentation: Improve documentation and examples
- ๐งช Testing: Add test cases and validation scenarios
Development Setup
# Clone repository
git clone <repository-url>
cd SecureCLI
# Setup development environment
python -m venv venv
source venv/bin/activate # Linux/macOS
# venv\Scripts\activate # Windows
# Install development dependencies
pip install -r requirements-dev.txt
pip install -e .
# Run tests
pytest tests/
python scripts/validate-tools.py
See CONTRIBUTING.md for detailed guidelines.
๐ Performance & Scalability
Performance Optimization
- Parallel Processing: Multi-threaded scanning
- Intelligent Caching: Results caching for faster re-scans
- Incremental Analysis: Scan only changed files
- Memory Management: Efficient memory usage for large codebases
- Network Optimization: Optimized tool downloads and updates
Scalability Features
- Distributed Scanning: Scale across multiple machines
- Container Support: Docker and Kubernetes deployment
- Cloud Integration: AWS, Azure, GCP support
- Database Storage: PostgreSQL, MySQL result storage
- Message Queues: Redis, RabbitMQ for job processing
Benchmarks
Large Enterprise Codebase (100k+ files):
- Scan Time: ~45 minutes
- Memory Usage: ~2GB peak
- CPU Cores: 8 (parallel processing)
- Findings: ~1,200 security issues identified
๐ Integrations
IDEs & Editors
- VS Code: SecureCLI extension for real-time analysis
- IntelliJ IDEA: Plugin for JetBrains IDEs
- Vim/Neovim: Command-line integration
- Sublime Text: Package for syntax highlighting
Security Platforms
- SIEM Integration: Splunk, Elastic, IBM QRadar
- Vulnerability Management: Qualys, Rapid7, Tenable
- Code Quality: SonarQube, CodeClimate integration
- Bug Tracking: Jira, GitHub Issues, Azure DevOps
Development Tools
- Git Hooks: Pre-commit and pre-push validation
- Package Managers: npm, pip, cargo, maven integration
- Build Tools: Gradle, Maven, webpack, rollup
- Testing Frameworks: Jest, pytest, JUnit, RSpec
๐ Support & Community
Getting Help
- ๐ Documentation: Comprehensive guides and examples
- ๐ Issues: GitHub Issues for bug reports and feature requests
- ๐ฌ Discussions: Community discussions and Q&A
- ๐ง Email: Direct support for enterprise customers
Community Resources
- ๐ Tutorials: Step-by-step security analysis guides
- ๐ Blog Posts: Security insights and best practices
- ๐ฅ Videos: Demonstration videos and tutorials
- ๐ Case Studies: Real-world security analysis examples
Professional Services
- ๐ข Enterprise Support: 24/7 support for enterprise customers
- ๐ฏ Custom Training: Security analysis training programs
- ๐ง Custom Development: Tailored security solutions
- ๐ Security Consulting: Expert security assessment services
๐ License
SecureCLI is released under the MIT License. See LICENSE file for details.
๐ Acknowledgments
SecureCLI integrates with many excellent open-source security tools:
- Bandit - Python security linter
- Semgrep - Static analysis engine
- Slither - Solidity static analyzer
- Gosec - Go security analyzer
- ESLint Security - JavaScript security rules
- SpotBugs - Java static analyzer
- Brakeman - Ruby on Rails security scanner
Special thanks to all contributors and the security research community for making secure software development accessible to everyone.
๐ก๏ธ Secure your code. Protect your users. Build with confidence.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file securecode_ai-1.0.0.tar.gz.
File metadata
- Download URL: securecode_ai-1.0.0.tar.gz
- Upload date:
- Size: 390.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58f98040246abfc14895ade30749e0938d26bc4504895e8272bdaaa6662ada4b
|
|
| MD5 |
7148bfc71ac4e5cf6d216244e0a9e50a
|
|
| BLAKE2b-256 |
955af75362664c245a59d6f471c9569d552e7d6e404791343d4c60809a9f619c
|
File details
Details for the file securecode_ai-1.0.0-py3-none-any.whl.
File metadata
- Download URL: securecode_ai-1.0.0-py3-none-any.whl
- Upload date:
- Size: 397.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9abcec6f436351f0355a947cb1c55c1b9c8c7572285264433600882b411c7aa5
|
|
| MD5 |
8d6e96fad0c010ffa0d34fa6f775af75
|
|
| BLAKE2b-256 |
aaae8f317804963e0c92c8f9c529b3d633867b3ce00e599e7764ac1f99c5f9e1
|