Skip to content

Commit 07f94f4

Browse files
committed
Updated documentation & build process
1 parent 9385db7 commit 07f94f4

12 files changed

+437
-62098
lines changed

.classpath

-32
This file was deleted.

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ rebel.xml
1313
.settings/
1414
bin/
1515
lombok.config
16+
.classpath
17+
.project
18+
*.fpr

.project

-23
This file was deleted.

LICENSE.TXT

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The MIT License (MIT)
2-
(c) Copyright 2017 EntIT Software LLC, a Micro Focus company
2+
(c) Copyright 2020 Micro Focus or one of its affiliates, a Micro Focus company
33

44
Permission is hereby granted, free of charge, to any person obtaining a
55
copy of this software and associated documentation files (the

README.md

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# Fortify SSC Parser Plugin for OWASP Dependency Check
2+
3+
This Fortify SSC parser plugin allows for importing scan results from OWASP Dependency Check.
4+
5+
### <a name="related-links">Related Links</a>
6+
7+
* **Downloads**:
8+
_Beta versions may be unstable or non-functional. The `*-licenseReport.zip` and `*-dependencySources.zip` files are for informational purposes only and do not need to be downloaded._
9+
* **Release versions**: https://bintray.com/package/files/fortify-ps/binaries/fortify-ssc-parser-owasp-dependency-check-release?order=desc&sort=fileLastModified&basePath=&tab=files
10+
* **Beta versions**: https://bintray.com/package/files/fortify-ps/binaries/fortify-ssc-parser-owasp-dependency-check-beta?order=desc&sort=fileLastModified&basePath=&tab=files
11+
* **Sample input files**: [sampleData](sampleData)
12+
* **GitHub**: https://github.com/fortify-ps/fortify-ssc-parser-owasp-dependency-check
13+
* **Automated builds**: https://travis-ci.com/fortify-ps/fortify-ssc-parser-owasp-dependency-check
14+
* **OWASP Dependency Check website**: https://owasp.org/www-project-dependency-check/
15+
16+
17+
## <a name="usage">Usage</a>
18+
19+
The following sections describe how to install and use the plugin. For generic information
20+
about how to install and use SSC parser plugins, please see the Fortify SSC documentation.
21+
22+
### <a name="plugin-install--upgrade">Plugin Install & Upgrade</a>
23+
24+
* Obtain the plugin binary jar file
25+
* Either download from Bintray (see [Related Links](#related-links))
26+
* Or by building yourself (see [Information for plugin developers](#information-for-plugin-developers))
27+
* If you already have another version of the plugin installed, first uninstall the plugin by following the steps in [Plugin Uninstall](#plugin-uninstall)
28+
* In Fortify Software Security Center:
29+
* Navigate to Administration->Plugins->Parsers
30+
* Click the `NEW` button
31+
* Accept the warning
32+
* Upload the plugin jar file
33+
* Enable the plugin by clicking the `ENABLE` button
34+
35+
### <a name="plugin-uninstall">Plugin Uninstall</a>
36+
37+
* In Fortify Software Security Center:
38+
* Navigate to Administration->Plugins->Parsers
39+
* Select the parser plugin that you want to uninstall
40+
* Click the `DISABLE` button
41+
* Click the `REMOVE` button
42+
43+
### <a name="obtain-results">Obtain results</a>
44+
45+
Please see the OWASP Dependency Check documentation for details on scanning applications and
46+
generating reports. Note that the SSC parser plugin requires the uploaded reports to be in JSON
47+
format.
48+
49+
### <a name="upload-results">Upload results</a>
50+
51+
SSC web interface (manual upload):
52+
53+
* Navigate to the Artifacts tab of your application version
54+
* Click the `UPLOAD` button
55+
* Click the `ADD FILES` button, and select the JSON file to upload
56+
* Enable the `3rd party results` check box
57+
* Select the `OWASP_DEPCHECK` type
58+
59+
SSC clients (FortifyClient, Maven plugin, ...):
60+
61+
* Generate a scan.info file containing a single line as follows:
62+
`engineType=OWASP_DEPCHECK`
63+
* Generate a zip file containing the following:
64+
* The scan.info file generated in the previous step
65+
* The JSON file containing scan results
66+
* Upload the zip file generated in the previous step to SSC
67+
* Using any SSC client, for example FortifyClient
68+
* Similar to how you would upload an FPR file
69+
70+
71+
72+
## <a name="information-for-plugin-developers">Information for plugin developers</a>
73+
74+
The following sections provide information that may be useful for developers of this
75+
parser plugin.
76+
77+
### <a name="ides">IDE's</a>
78+
79+
This project uses Lombok. In order to have your IDE compile this project without errors,
80+
you may need to add Lombok support to your IDE. Please see https://projectlombok.org/setup/overview
81+
for more information.
82+
83+
### <a name="gradle">Gradle</a>
84+
85+
It is strongly recommended to build this project using the included Gradle Wrapper
86+
scripts; using other Gradle versions may result in build errors and other issues.
87+
88+
The Gradle build uses various helper scripts from https://github.com/fortify-ps/gradle-helpers;
89+
please refer to the documentation and comments in included scripts for more information.
90+
91+
### <a name="commonly-used-commands">Commonly used commands</a>
92+
93+
All commands listed below use Linux/bash notation; adjust accordingly if you
94+
are running on a different platform. All commands are to be executed from
95+
the main project directory.
96+
97+
* `./gradlew tasks --all`: List all available tasks
98+
* Build: (plugin binary will be stored in `build/libs`)
99+
* `./gradlew clean build`: Clean and build the project
100+
* `./gradlew build`: Build the project without cleaning
101+
* `./gradlew dist`: Build distribution zip
102+
* Version management:
103+
* `./gradlew printProjectVersion`: Print the current version
104+
* `./gradlew startSnapshotBranch -PnextVersion=2.0`: Start a new snapshot branch for an upcoming `2.0` version
105+
* `./gradlew releaseSnapshot`: Merge the changes from the current branch to the master branch, and create release tag
106+
* `./fortify-scan.sh`: Run a Fortify scan; requires Fortify SCA to be installed
107+
108+
Note that the version management tasks operate only on the local repository; you will need to manually
109+
push any changes (including tags and branches) to the remote repository.
110+
111+
### <a name="versioning">Versioning</a>
112+
113+
The various version-related Gradle tasks assume the following versioning methodology:
114+
115+
* The `master` branch is only used for creating tagged release versions
116+
* A branch named `<version>-SNAPSHOT` contains the current snapshot state for the upcoming release
117+
* Optionally, other branches can be used to develop individual features, perform bug fixes, ...
118+
* However, note that the Gradle build may be unable to identify a correct version number for the project
119+
* As such, only builds from tagged versions or from a `<version>-SNAPSHOT` branch should be published to a Maven repository
120+
121+
### <a name="automated-builds--publishing">Automated Builds & publishing</a>
122+
123+
Travis-CI builds are automatically triggered when there is any change in the project repository,
124+
for example due to pushing changes, or creating tags or branches. If applicable, binaries and related
125+
artifacts are automatically published to Bintray using the `bintrayUpload` task:
126+
127+
* Building a tagged version will result in corresponding release version artifacts to be published
128+
* Building a branch named `<version>-SNAPSHOT` will result in corresponding beta version artifacts to be published
129+
* No artifacts will be deployed for any other build, for example when Travis-CI builds the `master` branch
130+
131+
See the [Related Links](#related-links) section for the relevant Travis-CI and Bintray links.
132+
133+
134+
# <a name="licensing">Licensing</a>
135+
See [LICENSE.TXT](LICENSE.TXT)
136+

build.gradle

+32-9
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,75 @@ plugins {
33
id "com.jfrog.bintray" version "1.8.4"
44
id 'org.ajoberstar.grgit' version "4.0.0"
55
id 'com.github.jk1.dependency-license-report' version '1.12'
6+
id "org.kordamp.gradle.markdown" version "2.0.0"
67
}
78

89
group 'com.fortify.ssc.parser.owasp.dependencycheck'
910

1011
ext {
11-
gradleHelpersLocation = "https://raw.githubusercontent.com/fortify-ps/gradle-helpers/master"
12+
gradleHelpersLocation = "https://raw.githubusercontent.com/fortify-ps/gradle-helpers/1.0"
1213
}
1314

1415
apply from: "${gradleHelpersLocation}/repo-helper.gradle"
1516
apply from: "${gradleHelpersLocation}/junit-helper.gradle"
1617
apply from: "${gradleHelpersLocation}/version-helper.gradle"
18+
apply from: "${gradleHelpersLocation}/fortify-helper.gradle"
1719

1820
// Project and plugin version based on SCM information
1921
version = getProjectVersionAsBetaOrRelease(true)
2022
ext {
2123
sscParserPluginVersion = getProjectVersionAsPlainVersionNumber()
24+
betaOrReleaseLabel = getBetaOrReleaseLabel()
25+
bintrayPkgName = "${rootProject.name}-${betaOrReleaseLabel}"
2226
bintrayDownloadContainerName = getProjectVersionAsBetaOrRelease(false)
2327
projectLicense = 'MIT'
2428
}
2529

2630
apply from: "${gradleHelpersLocation}/ssc-parser-plugin-helper.gradle"
27-
apply from: "${gradleHelpersLocation}/dependency-sources-licenses-helper.gradle"
31+
apply from: "${gradleHelpersLocation}/thirdparty-helper.gradle"
2832
apply from: "${gradleHelpersLocation}/bintray-binaries-helper.gradle"
33+
apply from: "${gradleHelpersLocation}/readme2html.gradle"
2934

3035
apply plugin: 'java'
3136
sourceCompatibility = 1.8
3237

38+
sourceSets {
39+
test {
40+
resources {
41+
srcDir "sampleData"
42+
}
43+
}
44+
}
45+
3346
configurations.all {
3447
// Don't cache modules that may change (i.e. snapshots)
3548
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
3649
}
3750

3851
dependencies {
39-
compileExport(group: 'com.fortify.ssc.parser.util', name: 'fortify-ssc-parser-util', version:'1.1.0-SNAPSHOT', changing: true) { transitive = true }
52+
compileExport(group: 'com.fortify.ssc.parser.util', name: 'fortify-ssc-parser-util', version:'1.0', changing: false) { transitive = true }
53+
}
54+
55+
task dist(type: Zip) {
56+
dependsOn 'build', 'readme2html'
57+
archiveFileName = "${rootProject.name}-${project.version}.zip"
58+
destinationDirectory = file("$buildDir/dist")
59+
from("${libsDir}") {
60+
include "${rootProject.name}-${project.version}.jar"
61+
}
62+
from "${buildDir}/html"
63+
from("${projectDir}") {
64+
include "sampleData/**/*"
65+
include "LICENSE.TXT"
66+
}
4067
}
4168

4269
bintray {
4370
filesSpec {
44-
from("build/libs") { // Plugin jar
45-
include "*.jar"
46-
}
47-
from("build/dist") { // Dependency sources and licenses
71+
from("${buildDir}/dist") {
4872
include "*.zip"
4973
}
5074
into '.'
5175
}
5276
}
53-
_bintrayRecordingCopy.dependsOn 'build', 'packageDependencySourcesAndLicenses'
54-
77+
_bintrayRecordingCopy.dependsOn 'clean', 'dist', 'distThirdParty'

0 commit comments

Comments
 (0)