-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: populate metadata.component.externalReferences
VCS and build-system from common CI environment variables
#1344
Comments
…stem from common CI environment variables resolves CycloneDX#1344 Signed-off-by: Jeremy Long <jeremy.long@gmail.com>
Regarding the proposed implementation: Furthermore, I don't like the shell-out to For both cases, I'd rather go with the alternative you've proposed:
for each, this could be a config setting ( PS: after thinking about this for a while, I actually do not see any reason to have these settings manipulable via an environment variable. The VCS and build-env should be known way before the actual build starts, and therefore it should be enough to configure them in a plugin. Would you agree? |
I do have questions regarding the applied use case, still. The current implementation is able to gather information from package manifests. Currently, there is support for parsing Do you maintain a package manifest for the thing you are building?
|
this feature might be related to the propposal here: #675 |
@jeremylong thank you for this. What are your thoughts on including this information in the formulation section of the BOM? The formulation section could be utilised to describe how a component was manufactured. This could be achieved by leveraging formulas, workflows, tasks, and steps that outline the exact process for reproduction, alongside the observed formulas detailing the steps taken during the manufacturing process. More information : https://cyclonedx.org/docs/1.6/json/#formulation |
@VinodAnandan I don't see how something that would be a small part of the formulation (i.e., the webpack plugin itself) could reasonably produce the formulation SBOM. The formulation can cover the build server, all plugins installed on the build server, the build tool (e.g., maven, Gradle, npm), etc. |
@jkowalleck regarding:
While the VCS would be known ahead of time, the build server would be known at build time. I have build servers for dev and uat (e.g. these are staging and testing for the build system itself and these should never produce a production artifact). As such, I want the actual build server that built the artifact listed to ensure something isn't messed up. Providing a configuration option to set the VCS and build-system would be a good approach for my use case. I could work with your proposed |
# file: webpack.config.js
const { CycloneDxWebpackPlugin } = require('@cyclonedx/webpack-plugin')
const cycloneDxWebpackPluginOptions = {
rootComponentAutodetect: true,
rootComponentType: 'application',
rootComponentBuildSystem: process.env.MY_BUILDENV_URL
}
module.exports = {
target: 'web',
mode: 'production',
entry: './src/index.js',
plugins: [
new CycloneDxWebpackPlugin(cycloneDxWebpackPluginOptions)
],
stats: 'detailed'
} |
I disagree - I think a configurable option should still be available for |
So you tell me there might be a fork out there, that has a unmaintained package manifest, but the build pipeline of that specific fork is properly maintained? This whole SBOM generator is about the ability to produce accurate data. And the capability to do so already exists. No option for |
happens all the time when you fork public GH to GHE. If I want to build the package myself as part of a BYOB (Build your own Binary) program. I might not update the manifest files, but I would have a proper build that knows the internal GHE VCS. |
Is your feature request related to a problem? Please describe.
To improve traceability of a given SBOM, it would be fantastic if the
metadata.component.externalReferences
were populated for thevcs
andbuild-system
URLs. These can be obtained via well-known environment variables in many CI systems.Describe the solution you'd like
The
_helper.ts
could be extended with code to detect the build-system and VCS from common CI environment variables:...
Then
plugin.ts#makeRootComponent
could be updated to end with the following instead of justreturn builder.makeComponent(thisPackageJson)
:Describe alternatives you've considered
An alternative would be to allow these values to be specified as configuration options.
Additional context
git
: feat: add git external reference. cyclonedx-gradle-plugin#520I'm more than happy to put in a PR with these changes - but I know the code is in flux with the pending 4.0.0 release and some of this may change when the project upgrades to the cyclonedx-library@7.0.0.
The text was updated successfully, but these errors were encountered: