Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit ca2167b

Browse files
committed
First commit
0 parents  commit ca2167b

25 files changed

+1136
-0
lines changed

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.gradle/
2+
.shelf/
3+
build/
4+
out/
5+
dist/
6+
*.iml
7+
*.iws
8+
*.ipr
9+
*~
10+
rebel.xml
11+
.idea/
12+
/fortifyRepository
13+
.settings/
14+
bin/
15+
lombok.config
16+
.classpath
17+
.project
18+
*.fpr

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
language: java
2+
install: true
3+
sudo: false
4+
5+
stages:
6+
- name: build
7+
- name: snapshotBranch
8+
if: tag IS blank AND branch =~ /^(\d+.)+\d+-SNAPSHOT$/
9+
- name: releaseTag
10+
if: tag IS present
11+
12+
jobs:
13+
include:
14+
- stage: build
15+
script: /bin/sh ./gradlew build
16+
- stage: snapshotBranch
17+
script: /bin/sh ./gradlew "-PoverrideVersion=$TRAVIS_BRANCH" bintrayUpload -x test -Dbuild.number=$TRAVIS_BUILD_NUMBER
18+
- stage: releaseTag
19+
script: /bin/sh ./gradlew "-PoverrideVersion=$TRAVIS_TAG" bintrayUpload -x test -Dbuild.number=$TRAVIS_BUILD_NUMBER
20+

LICENSE.TXT

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
The MIT License (MIT)
2+
(c) Copyright 2020 Micro Focus or one of its affiliates, a Micro Focus company
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a
5+
copy of this software and associated documentation files (the
6+
"Software"), to deal in the Software without restriction, including without
7+
limitation the rights to use, copy, modify, merge, publish, distribute,
8+
sublicense, and/or sell copies of the Software, and to permit persons to
9+
whom the Software is furnished to do so, subject to the following
10+
conditions:
11+
12+
The above copyright notice and this permission notice shall be included
13+
in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
16+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
17+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
18+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21+
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
23+
IN THE SOFTWARE.

