-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Linux AMD64-specific package (#28)
* Add Linux AMD64-specific package Signed-off-by: Satwik Sai Prakash Sahoo <[email protected]> * feat(build): Optimize build script for Linux AMD64 - Added dynamic handling for Trivy and Osquery plugins with validation for existing binaries. - Integrated Dosai binary download and checksum generation. - Improved error handling and added compression for binaries using UPX. - Included warnings for missing source files in plugin directories. Signed-off-by: Satwik Sai Prakash Sahoo <[email protected]> --------- Signed-off-by: Satwik Sai Prakash Sahoo <[email protected]>
- Loading branch information
Showing
10 changed files
with
120 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
set -e # Exit on error | ||
|
||
echo "Building Linux AMD64 package..." | ||
|
||
# Remove old plugin directories to ensure a clean build | ||
rm -rf plugins/trivy plugins/osquery plugins/dosai | ||
mkdir -p plugins/trivy plugins/osquery plugins/dosai | ||
|
||
# Download the Dosai binary | ||
curl -L https://github.com/owasp-dep-scan/dosai/releases/latest/download/Dosai-linux-amd64 -o plugins/dosai/dosai-linux-amd64 | ||
chmod +x plugins/dosai/dosai-linux-amd64 | ||
sha256sum plugins/dosai/dosai-linux-amd64 > plugins/dosai/dosai-linux-amd64.sha256 | ||
|
||
# Handle additional plugins: Trivy and Osquery | ||
for plug in trivy osquery; do | ||
mkdir -p plugins/$plug | ||
# Check if the source plugin directory exists and is not empty | ||
if [ -d "../../plugins/$plug" ] && [ "$(ls -A ../../plugins/$plug/*linux-amd64* 2>/dev/null)" ]; then | ||
cp ../../plugins/$plug/*linux-amd64* plugins/$plug/ | ||
upx -9 --lzma plugins/$plug/*linux-amd64* || true # Compress files if possible | ||
else | ||
echo "Warning: No files found for $plug in ../../plugins/$plug/" | ||
fi | ||
done | ||
|
||
# Final output message | ||
echo "Linux AMD64 build completed successfully!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('Linux AMD64 package initialized.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "@cyclonedx/cdxgen-plugins-bin-linux-amd64", | ||
"version": "1.0.0", | ||
"description": "CycloneDX plugins binary for Linux AMD64", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "./build-linux-amd64.sh" | ||
}, | ||
"keywords": [ | ||
"CycloneDX", | ||
"plugins", | ||
"linux", | ||
"amd64" | ||
], | ||
"license": "MIT" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
goversion/ | ||
trivy/ | ||
cargo-auditable/ | ||
osquery/ | ||
dosai/ | ||
sourcekitten/ |
Empty file.
Empty file.