mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-27 10:14:01 -04:00
Fix verbiage in website
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
description: |
|
||||
The `hcp-sbom` Packer provisioner downloads the SBOM file from remote and
|
||||
sends to HCP Packer when build is done.
|
||||
The `hcp-sbom` Packer provisioner downloads an SBOM file from the guest VM and
|
||||
sends it to HCP Packer when the build is done.
|
||||
page_title: HCP SBOM - Provisioners
|
||||
---
|
||||
|
||||
@@ -13,32 +13,18 @@ page_title: HCP SBOM - Provisioners
|
||||
|
||||
Type: `hcp-sbom`
|
||||
|
||||
The `hcp-sbom` Packer provisioner downloads the SBOM file from the remote machine
|
||||
The `hcp-sbom` Packer provisioner downloads an SBOM file from the guest machine
|
||||
and sends it to HCP Packer when the build is complete (only if the template is
|
||||
HCP-enabled). The SBOM file is automatically removed at the end of the process.
|
||||
If the user wants to retain a copy of the SBOM file, they should specify the
|
||||
`destination` field in the provisioner.
|
||||
If you want to retain a copy of the SBOM file, you can specify the
|
||||
`destination` option in the provisioner.
|
||||
|
||||
Currently, we support `CycloneDX` and `SPDX` SBOM formats in `JSON`.
|
||||
|
||||
TBA: Add more details about max number of files allowed to download, and
|
||||
if we are going to add the file name field.
|
||||
|
||||
## Basic Example
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="JSON">
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "hcp-sbom",
|
||||
"source": "/tmp/sbom_cyclonedx.json",
|
||||
"destination": "./sbom/sbom_cyclonedx.json"
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
|
||||
<Tab heading="HCL2">
|
||||
In HCL2:
|
||||
|
||||
```hcl
|
||||
provisioner "hcp-sbom" {
|
||||
@@ -47,8 +33,17 @@ provisioner "hcp-sbom" {
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
In JSON:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "hcp-sbom",
|
||||
"source": "/tmp/sbom_cyclonedx.json",
|
||||
"destination": "./sbom/sbom_cyclonedx.json"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Configuration Reference
|
||||
|
||||
@@ -62,50 +57,8 @@ Optional Parameters:
|
||||
|
||||
## Example Usage
|
||||
|
||||
<Tabs>
|
||||
<Tab heading="JSON">
|
||||
|
||||
```json
|
||||
{
|
||||
"builders": [
|
||||
{
|
||||
"type": "docker",
|
||||
"image": "ubuntu:20.04",
|
||||
"commit": true
|
||||
}
|
||||
],
|
||||
"provisioners": [
|
||||
{
|
||||
"type": "shell",
|
||||
"inline": [
|
||||
"apt-get update -y",
|
||||
"apt-get install -y curl",
|
||||
"bash -c \"$(curl -sSL https://install.mondoo.com/sh)\""
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
"inline": [
|
||||
"cnquery sbom --output cyclonedx-json --output-target /tmp/sbom_cyclonedx.json",
|
||||
"cnquery sbom --output spdx-json --output-target /tmp/sbom_spdx.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "hcp-sbom",
|
||||
"source": "/tmp/sbom_cyclonedx.json",
|
||||
"destination": "./sbom"
|
||||
},
|
||||
{
|
||||
"type": "hcp-sbom",
|
||||
"source": "/tmp/sbom_spdx.json",
|
||||
"destination": "./sbom/sbom_spdx.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</Tab>
|
||||
|
||||
<Tab heading="HCL2">
|
||||
In HCL2:
|
||||
|
||||
```hcl
|
||||
packer {
|
||||
@@ -134,14 +87,8 @@ build {
|
||||
inline = [
|
||||
"apt-get update -y",
|
||||
"apt-get install -y curl gpg",
|
||||
"bash -c \"$(curl -sSL https://install.mondoo.com/sh)\""
|
||||
]
|
||||
}
|
||||
|
||||
provisioner "shell" {
|
||||
inline = [
|
||||
"bash -c \"$(curl -sSL https://install.mondoo.com/sh)\"",
|
||||
"cnquery sbom --output cyclonedx-json --output-target /tmp/sbom_cyclonedx.json",
|
||||
"cnquery sbom --output spdx-json --output-target /tmp/sbom_spdx.json",
|
||||
]
|
||||
}
|
||||
|
||||
@@ -149,13 +96,35 @@ build {
|
||||
source = "/tmp/sbom_cyclonedx.json"
|
||||
destination = "./sbom"
|
||||
}
|
||||
|
||||
provisioner "hcp-sbom" {
|
||||
source = "/tmp/sbom_spdx.json"
|
||||
destination = "./sbom/sbom_spdx.json"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
In JSON:
|
||||
|
||||
```json
|
||||
{
|
||||
"builders": [
|
||||
{
|
||||
"type": "docker",
|
||||
"image": "ubuntu:20.04",
|
||||
"commit": true
|
||||
}
|
||||
],
|
||||
"provisioners": [
|
||||
{
|
||||
"type": "shell",
|
||||
"inline": [
|
||||
"apt-get update -y",
|
||||
"apt-get install -y curl",
|
||||
"bash -c \"$(curl -sSL https://install.mondoo.com/sh)\"",
|
||||
"cnquery sbom --output cyclonedx-json --output-target /tmp/sbom_cyclonedx.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "hcp-sbom",
|
||||
"source": "/tmp/sbom_cyclonedx.json",
|
||||
"destination": "./sbom"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user