Skip to content

Commit 6b08a5e

Browse files
authored
added note on java compilation and dependency resolution (#75)
Signed-off-by: san-zrl <san@zurich.ibm.com>
1 parent 8bc9a59 commit 6b08a5e

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

README.md

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,29 +41,35 @@ jobs:
4141
path: ${{ steps.cbom.outputs.pattern }}
4242
if-no-files-found: warn
4343
```
44+
45+
[!NOTE]
46+
For java repositories, the precision and the quality of generated CBOM depends on the scanner's ability
47+
to resolve symbols defined in the dependencies. We therefore recommend to build all java code prior to scanning
48+
as shown in above example. `cbomkit-action` auto-constructs a list of directories used by the scanner to search for java dependencies (jar/zip files). By default, this list contains the project directory (cloning target) and the maven/gradle default repository path. The scanning option `CBOMKIT_JAVA_JAR_DIR` allows to append an additional path expression to the default list. This expression may contain wildcards (`*`) to denote arbitrary directories.
49+
4450
### Parameters
4551

4652
CBOMkit-action requires the following parameters passed as enviroment variables. If run in a workflow, these variables are automatically set by the checkout step.
4753

48-
- GITHUB_WORKSPACE: Mandotory root directory of the cloned repository.
49-
- GITHUB_OUTPUT: Mandatory filename containing the name pattern of the CBOM files used by uploader.
50-
- GITHUB_SERVER_URL: (Optional) Github server url. Will be used to set the gitUrl property in the CBOM metadata which is used by CBOMkit viewer.
51-
- GITHUB_REPOSITORY: (Optional) Github repository name. Will be used to set the
54+
- `GITHUB_WORKSPACE`: Mandotory root directory of the cloned repository.
55+
- `GITHUB_OUTPUT`: Mandatory filename containing the name pattern of the CBOM files used by uploader.
56+
- `GITHUB_SERVER_URL`: (Optional) Github server url. Will be used to set the gitUrl property in the CBOM metadata which is used by CBOMkit viewer.
57+
- `GITHUB_REPOSITORY`: (Optional) Github repository name. Will be used to set the
5258
gitUrl property in the CBOM metadata which is used by CBOMkit viewer. gitUrl metadata property = GITHUB_SERVER_URL + "/" + GITHUB_REPOSITORY.
53-
- GITHUB_REF_NAME: (Optional) Github ref name. Will be used to set the revision (branch) property in the CBOM metadata which is used by CBOMkit viewer.
54-
- GITHUB_SHA: (Optional) Github commit SHA value. The first 7 characters will be used to set the commit property in the CBON metadata which is used by CBOMkit viewer.
59+
- `GITHUB_REF_NAME`: (Optional) Github ref name. Will be used to set the revision (branch) property in the CBOM metadata which is used by CBOMkit viewer.
60+
- `GITHUB_SHA`: (Optional) Github commit SHA value. The first 7 characters will be used to set the commit property in the CBON metadata which is used by CBOMkit viewer.
5561

5662
### Scanning Options
5763

5864
CBOMkit-action's behavior can be controlled via the following additional environment variables.
5965

60-
- CBOMKIT_OUTPUT_DIR: (Optional) Output directory for CBOM files. Defaults to "cbom" if not set.
61-
- CBOMKIT_EXCLUDE: (Optional) Comma-separated list of java regex patterns. Matches the first occurrence of a pattern in source file/dir paths relative to the GITHUB_WORKSPACE. Files/dirs are excluded from scanning if any of the patterns match. By default, CBOMKit excludes test files from scanning. Setting CBOKKIT_EXCLUDE overrules this default. Setting CBOMKIT_EXCLUDE to an empty string turns off exclusion resulting in a complete scan of all source files.
62-
- CBOMKIT_LANGUAGES: (Optional) Comma-separated list of programming languages to scan. White-space will be ignored. If set, only specified programming languages will be scanned. Since CBOMkit currently supports Java and Python, only `java` or `python` are plausible values.
63-
- CBOMKIT_GENERATE_MODULE_CBOMS: (Optional) Generate CBOMs for project modules. Default value is `true`.
64-
= CBOMKIT_WRITE_EMTPY_CBOMS: (Optional) Also write CBOMs with 0 findings. Default value is `true`.
65-
- CBOMKIT_JAVA_REQUIRE_BUILD: (Optional) Java scans will terminate with an error if java files were found **and** the repo was not built prior to scanning. Default value is `true`. Setting it to `false` allows source-only scans of java repos with potentially lower accuracy.
66-
- CBOMKIT_JAVA_JAR_DIR: (Optional) CBOMkit-action auto-constructs a list of jar/zip files to be considered for scanning. This option allows the specification of an additional directory for jar/zip files specific to the crypto library.
66+
- `CBOMKIT_OUTPUT_DIR`: (Optional) Output directory for CBOM files. Defaults to "cbom" if not set.
67+
- `CBOMKIT_EXCLUDE`: (Optional) Comma-separated list of java regex patterns. Matches the first occurrence of a pattern in source file/dir paths relative to the GITHUB_WORKSPACE. Files/dirs are excluded from scanning if any of the patterns match. By default, CBOMKit excludes test files from scanning. Setting CBOKKIT_EXCLUDE overrules this default. Setting CBOMKIT_EXCLUDE to an empty string turns off exclusion resulting in a complete scan of all source files.
68+
- `CBOMKIT_LANGUAGES`: (Optional) Comma-separated list of programming languages to scan. White-space will be ignored. If set, only specified programming languages will be scanned. Since CBOMkit currently supports Java and Python, only `java` or `python` are plausible values.
69+
- `CBOMKIT_GENERATE_MODULE_CBOMS`: (Optional) Generate CBOMs for project modules. Default value is `true`.
70+
- `CBOMKIT_WRITE_EMTPY_CBOMS`: (Optional) Also write CBOMs with 0 findings. Default value is `true`.
71+
- `CBOMKIT_JAVA_REQUIRE_BUILD`: (Optional) Java scans will terminate with an error if java files were found **and** the repo was not built prior to scanning. Default value is `true`. Setting it to `false` allows source-only scans of java repos with potentially lower accuracy.
72+
- `CBOMKIT_JAVA_JAR_DIR`: (Optional) CBOMkit-action auto-constructs a list of jar/zip files to be considered for scanning. This option allows the specification of an additional directory for jar/zip files specific to the crypto library.
6773

6874
## Supported languages and libraries
6975

0 commit comments

Comments
 (0)