|
| 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 Local PHP Security Checker |
| 26 | + |
| 27 | +## Introduction |
| 28 | + |
| 29 | +This Fortify SSC parser plugin allows for importing scan results from [Local PHP Security Checker](https://github.com/fabpot/local-php-security-checker). |
| 30 | + |
| 31 | +### Related Links |
| 32 | + |
| 33 | +* **Downloads**: https://github.com/fortify-ps/fortify-ssc-parser-php-security-checker/releases |
| 34 | + * _Development releases may be unstable or non-functional. The `*-thirdparty.zip` file is for informational purposes only and does not need to be downloaded._ |
| 35 | +* **Sample input files**: [sampleData](sampleData) |
| 36 | +* **GitHub**: https://github.com/fortify-ps/fortify-ssc-parser-php-security-checker |
| 37 | +* **Automated builds**: https://github.com/fortify-ps/fortify-ssc-parser-php-security-checker/actions |
| 38 | +* **Local PHP Security Checker repository**: https://github.com/fabpot/local-php-security-checker |
| 39 | + |
| 40 | + |
| 41 | +## Plugin Installation |
| 42 | + |
| 43 | +These sections describe how to install, upgrade and uninstall the plugin. |
| 44 | + |
| 45 | +### Install & Upgrade |
| 46 | + |
| 47 | +* Obtain the plugin binary jar file |
| 48 | + * Either download from Bintray (see [Related Links](#related-links)) |
| 49 | + * Or by building yourself (see [Developers](#developers)) |
| 50 | +* If you already have another version of the plugin installed, first uninstall the previously |
| 51 | + installed version of the plugin by following the steps under [Uninstall](#uninstall) below |
| 52 | +* In Fortify Software Security Center: |
| 53 | + * Navigate to Administration->Plugins->Parsers |
| 54 | + * Click the `NEW` button |
| 55 | + * Accept the warning |
| 56 | + * Upload the plugin jar file |
| 57 | + * Enable the plugin by clicking the `ENABLE` button |
| 58 | + |
| 59 | +### Uninstall |
| 60 | + |
| 61 | +* In Fortify Software Security Center: |
| 62 | + * Navigate to Administration->Plugins->Parsers |
| 63 | + * Select the parser plugin that you want to uninstall |
| 64 | + * Click the `DISABLE` button |
| 65 | + * Click the `REMOVE` button |
| 66 | + |
| 67 | + |
| 68 | +## Obtain results |
| 69 | + |
| 70 | +Please see the Local PHP Security Checker documentation for details on checking applications and |
| 71 | +generating reports. Note that the SSC parser plugin requires the uploaded reports to be in JSON |
| 72 | +format. |
| 73 | + |
| 74 | +## Upload results |
| 75 | + |
| 76 | +SSC web interface (manual upload): |
| 77 | + |
| 78 | +* Navigate to the Artifacts tab of your application version |
| 79 | +* Click the `UPLOAD` button |
| 80 | +* Click the `ADD FILES` button, and select the JSON file to upload |
| 81 | +* Enable the `3rd party results` check box |
| 82 | +* Select the `PHP_SECCHECK` type |
| 83 | + |
| 84 | +SSC clients (FortifyClient, Maven plugin, ...): |
| 85 | + |
| 86 | +* Generate a scan.info file containing a single line as follows: |
| 87 | +`engineType=PHP_SECCHECK` |
| 88 | +* Generate a zip file containing the following: |
| 89 | + * The scan.info file generated in the previous step |
| 90 | + * The JSON file containing scan results |
| 91 | +* Upload the zip file generated in the previous step to SSC |
| 92 | + * Using any SSC client, for example FortifyClient |
| 93 | + * Similar to how you would upload an FPR file |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | +## Developers |
| 98 | + |
| 99 | +The following sections provide information that may be useful for developers of this utility. |
| 100 | + |
| 101 | +### IDE's |
| 102 | + |
| 103 | +This project uses Lombok. In order to have your IDE compile this project without errors, |
| 104 | +you may need to add Lombok support to your IDE. Please see https://projectlombok.org/setup/overview |
| 105 | +for more information. |
| 106 | + |
| 107 | +### Gradle Wrapper |
| 108 | + |
| 109 | +It is strongly recommended to build this project using the included Gradle Wrapper |
| 110 | +scripts; using other Gradle versions may result in build errors and other issues. |
| 111 | + |
| 112 | +The Gradle build uses various helper scripts from https://github.com/fortify-ps/gradle-helpers; |
| 113 | +please refer to the documentation and comments in included scripts for more information. |
| 114 | + |
| 115 | +### Common Commands |
| 116 | + |
| 117 | +All commands listed below use Linux/bash notation; adjust accordingly if you |
| 118 | +are running on a different platform. All commands are to be executed from |
| 119 | +the main project directory. |
| 120 | + |
| 121 | +* `./gradlew tasks --all`: List all available tasks |
| 122 | +* Build: (plugin binary will be stored in `build/libs`) |
| 123 | + * `./gradlew clean build`: Clean and build the project |
| 124 | + * `./gradlew build`: Build the project without cleaning |
| 125 | + * `./gradlew dist distThirdParty`: Build distribution zip and third-party information bundle |
| 126 | +* `./fortify-scan.sh`: Run a Fortify scan; requires Fortify SCA to be installed |
| 127 | + |
| 128 | +### Automated Builds |
| 129 | + |
| 130 | +This project uses GitHub Actions workflows to perform automated builds for both development and production releases. All pushes to the main branch qualify for building a production release. Commits on the main branch should use [Conventional Commit Messages](https://www.conventionalcommits.org/en/v1.0.0/); it is recommended to also use conventional commit messages on any other branches. |
| 131 | + |
| 132 | +User-facing commits (features or fixes) on the main branch will trigger the [release-please-action](https://github.com/google-github-actions/release-please-action) to automatically create a pull request for publishing a release version. This pull request contains an automatically generated CHANGELOG.md together with a version.txt based on the conventional commit messages on the main branch. Merging such a pull request will automatically publish the production binaries and Docker images to the locations described in the [Related Links](#related-links) section. |
| 133 | + |
| 134 | +Every push to a branch in the GitHub repository will also automatically trigger a development release to be built. By default, development releases are only published as build job artifacts. However, if a tag named `dev_<branch-name>` exists, then development releases are also published to the locations described in the [Related Links](#related-links) section. The `dev_<branch-name>` tag will be automatically updated to the commit that triggered the build. |
| 135 | + |
| 136 | + |
| 137 | +## License |
| 138 | +<x-insert text="<!--"/> |
| 139 | + |
| 140 | +See [LICENSE.TXT](LICENSE.TXT) |
| 141 | + |
| 142 | +<x-insert text="-->"/> |
| 143 | + |
| 144 | +<x-include url="file:LICENSE.TXT"/> |
| 145 | + |
0 commit comments