README.md

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
<x-tag-head>
2+
<x-tag-meta http-equiv="X-UA-Compatible" content="IE=edge"/>
3+
4+
<x-tag-script language="JavaScript"><!--
5+
<X-INCLUDE url="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.0.0/build/highlight.min.js"/>
6+
--></x-tag-script>
7+
8+
<x-tag-script language="JavaScript"><!--
9+
<X-INCLUDE url="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js" />
10+
--></x-tag-script>
11+
12+
<x-tag-script language="JavaScript"><!--
13+
<X-INCLUDE url="${gradleHelpersLocation}/spa_readme.js" />
14+
--></x-tag-script>
15+
16+
<x-tag-style><!--
17+
<X-INCLUDE url="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.0.0/build/styles/github.min.css" />
18+
--></x-tag-style>
19+
20+
<x-tag-style><!--
21+
<X-INCLUDE url="${gradleHelpersLocation}/spa_readme.css" />
22+
--></x-tag-style>
23+
</x-tag-head>
24+
25+
# Fortify SSC Parser Plugin for Symfony Security Checker
26+
27+
## Introduction
28+
29+
This Fortify SSC parser plugin allows for importing scan results from Symfony Security Checker.
30+
31+
### Related Links
32+
33+
* **Downloads**:
34+
_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._
35+
* **Release versions**: https://bintray.com/package/files/fortify-ps/release/fortify-ssc-parser-symfony-security-checker?order=desc&sort=fileLastModified&basePath=&tab=files
36+
* **Beta versions**: https://bintray.com/package/files/fortify-ps/beta/fortify-ssc-parser-symfony-security-checker?order=desc&sort=fileLastModified&basePath=&tab=files
37+
* **Sample input files**: [sampleData](sampleData)
38+
* **GitHub**: https://github.com/fortify-ps/fortify-ssc-parser-symfony-security-checker
39+
* **Automated builds**: https://travis-ci.com/fortify-ps/fortify-ssc-parser-symfony-security-checker
40+
* **Symfony Security Checker resources**:
41+
* Web interface: https://security.symfony.com/
42+
* CLI interface: https://github.com/sensiolabs/security-checker
43+
44+
45+
## Plugin Installation
46+
47+
These sections describe how to install, upgrade and uninstall the plugin.
48+
49+
### Install & Upgrade
50+
51+
* Obtain the plugin binary jar file
52+
* Either download from Bintray (see [Related Links](#related-links))
53+
* Or by building yourself (see [Developers](#developers))
54+
* If you already have another version of the plugin installed, first uninstall the previously
55+
installed version of the plugin by following the steps under [Uninstall](#uninstall) below
56+
* In Fortify Software Security Center:
57+
* Navigate to Administration->Plugins->Parsers
58+
* Click the `NEW` button
59+
* Accept the warning
60+
* Upload the plugin jar file
61+
* Enable the plugin by clicking the `ENABLE` button
62+
63+
### Uninstall
64+
65+
* In Fortify Software Security Center:
66+
* Navigate to Administration->Plugins->Parsers
67+
* Select the parser plugin that you want to uninstall
68+
* Click the `DISABLE` button
69+
* Click the `REMOVE` button
70+
71+
72+
## Obtain results
73+
74+
Please see the Symfony Security Checker documentation for details on checking applications and
75+
generating reports. Note that the SSC parser plugin requires the uploaded reports to be in JSON
76+
format.
77+
78+
## Upload results
79+
80+
SSC web interface (manual upload):
81+
82+
* Navigate to the Artifacts tab of your application version
83+
* Click the `UPLOAD` button
84+
* Click the `ADD FILES` button, and select the JSON file to upload
85+
* Enable the `3rd party results` check box
86+
* Select the `SYMFONY_SECCHECK` type
87+
88+
SSC clients (FortifyClient, Maven plugin, ...):
89+
90+
* Generate a scan.info file containing a single line as follows:
91+
`engineType=SYMFONY_SECCHECK`
92+
* Generate a zip file containing the following:
93+
* The scan.info file generated in the previous step
94+
* The JSON file containing scan results
95+
* Upload the zip file generated in the previous step to SSC
96+
* Using any SSC client, for example FortifyClient
97+
* Similar to how you would upload an FPR file
98+
99+
100+
101+
## Developers
102+
103+
The following sections provide information that may be useful for developers of this
104+
parser plugin.
105+
106+
### IDE's
107+
108+
This project uses Lombok. In order to have your IDE compile this project without errors,
109+
you may need to add Lombok support to your IDE. Please see https://projectlombok.org/setup/overview
110+
for more information.
111+
112+
### Gradle Wrapper
113+
114+
It is strongly recommended to build this project using the included Gradle Wrapper
115+
scripts; using other Gradle versions may result in build errors and other issues.
116+
117+
The Gradle build uses various helper scripts from https://github.com/fortify-ps/gradle-helpers;
118+
please refer to the documentation and comments in included scripts for more information.
119+
120+
### Common Commands
121+
122+
All commands listed below use Linux/bash notation; adjust accordingly if you
123+
are running on a different platform. All commands are to be executed from
124+
the main project directory.
125+
126+
* `./gradlew tasks --all`: List all available tasks
127+
* Build: (plugin binary will be stored in `build/libs`)
128+
* `./gradlew clean build`: Clean and build the project
129+
* `./gradlew build`: Build the project without cleaning
130+
* `./gradlew dist`: Build distribution zip
131+
* Version management:
132+
* `./gradlew printProjectVersion`: Print the current version
133+
* `./gradlew startSnapshotBranch -PnextVersion=2.0`: Start a new snapshot branch for an upcoming `2.0` version
134+
* `./gradlew releaseSnapshot`: Merge the changes from the current branch to the master branch, and create release tag
135+
* `./fortify-scan.sh`: Run a Fortify scan; requires Fortify SCA to be installed
136+
137+
Note that the version management tasks operate only on the local repository; you will need to manually
138+
push any changes (including tags and branches) to the remote repository.
139+
140+
### Versioning
141+
142+
The various version-related Gradle tasks assume the following versioning methodology:
143+
144+
* The `master` branch is only used for creating tagged release versions
145+
* A branch named `<version>-SNAPSHOT` contains the current snapshot state for the upcoming release
146+
* Optionally, other branches can be used to develop individual features, perform bug fixes, ...
147+
* However, note that the Gradle build may be unable to identify a correct version number for the project
148+
* As such, only builds from tagged versions or from a `<version>-SNAPSHOT` branch should be published to a Maven repository
149+
150+
### CI/CD
151+
152+
Travis-CI builds are automatically triggered when there is any change in the project repository,
153+
for example due to pushing changes, or creating tags or branches. If applicable, binaries and related
154+
artifacts are automatically published to Bintray using the `bintrayUpload` task:
155+
156+
* Building a tagged version will result in corresponding release version artifacts to be published
157+
* Building a branch named `<version>-SNAPSHOT` will result in corresponding beta version artifacts to be published
158+
* No artifacts will be deployed for any other build, for example when Travis-CI builds the `master` branch
159+
160+
See the [Related Links](#related-links) section for the relevant Travis-CI and Bintray links.
161+
162+
163+
## License
164+
<x-insert text="<!--"/>
165+
166+
See [LICENSE.TXT](LICENSE.TXT)
167+
168+
<x-insert text="-->"/>
169+
170+
<x-include url="file:LICENSE.TXT"/>

build.gradle

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
plugins {
2+
id "io.freefair.lombok" version "4.1.2"
3+
id "com.jfrog.bintray" version "1.8.4"
4+
id 'org.ajoberstar.grgit' version "4.0.0"
5+
id 'com.github.jk1.dependency-license-report' version '1.12'
6+
id "org.kordamp.gradle.markdown" version "2.0.0"
7+
}
8+
9+
group 'com.fortify.ssc.parser.clair.rest'
10+
11+
ext {
12+
gradleHelpersLocation = "https://raw.githubusercontent.com/fortify-ps/gradle-helpers/1.2"
13+
}
14+
15+
apply from: "${gradleHelpersLocation}/repo-helper.gradle"
16+
apply from: "${gradleHelpersLocation}/junit-helper.gradle"
17+
apply from: "${gradleHelpersLocation}/version-helper.gradle"
18+
apply from: "${gradleHelpersLocation}/fortify-helper.gradle"
19+
20+
// Project and plugin version based on SCM information
21+
version = getProjectVersionAsBetaOrRelease(true)
22+
ext {
23+
sscParserPluginVersion = getProjectVersionAsPlainVersionNumber()
24+
bintrayRepo = "${getBetaOrReleaseLabel()}"
25+
bintrayPkgName = "${rootProject.name}"
26+
bintrayDownloadContainerName = getProjectVersionAsBetaOrRelease(false)
27+
projectLicense = 'MIT'
28+
}
29+
30+
apply from: "${gradleHelpersLocation}/ssc-parser-plugin-helper.gradle"
31+
apply from: "${gradleHelpersLocation}/thirdparty-helper.gradle"
32+
apply from: "${gradleHelpersLocation}/bintray-binaries-helper.gradle"
33+
apply from: "${gradleHelpersLocation}/readme2html.gradle"
34+
35+
apply plugin: 'java'
36+
sourceCompatibility = 1.8
37+
38+
sourceSets {
39+
test {
40+
resources {
41+
srcDir "sampleData"
42+
}
43+
}
44+
}
45+
46+
configurations.all {
47+
// Don't cache modules that may change (i.e. snapshots)
48+
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
49+
}
50+
51+
dependencies {
52+
compileExport(group: 'com.fortify.ssc.parser.util', name: 'fortify-ssc-parser-util', version:'1.2-SNAPSHOT', changing: true) { 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+
}
67+
}
68+
69+
bintray {
70+
filesSpec {
71+
from("${buildDir}/dist") {
72+
include "*.zip"
73+
}
74+
into '.'
75+
}
76+
}
77+
_bintrayRecordingCopy.dependsOn 'clean', 'dist', 'distThirdParty'

fortify-scan.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# Set scan options
4+
# Modular scan doesn't work properly yet, so for now we just add the fortify-ssc-parser-util build model
5+
# Note that either approach requires fortify-ssc-parser-util to be translated/scanned on the same machine
6+
# before running this script.
7+
#scanOpts="-include-modules fortify-ssc-parser-util -scan"
8+
scanOpts="-b fortify-ssc-parser-util -scan"
9+
10+
# Load and execute actual scan script from GitHub
11+
curl -s https://raw.githubusercontent.com/fortify-ps/gradle-helpers/1.0/fortify-scan.sh | bash -s - ${scanOpts}

gradle/wrapper/gradle-wrapper.jar

54.3 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)