
JSON, XML, Protobuf, CSV और SPDX प्रारूपों में CycloneDX SBOMs उत्पन्न करने, विश्लेषण करने, विलय करने, तुलना करने, सत्यापित करने, हस्ताक्षर करने और परिवर्तित करने के लिए CLI।
______ __ ____ _ __ ________ ____
/ ____/_ _______/ /___ ____ ___ / __ \ |/ / / ____/ / / _/
/ / / / / / ___/ / __ \/ __ \/ _ \/ / / / / / / / / / /
/ /___/ /_/ / /__/ / /_/ / / / / __/ /_/ / | / /___/ /____/ /
\____/\__, /\___/_/\____/_/ /_/\___/_____/_/|_| \____/_____/___/
/____/
Usage:
cyclonedx [command] [options]
Options:
--version Show version information
-?, -h, --help Show help and usage information
Commands:
add Add information to a BOM (currently supports files)
analyze Analyze a BOM file
convert Convert between different BOM formats
diff <from-file> <to-file> Generate a BOM diff
keygen Generates an RSA public/private key pair for BOM signing
merge Merge two or more BOMs
sign Sign a BOM or file
validate Validate a BOM
verify Verify signatures in a BOM
CycloneDX CLI उपकरण वर्तमान में BOM विश्लेषण, संशोधन, डिफिंग, विलय, प्रारूप रूपांतरण, हस्ताक्षर करना और सत्यापन का समर्थन करता है।
CycloneDX XML, JSON, Protobuf, CSV, और SPDX JSON v2.3 के बीच रूपांतरण समर्थित है।
बाइनरी रिलीज़ पृष्ठ से डाउनलोड की जा सकती हैं।
नोट: CycloneDX CLI उपकरण स्वचालन उपयोग मामलों के लिए बनाया गया है। जिन कमांडों में --input-file विकल्प होता है वे stdin से इनपुट देने का भी समर्थन करते हैं। इसी तरह, जिन कमांडों में --output-file विकल्प होता है वे stdout पर आउटपुट का समर्थन करते हैं। हालाँकि, आपको इनपुट/आउटपुट प्रारूप प्रदान करने होंगे।
उदाहरण के लिए:
cat bom.json | cyclonedx-cli convert --input-format json --output-format xml > bom.xml
files
Add files to a BOM
Usage:
cyclonedx add files [options]
Options:
--input-file <input-file> Input BOM filename.
--no-input Use this option to indicate that there is no input BOM.
--output-file <output-file> Output BOM filename, will write to stdout if no value provided.
--input-format <autodetect|json|protobuf|xml> Specify input file format.
--output-format <autodetect|json|protobuf|xml> Specify output file format.
--base-path <base-path> Base path for directory to process (defaults to current working directory if omitted).
--include <include> Apache Ant style path and file patterns to specify what to include (defaults to all files, separate patterns with a space).
--exclude <exclude> Apache Ant style path and file patterns to specify what to exclude (defaults to none, separate patterns with a space).
Git रिपॉज़िटरी निर्देशिका को छोड़कर, स्रोत कोड BOM उत्पन्न करना:
cyclonedx-cli add files --no-input --output-format json --exclude /.git/**
मौजूदा BOM में, bin निर्देशिका से बिल्ड आउटपुट फ़ाइलें जोड़ना:
cyclonedx-cli add files --input-file bom.json --output-format json --base-path bin
analyze
Analyze a BOM file
Usage:
cyclonedx analyze [options]
Options:
--input-file <input-file> Input BOM filename, will read from stdin if no value provided.
--input-format <autodetect|json|protobuf|xml> Specify input file format.
--output-format <json|text> Specify output format (defaults to text).
--multiple-component-versions Report components that have multiple versions in use.
विभिन्न संस्करणों के साथ कई बार शामिल किए गए घटकों पर रिपोर्ट करना:
cyclonedx-cli analyze --input-file sbom.xml --multiple-component-versions
convert
Convert between different BOM formats
Usage:
cyclonedx convert [options]
Options:
--input-file <input-file> Input BOM filename, will read from stdin if no value provided.
--output-file <output-file> Output BOM filename, will write to stdout if no value provided.
--input-format <autodetect|csv|json|protobuf|spdxjson|xml> Specify input file format.
--output-format <autodetect|csv|json|protobuf|spdxjson|xml> Specify output file format.
--output-version <v1_0|v1_1|v1_2|v1_3|v1_4|v1_5|v1_6|v1_7> Specify output BOM specification version. (ignored for CSV and SPDX formats)
XML से JSON प्रारूप में रूपांतरण करना:
cyclonedx-cli convert --input-file sbom.xml --output-file sbom.json
XML से JSON प्रारूप में रूपांतरण करना और आउटपुट को अतिरिक्त उपकरणों में पाइप करना:
cyclonedx-cli convert --input-file sbom.xml --output-format json | grep "somthing"
CSV प्रारूप BOM में घटकों की सूची का एक सीमित प्रतिनिधित्व है।
इसका उद्देश्य उपयोगकर्ताओं को सरल उपयोग मामलों के लिए BOM बनाने और उपभोग करने का एक सरल तरीका प्रदान करना है। सरल डेटा माइग्रेशन उपयोग मामलों सहित।
केवल आवश्यक फ़ील्ड घटक name और version फ़ील्ड हैं। अन्य को खाली छोड़ा जा सकता है या कॉलम हटाए जा सकते हैं।
SPDX और CycloneDX प्रारूपों के बीच रूपांतरण के परिणामस्वरूप कुछ जानकारी नष्ट हो सकती है। रूपांतरण कार्यक्षमता CycloneDX.Spdx.Interop लाइब्रेरी द्वारा प्रदान की जाती है, जो CycloneDX .NET लाइब्रेरी परियोजना का हिस्सा है।
कौन सी जानकारी नष्ट होती है इसके अधिक विवरण के लिए CycloneDX .NET Library परियोजना पृष्ठ देखें।
diff
Generate a BOM diff
Usage:
cyclonedx diff <from-file> <to-file> [options]
Arguments:
<from-file> From BOM filename.
<to-file> To BOM filename.
Options:
--from-format <autodetect|json|protobuf|xml> Specify from file format.
--to-format <autodetect|json|protobuf|xml> Specify to file format.
--output-format <json|text> Specify output format (defaults to text).
--component-versions Report component versions that have been added, removed or modified.
संस्करण परिवर्तन वाले घटकों पर रिपोर्ट करना:
cyclonedx-cli diff sbom-from.xml sbom-to.xml --component-versions
keygen
Generates an RSA public/private key pair for BOM signing
Usage:
cyclonedx keygen [options]
Options:
--private-key-file <private-key-file> Filename for generated private key file (defaults to "private.key")
--public-key-file <public-key-file> Filename for generated public key file (defaults to "public.key")
merge
Merge two or more BOMs
Usage:
cyclonedx merge [options]
Options:
--input-files <input-files> Input BOM filenames (separate filenames with a space).
--output-file <output-file> Output BOM filename, will write to stdout if no value provided.
--input-format <autodetect|json|protobuf|xml> Specify input file format.
--output-format <autodetect|json|protobuf|xml> Specify output file format.
--output-version <v1_0|v1_1|v1_2|v1_3|v1_4|v1_5|v1_6|v1_7> Specify output BOM specification version.
--hierarchical Perform a hierarchical merge.
--group <group> Provide the group of software the merged BOM describes.
--name <name> Provide the name of software the merged BOM describes (required for hierarchical merging).
--version <version> Provide the version of software the merged BOM describes (required for hierarchical merging).
नोट: पदानुक्रमित विलय करने के लिए सभी BOM में मेटाडेटा घटक तत्व में BOM के विषय का वर्णन होना आवश्यक है।
दो XML प्रारूप वाले BOM विलीन करें:
cyclonedx-cli merge --input-files sbom1.xml sbom2.xml --output-file sbom_all.xml
दो BOM विलीन करना और आउटपुट को अतिरिक्त उपकरणों में पाइप करना:
cyclonedx-cli merge --input-files sbom1.xml sbom2.xml --output-format json | grep "something"
किसी BOM या फ़ाइल पर हस्ताक्षर करें
bom
Sign the entire BOM document
Usage:
cyclonedx sign bom <bom-file> [options]
Arguments:
<bom-file> BOM filename
Options:
--key-file <key-file> Signing key filename (RSA private key in PEM format, defaults to "private.key")
file
Sign arbitrary files and generate a PKCS1 RSA SHA256 signature file
Usage:
cyclonedx sign file <file> [options]
Arguments:
<file> Filename of the file the signature will be created for
Options:
--key-file <key-file> Signing key filename (RSA private key in PEM format, defaults to "private.key")
--signature-file <signature-file> Filename of the generated signature file (defaults to the filename with ".sig" appended)
validate
Validate a BOM
Usage:
cyclonedx validate [options]
Options:
--input-file <input-file> Input BOM filename, will read from stdin if no value provided.
--input-format <autodetect|json|xml> Specify input file format.
--input-version <v1_0|v1_1|v1_2|v1_3|v1_4|v1_5|v1_6|v1_7> Specify input file specification version (defaults to v1.7)
--fail-on-errors Fail on validation errors (return a non-zero exit code)
BOM सत्यापित करें और गैर-शून्य निकास कोड लौटाएं (बिल्ड को स्वचालित रूप से "तोड़ने" आदि के लिए उपयोगी)
cyclonedx-cli validate --input-file sbom.xml --fail-on-errors
BOM और फ़ाइलों के हस्ताक्षर सत्यापित करें
all
Verify all signatures in a BOM
Usage:
cyclonedx verify all <bom-file> [options]
Arguments:
<bom-file> BOM filename
Options:
--key-file <key-file> Public key filename (RSA public key in PEM format, defaults to "public.key")
file
Verifies a PKCS1 RSA SHA256 signature file for an arbitrary file
Usage:
cyclonedx verify file <file> [options]
Arguments:
<file> File the signature file is for
Options:
--key-file <key-file> Public key filename (RSA public key in PEM format, defaults to "public.key")
--signature-file <signature-file> Signature file to be verified (defaults to the filename with ".sig" appended)
CycloneDX CLI उपकरण को docker का उपयोग करके भी चलाया जा सकता है docker run cyclonedx/cyclonedx-cli।
Linux और MacOS के लिए, CLI को CycloneDX Homebrew tap के माध्यम से स्थापित किया जा सकता है:
brew install cyclonedx/cyclonedx/cyclonedx-cli
इन प्लेटफ़ॉर्म के लिए आधिकारिक रूप से समर्थित बिल्ड उपलब्ध हैं:
इन प्लेटफ़ॉर्म के लिए सामुदायिक समर्थित बिल्ड उपलब्ध हैं:
.NET Core रनटाइम निर्भरताएँ आवश्यक हैं।
Windows के लिए ये पहले से स्थापित होनी चाहिए।
Ubuntu के लिए ये हैं libc6 libgcc1 libgssapi-krb5-2 libicu66 libssl1.1 libstdc++6 zlib1g।
gron JSON को अलग-अलग असाइनमेंट में बदलता है ताकि आप जो चाहते हैं उसे grep करना और उसका पूर्ण 'पथ' देखना आसान हो जाए।
सुविधा के लिए, gron CycloneDX CLI Docker इमेज में शामिल है।
उदाहरण उपयोग जो सभी घटक नामों और संस्करणों की सूची बनाता है
$ gron bom-1.2.json | grep -E "(components\[[[:digit:]]*\].name)|(components\[[[:digit:]]*\].version)"
json.components[0].name = "tomcat-catalina";
json.components[0].version = "9.0.14";
json.components[1].name = "mylibrary";
json.components[1].version = "1.0.0";
या XML प्रारूप BOM का उपयोग करके वही
$ cyclonedx convert --input-file bom.xml --output-format json | gron | grep -E "(components\[[[:digit:]]*\].name)|(components\[[[:digit:]]*\].version)"
json.components[0].name = "tomcat-catalina";
json.components[0].version = "9.0.14";
json.components[1].name = "mylibrary";
json.components[1].version = "1.0.0";
gron उपयोग के अधिक विवरण के लिए gron परियोजना पृष्ठ देखें।
grep उपयोग के अधिक विवरण के लिए grep मैन पेज देखें।
Apache 2.0 लाइसेंस की शर्तों के तहत संशोधित और पुनर्वितरित करने की अनुमति दी गई है। पूर्ण लाइसेंस के लिए LICENSE फ़ाइल देखें।
पुल रिक्वेस्ट का स्वागत है। लेकिन कृपया पहले CycloneDX योगदान दिशानिर्देश पढ़ें।
समाधान को स्थानीय रूप से बनाने और परीक्षण करने के लिए आपके पास .NET 8 स्थापित होना चाहिए। dotnet build और dotnet test जैसे मानक कमांड काम करते हैं।
आम तौर पर अपेक्षा की जाती है कि पुल रिक्वेस्ट में प्रासंगिक परीक्षण शामिल होंगे। प्रत्येक पुल रिक्वेस्ट के लिए परीक्षण स्वचालित रूप से Windows, MacOS और Linux पर चलाए जाते हैं। बिल्ड चेतावनियाँ बिल्ड को तोड़ देंगी।
यदि आपको किसी ऐसे प्लेटफ़ॉर्म के लिए विफल हो रहे परीक्षण को डीबग करने में परेशानी हो रही है जिसकी आपके पास पहुँच नहीं है, तो कृपया हमें बताएं।