code-audit-23 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,184 @@
1
+ Metadata-Version: 2.4
2
+ Name: code-audit-23
3
+ Version: 0.1.1
4
+ Summary: A simple local scanner for code audits (Trivy, SonarQube, for Brain Station 23)
5
+ Author-email: Ahmad Al-Sajid <ahmad.sajid@brainstation23.com>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.9
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: click<9.0,>=8.1.7
11
+ Requires-Dist: python-dotenv<2.0,>=1.0
12
+ Requires-Dist: requests<3.0,>=2.31
13
+ Dynamic: license-file
14
+
15
+ # Code Audit 23
16
+
17
+ [![PyPI Version](https://img.shields.io/pypi/v/code-audit-23.svg)](https://pypi.org/project/code-audit-23/)
18
+ [![Python Version](https://img.shields.io/pypi/pyversions/code-audit-23.svg)](https://pypi.org/project/code-audit-23/)
19
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
20
+
21
+ Code Audit 23 is a comprehensive command-line interface (CLI) tool that unifies multiple code quality and security scanning tools into a single, easy-to-use interface. It's designed to help developers maintain high code quality and security standards across their projects.
22
+
23
+ ## โœจ Features
24
+
25
+ - **Unified Interface**: Single command to run multiple code quality and security scans
26
+ - **Multiple Tools Integration**:
27
+ - **SonarQube** - Code quality and security analysis
28
+ - **Gitleaks** - Detect hardcoded secrets and credentials
29
+ - **Trivy** - Vulnerability scanning for dependencies and container images
30
+ - **Interactive Menu**: User-friendly command-line interface
31
+ - **Cross-Platform**: Works on Windows, macOS, and Linux
32
+ - **SARIF Reports**: Standardized output format for all scan results
33
+ - **No Installation Required**: Self-contained executable available
34
+
35
+ ## ๐Ÿš€ Installation
36
+
37
+ ### Prerequisites
38
+
39
+ - Python 3.9 or higher
40
+ - Java 11+ (for SonarQube Scanner)
41
+ - [Git](https://git-scm.com/) (for Gitleaks)
42
+
43
+ ### Install from PyPI
44
+
45
+ ```bash
46
+ pip install code-audit-23
47
+ ```
48
+
49
+ ### Install from Source
50
+
51
+ 1. Clone the repository:
52
+ ```bash
53
+ git clone https://github.com/BrainStation-23/CodeAudit23.git
54
+ cd CodeAudit23
55
+ ```
56
+
57
+ 2. Create and activate a virtual environment:
58
+ ```bash
59
+ # Linux/macOS
60
+ python -m venv venv
61
+ source venv/bin/activate
62
+
63
+ # Windows
64
+ python -m venv venv
65
+ .\venv\Scripts\activate
66
+ ```
67
+
68
+ 3. Install dependencies:
69
+ ```bash
70
+ pip install -e .
71
+ ```
72
+
73
+ ## ๐Ÿ”ง Configuration
74
+
75
+ 1. Create a `.env` file in your project root with the following variables:
76
+ ```env
77
+ SONAR_HOST_URL=https://your-sonarqube-instance.com
78
+ SONAR_LOGIN=your_sonarqube_token
79
+ ```
80
+
81
+ 2. The first time you run a scan, the tool will prompt you for SonarQube credentials if they're not in the `.env` file.
82
+
83
+ ## ๐Ÿ›  Usage
84
+
85
+ ### Basic Usage
86
+
87
+ Run the interactive menu:
88
+ ```bash
89
+ code-audit-23
90
+ ```
91
+
92
+ ### Command Line Options
93
+
94
+ ```
95
+ Usage: code-audit-23 [OPTIONS]
96
+
97
+ Interactive entrypoint for Audit Scanner
98
+
99
+ Options:
100
+ --help Show this message and exit.
101
+ ```
102
+
103
+ ### Menu Options
104
+
105
+ 1. **Quick Scan** - Run all security scans in sequence (SonarQube + Gitleaks + Trivy)
106
+ 2. **Gitleaks Scan** - Scan for secrets and sensitive information
107
+ 3. **Trivy Scan** - Scan for vulnerabilities in dependencies and container images
108
+ 4. **SonarQube Scan** - Analyze code quality and security issues
109
+
110
+ ## ๐Ÿ“Š Output
111
+
112
+ All scan reports are saved in the `reports/` directory in SARIF format:
113
+ - `reports/gitleaks.sarif` - Results from Gitleaks scan
114
+ - `reports/trivy.sarif` - Results from Trivy scan
115
+ - SonarQube results are available on your SonarQube server
116
+
117
+ ## ๐Ÿงช Development
118
+
119
+ ### Project Structure
120
+
121
+ ```
122
+ code_audit_23/
123
+ โ”œโ”€โ”€ __init__.py
124
+ โ”œโ”€โ”€ main.py # Main CLI entry point
125
+ โ”œโ”€โ”€ sonarqube_cli.py # SonarQube scanner implementation
126
+ โ””โ”€โ”€ logger.py # Logging configuration
127
+ ```
128
+
129
+ ### Dependencies
130
+
131
+ - `click` - Command line interface creation
132
+ - `requests` - HTTP requests
133
+ - `python-dotenv` - Environment variable management
134
+
135
+ ### Building & Publishing to PyPI
136
+
137
+ 1. Update the version in `pyproject.toml` (and optionally `__init__.py` if you mirror it there). Commit the change.
138
+ 2. Ensure you have the packaging tooling:
139
+ ```bash
140
+ python -m pip install --upgrade build twine
141
+ ```
142
+ 3. Clean any previous artifacts:
143
+ ```bash
144
+ rm -rf dist build *.egg-info
145
+ ```
146
+ 4. Build the source distribution and wheel:
147
+ ```bash
148
+ python -m build
149
+ ```
150
+ 5. (Optional but recommended) Validate the archives locally:
151
+ ```bash
152
+ twine check dist/*
153
+ ```
154
+ 6. (Optional) Publish to TestPyPI before the main release:
155
+ ```bash
156
+ python -m twine upload --repository testpypi dist/*
157
+ ```
158
+ 7. Once satisfied, publish to PyPI:
159
+ ```bash
160
+ python -m twine upload dist/*
161
+ ```
162
+ 8. Tag the release in git, e.g.:
163
+ ```bash
164
+ git tag -a v0.1.0 -m "Release v0.1.0"
165
+ git push origin v0.1.0
166
+ ```
167
+
168
+ ## ๐Ÿค Contributing
169
+
170
+ Contributions are welcome! Please read our [Contributing Guidelines](./CONTRIBUTING.md) for details on how to submit pull requests, report issues, or suggest new features.
171
+
172
+ ## ๐Ÿ“„ License
173
+
174
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
175
+
176
+ ## ๐Ÿ™ Acknowledgments
177
+
178
+ - [SonarQube](https://www.sonarqube.org/) - For the amazing code quality platform
179
+ - [Gitleaks](https://github.com/gitleaks/gitleaks) - For the secrets detection
180
+ - [Trivy](https://github.com/aquasecurity/trivy) - For the vulnerability scanning
181
+
182
+ ## ๐Ÿ“ง Contact
183
+
184
+ For any questions or feedback, please contact [Ahmad Al-Sajid](mailto:ahmad.sajid@brainstation-23.com).
@@ -0,0 +1,17 @@
1
+ code_audit_23/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ code_audit_23/logger.py,sha256=4L0-vzS8INLfC3FrfO-buGRiLjiM3f68_dOpMuo96c8,1589
3
+ code_audit_23/main.py,sha256=ELRb8lNw2A7_62_THrTlsAuK_CQCX79HmX3dJOh8lzc,10933
4
+ code_audit_23/sonarqube_cli.py,sha256=a0V4hvX__2AJTLXqWBjdG5eMp7_-X3PpngXSmhqtyfA,9394
5
+ code_audit_23/trivy_cli.py,sha256=mzhkLxiFQV737lqdNJBM_2ajcGA0Ulsq4G45iNDUdeA,11071
6
+ code_audit_23/sonar-scanner/bin/sonar-scanner,sha256=jDQsz5j4LEy0_2hbXrHF25I5TwPFdqOHRqWVQrhgqF0,1854
7
+ code_audit_23/sonar-scanner/bin/sonar-scanner-debug,sha256=UUTT52N5kqHcZ7wm6s1gGpfqx7UYXJJmBAW-LhKfpaA,921
8
+ code_audit_23/sonar-scanner/bin/sonar-scanner-debug.bat,sha256=dbjbmmHNPdCMcjoH2MCT22s9B5vUAe4ioZbdonyQnII,805
9
+ code_audit_23/sonar-scanner/bin/sonar-scanner.bat,sha256=ulQfLMfB80yaewaLrCA1qIgDhFpS7F8UPJsAOOvfbWo,2554
10
+ code_audit_23/sonar-scanner/conf/sonar-scanner.properties,sha256=Rm-t0muBwFYadaUz6COggNxZxRyHD9lpHnBWHwpKbwY,356
11
+ code_audit_23/sonar-scanner/lib/sonar-scanner-cli-7.3.0.5189.jar,sha256=UoOVgUI3opT_DPDG58AzNiCLz-J4UaQzujlM4PlK91w,13285690
12
+ code_audit_23-0.1.1.dist-info/licenses/LICENSE,sha256=fOwD7XDNaZSTv2l_oHfnmHzRA0nOBW1_s5ET2-a4Yl4,1103
13
+ code_audit_23-0.1.1.dist-info/METADATA,sha256=Ih_O6u12MJk70aUaDToA6bTJs5cszQzAtnfoNi7kiLM,5384
14
+ code_audit_23-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ code_audit_23-0.1.1.dist-info/entry_points.txt,sha256=bmrlNiAXXmyjdfeNa0xMwpyAV4SfWYI4IfWmqdjxSUo,58
16
+ code_audit_23-0.1.1.dist-info/top_level.txt,sha256=ynOYCHFyYQ221NVQIzc-S3PKuTlhCPu_dWflN9sLG3I,14
17
+ code_audit_23-0.1.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ code-audit-23 = code_audit_23.main:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 BrainStation-23 (https://brainstation-23.com/)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ code_audit_23