Skip to content

Commit 4b0bfec

Browse files
Enhanced CLI UI, CSV export, and roadmap update
CLI Enhancements: - Professional ASCII art banner with CRYPTOSCAN branding - CSNP mission statement prominently displayed - Improved scan results with visual severity indicators (bars) - Better organized findings with numbered entries - Footer with CSNP mission and links New Features: - CSV export format (--format csv) for spreadsheet analysis - All 21 columns including priority score for sorting - Easy import into Excel, Google Sheets, pandas Documentation: - Updated README with CSNP mission - Added comprehensive roadmap section - Cloud scanning (AWS/Azure/GCP) added to future releases - QRAMM toolkit overview with planned tools - Updated feature list (50+ patterns, dependency scanning)
1 parent 63f9b38 commit 4b0bfec

4 files changed

Lines changed: 335 additions & 68 deletions

File tree

README.md

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,33 @@
55

66
**CryptoScan** is a powerful command-line tool for discovering cryptographic algorithms, key sizes, and quantum-vulnerable patterns in codebases. Part of the [QRAMM](https://qramm.org) (Quantum Readiness Assessment Maturity Model) toolkit by [CSNP](https://csnp.org).
77

8+
## CSNP Mission
9+
10+
*Advancing cybersecurity through education, research, and open-source tools that empower organizations worldwide.*
11+
812
## Features
913

1014
- **Quantum Risk Assessment**: Identifies cryptographic implementations vulnerable to quantum computing attacks
11-
- **Comprehensive Detection**: Scans for 30+ cryptographic patterns including:
15+
- **Comprehensive Detection**: Scans for 50+ cryptographic patterns including:
1216
- Asymmetric algorithms: RSA, ECDSA, DSA, DH, ECDH, Ed25519
1317
- Symmetric algorithms: AES, DES, 3DES, RC4, Blowfish, ChaCha20
1418
- Hash functions: MD5, SHA-1, SHA-2 family, SHA-3
1519
- TLS/SSL configurations and cipher suites
1620
- Crypto library imports (Python, Java, Go, Node.js, OpenSSL)
17-
- Private keys and certificates in source code
21+
- Private keys and certificates (RSA, EC, DSA, SSH, PGP, PKCS#8)
22+
- Cloud KMS references (AWS KMS, Azure Key Vault, GCP KMS, HashiCorp Vault)
23+
- JWT secrets, HMAC keys, and hardcoded encryption keys
24+
- Weak key derivation (PBKDF with low iterations)
25+
- **Dependency Scanning**: Detects crypto libraries in 20+ dependency manifest formats
26+
- **Context-Aware Analysis**: Adjusts confidence based on file type, language, and code context
1827
- **Multiple Output Formats**:
19-
- Text (human-readable with color)
28+
- Text (professional CLI with visual indicators)
2029
- JSON (for programmatic processing)
30+
- **CSV** (for spreadsheet analysis and reporting)
2131
- SARIF (for security tool integration)
2232
- CBOM (Cryptographic Bill of Materials - CycloneDX format)
2333
- **Flexible Scanning**: Include/exclude patterns, severity filtering, directory depth limits
34+
- **Actionable Remediation**: Each finding includes NIST PQC migration guidance
2435

2536
## Installation
2637

@@ -110,7 +121,7 @@ Structured JSON output for integration with other tools:
110121
cryptoscan scan [path] [flags]
111122
112123
Flags:
113-
-f, --format string Output format: text, json, sarif, cbom (default "text")
124+
-f, --format string Output format: text, json, csv, sarif, cbom (default "text")
114125
-o, --output string Output file (default: stdout)
115126
-i, --include string File patterns to include (comma-separated)
116127
-e, --exclude string File patterns to exclude (comma-separated)
@@ -122,6 +133,15 @@ Flags:
122133
--git-history Scan Git history (coming soon)
123134
```
124135

136+
### Export to CSV
137+
138+
```bash
139+
# Export findings to CSV for spreadsheet analysis
140+
cryptoscan scan . --format csv --output crypto-findings.csv
141+
142+
# Open in Excel, Google Sheets, or use with pandas
143+
```
144+
125145
## Examples
126146

127147
### CI/CD Integration
@@ -163,10 +183,44 @@ Contributions are welcome! Please see our [Contributing Guidelines](CONTRIBUTING
163183

164184
Apache License 2.0 - see [LICENSE](LICENSE) for details.
165185

186+
## Roadmap
187+
188+
### Current Release (v1.0)
189+
- Local codebase scanning
190+
- 50+ crypto patterns with quantum risk classification
191+
- Multiple export formats (text, JSON, CSV, SARIF, CBOM)
192+
- Context-aware analysis
193+
- Dependency scanning
194+
195+
### Coming Soon
196+
- **Git History Scanning**: Detect crypto in historical commits
197+
- **Remote Repository Scanning**: Direct GitHub/GitLab URL scanning
198+
199+
### Future Releases
200+
- **Cloud Environment Scanning**:
201+
- AWS: Scan KMS keys, ACM certificates, Secrets Manager, Parameter Store
202+
- Azure: Key Vault keys/secrets, App Configuration
203+
- GCP: Cloud KMS, Secret Manager, Certificate Authority Service
204+
- **Infrastructure-as-Code Analysis**: Terraform, CloudFormation, Pulumi crypto configs
205+
- **Container Image Scanning**: Detect crypto in Docker images
206+
- **API Discovery**: Find crypto endpoints in OpenAPI/Swagger specs
207+
166208
## About QRAMM
167209

168210
The Quantum Readiness Assessment Maturity Model (QRAMM) is a comprehensive framework developed by [CSNP](https://csnp.org) to help organizations prepare for post-quantum cryptography. Learn more at [qramm.org](https://qramm.org).
169211

212+
### QRAMM Toolkit
213+
214+
CryptoScan is part of a planned suite of open-source quantum readiness tools:
215+
216+
| Tool | Purpose | Status |
217+
|------|---------|--------|
218+
| **CryptoScan** | Cryptographic discovery in codebases | Available |
219+
| **CryptoCBOM** | Cryptographic Bill of Materials generator | Planned |
220+
| **TLS-Analyzer** | TLS/SSL configuration analysis | Planned |
221+
| **KeyRotate** | Key rotation automation | Planned |
222+
| **QRAMM-CLI** | Assessment and planning interface | Planned |
223+
170224
## Related Resources
171225

172226
- [NIST Post-Quantum Cryptography Standards](https://csrc.nist.gov/projects/post-quantum-cryptography)

internal/cli/scan.go

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Examples:
5858
}
5959

6060
func init() {
61-
scanCmd.Flags().StringVarP(&outputFormat, "format", "f", "text", "Output format: text, json, sarif, cbom")
61+
scanCmd.Flags().StringVarP(&outputFormat, "format", "f", "text", "Output format: text, json, csv, sarif, cbom")
6262
scanCmd.Flags().StringVarP(&outputFile, "output", "o", "", "Output file (default: stdout)")
6363
scanCmd.Flags().StringVarP(&includeGlobs, "include", "i", "", "File patterns to include (comma-separated)")
6464
scanCmd.Flags().StringVarP(&excludeGlobs, "exclude", "e", "", "File patterns to exclude (comma-separated)")
@@ -138,6 +138,8 @@ func runScan(cmd *cobra.Command, args []string) error {
138138
switch outputFormat {
139139
case "json":
140140
rep = reporter.NewJSONReporter(jsonPretty)
141+
case "csv":
142+
rep = reporter.NewCSVReporter()
141143
case "sarif":
142144
rep = reporter.NewSARIFReporter()
143145
case "cbom":
@@ -178,16 +180,44 @@ func runScan(cmd *cobra.Command, args []string) error {
178180
}
179181

180182
func printBanner() {
181-
fmt.Println("\033[36m")
182-
fmt.Println(" ____ _ ____")
183-
fmt.Println(" / ___|_ __ _ _ _ __ | |_ ___ / ___| ___ __ _ _ __")
184-
fmt.Println(" | | | '__| | | | '_ \\| __/ _ \\\\___ \\ / __/ _` | '_ \\")
185-
fmt.Println(" | |___| | | |_| | |_) | || (_) |___) | (_| (_| | | | |")
186-
fmt.Println(" \\____|_| \\__, | .__/ \\__\\___/|____/ \\___\\__,_|_| |_|")
187-
fmt.Println(" |___/|_|")
188-
fmt.Println("\033[0m")
189-
fmt.Println(" QRAMM Cryptographic Scanner - https://qramm.org")
190-
fmt.Println(" Copyright 2025 CSNP")
183+
const (
184+
colorCyan = "\033[36m"
185+
colorBlue = "\033[34m"
186+
colorGreen = "\033[32m"
187+
colorYellow = "\033[33m"
188+
colorReset = "\033[0m"
189+
colorBold = "\033[1m"
190+
colorDim = "\033[2m"
191+
)
192+
193+
fmt.Println()
194+
fmt.Println(colorCyan + colorBold + " ╔═══════════════════════════════════════════════════════════════╗")
195+
fmt.Println(" ║ ║")
196+
fmt.Println(" ║ ██████╗██████╗ ██╗ ██╗██████╗ ████████╗ ██████╗ ███████╗ ║")
197+
fmt.Println(" ║ ██╔════╝██╔══██╗╚██╗ ██╔╝██╔══██╗╚══██╔══╝██╔═══██╗██╔════╝ ║")
198+
fmt.Println(" ║ ██║ ██████╔╝ ╚████╔╝ ██████╔╝ ██║ ██║ ██║███████╗ ║")
199+
fmt.Println(" ║ ██║ ██╔══██╗ ╚██╔╝ ██╔═══╝ ██║ ██║ ██║╚════██║ ║")
200+
fmt.Println(" ║ ╚██████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝███████║ ║")
201+
fmt.Println(" ║ ╚═════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ║")
202+
fmt.Println(" ║ ███████╗ ██████╗ █████╗ ███╗ ██╗ ║")
203+
fmt.Println(" ║ ██╔════╝██╔════╝██╔══██╗████╗ ██║ ║")
204+
fmt.Println(" ║ ███████╗██║ ███████║██╔██╗ ██║ ║")
205+
fmt.Println(" ║ ╚════██║██║ ██╔══██║██║╚██╗██║ ║")
206+
fmt.Println(" ║ ███████║╚██████╗██║ ██║██║ ╚████║ ║")
207+
fmt.Println(" ║ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝ ║")
208+
fmt.Println(" ║ ║")
209+
fmt.Println(" ╚═══════════════════════════════════════════════════════════════╝" + colorReset)
210+
fmt.Println()
211+
fmt.Println(colorBlue + " QRAMM Cryptographic Discovery Scanner" + colorReset)
212+
fmt.Println(colorDim + " Quantum Readiness Assessment & Migration Tool" + colorReset)
213+
fmt.Println()
214+
fmt.Println(colorGreen + " ┌─────────────────────────────────────────────────────────────┐")
215+
fmt.Println(" │" + colorReset + colorBold + " CSNP Mission:" + colorReset + colorGreen + " │")
216+
fmt.Println(" │" + colorReset + " Advancing cybersecurity through education, research, and " + colorGreen + "│")
217+
fmt.Println(" │" + colorReset + " open-source tools that empower organizations worldwide. " + colorGreen + "│")
218+
fmt.Println(" └─────────────────────────────────────────────────────────────┘" + colorReset)
219+
fmt.Println()
220+
fmt.Println(colorDim + " https://qramm.org • https://csnp.org • Apache-2.0 License" + colorReset)
191221
fmt.Println()
192222
}
193223

pkg/reporter/csv.go

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
// Copyright 2025 Cyber Security Non-Profit (CSNP)
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package reporter
5+
6+
import (
7+
"encoding/csv"
8+
"strconv"
9+
"strings"
10+
11+
"github.com/csnp/qramm-cryptoscan/pkg/scanner"
12+
)
13+
14+
// CSVReporter generates CSV output for easy import into spreadsheets
15+
type CSVReporter struct{}
16+
17+
// NewCSVReporter creates a new CSV reporter
18+
func NewCSVReporter() *CSVReporter {
19+
return &CSVReporter{}
20+
}
21+
22+
// Generate creates the CSV report
23+
func (r *CSVReporter) Generate(results *scanner.Results) (string, error) {
24+
var b strings.Builder
25+
w := csv.NewWriter(&b)
26+
27+
// Write header row
28+
header := []string{
29+
"ID",
30+
"Severity",
31+
"Type",
32+
"Category",
33+
"Algorithm",
34+
"Key Size",
35+
"Quantum Risk",
36+
"Confidence",
37+
"File",
38+
"Line",
39+
"Column",
40+
"Match",
41+
"Language",
42+
"File Type",
43+
"Purpose",
44+
"Description",
45+
"Remediation",
46+
"Impact",
47+
"Effort",
48+
"Tags",
49+
"Priority Score",
50+
}
51+
if err := w.Write(header); err != nil {
52+
return "", err
53+
}
54+
55+
// Write findings
56+
for _, f := range results.Findings {
57+
row := []string{
58+
f.ID,
59+
f.Severity.String(),
60+
f.Type,
61+
f.Category,
62+
f.Algorithm,
63+
intToStr(f.KeySize),
64+
string(f.Quantum),
65+
string(f.Confidence),
66+
f.File,
67+
strconv.Itoa(f.Line),
68+
intToStr(f.Column),
69+
f.Match,
70+
f.Language,
71+
f.FileType,
72+
f.Purpose,
73+
f.Description,
74+
f.Remediation,
75+
f.Impact,
76+
f.Effort,
77+
strings.Join(f.Tags, "; "),
78+
strconv.Itoa(f.Priority()),
79+
}
80+
if err := w.Write(row); err != nil {
81+
return "", err
82+
}
83+
}
84+
85+
w.Flush()
86+
if err := w.Error(); err != nil {
87+
return "", err
88+
}
89+
90+
return b.String(), nil
91+
}
92+
93+
// intToStr converts int to string, returning empty string for zero
94+
func intToStr(n int) string {
95+
if n == 0 {
96+
return ""
97+
}
98+
return strconv.Itoa(n)
99+
}

0 commit comments

Comments
 (0)