A Go application that generates Software Bill of Materials (SBOM) for your Maven projects and scans for security vulnerabilities.
- Generate Maven dependency tree
- Create effective POM
- Generate SBOM in CycloneDX format
- Security vulnerability scanning with OSV Scanner
- Detailed reporting with JSON output support
- Go 1.21.3 or higher
- Maven 3.x
- OSV Scanner
- Clone the repository:
git clone https://github.com/yourusername/sbom-scanner.git
cd sbom-scanner
- Install dependencies:
go mod download
- Build the application:
go build -o sbom-scanner
./sbom-scanner -f /path/to/pom.xml -o output/dir --exit-on-vuln=false
-f, --file
: Path to Maven POM file (required)-o, --output
: Output directory (required)--exit-on-vuln
: Exit program when vulnerability is found (default: false)
The program generates the following files:
deps-tree.txt
: Maven dependency treeeffective-pom.xml
: Effective POM filesbom.xml
: SBOM in CycloneDX formatsbom-vulnerabilities.json
: OSV Scanner security report
- Basic scan:
./sbom-scanner -f pom.xml -o output
- With vulnerability check:
./sbom-scanner -f pom.xml -o output --exit-on-vuln=true
.
├── main.go # Main application code
├── go.mod # Go module definition
├── go.sum # Dependency checksums
- Follows Go standard code formatting
- Uses custom error types for error handling
- Includes comprehensive logging
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'feat: add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Please report issues via GitHub Issues.