From c5675ca3ed0fd880d6df9991343ade2be88a6fe9 Mon Sep 17 00:00:00 2001 From: Johnathan Gilday Date: Thu, 26 Jan 2023 16:25:24 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Remove=20vestigial=20files=20fro?= =?UTF-8?q?m=20java=20provider=20(#12)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove hardcoded version <-- this should have been done when merging the repos. * Remove redundant .github, .gitignore, .editorconfig, and pom.xml files * Fix formatting in README.md --- .editorconfig | 1 + README.md | 8 +- languages/java/.editorconfig | 16 - languages/java/.github/badges/branches.svg | 1 - languages/java/.github/badges/jacoco.svg | 1 - languages/java/.github/workflows/build.yml | 65 --- languages/java/.github/workflows/publish.yml | 41 -- languages/java/.gitignore | 60 --- languages/java/README.md | 51 -- languages/java/build.gradle.kts | 1 - languages/java/pom.xml | 472 ------------------- 11 files changed, 5 insertions(+), 712 deletions(-) delete mode 100644 languages/java/.editorconfig delete mode 100644 languages/java/.github/badges/branches.svg delete mode 100644 languages/java/.github/badges/jacoco.svg delete mode 100644 languages/java/.github/workflows/build.yml delete mode 100644 languages/java/.github/workflows/publish.yml delete mode 100644 languages/java/.gitignore delete mode 100644 languages/java/README.md delete mode 100644 languages/java/pom.xml diff --git a/.editorconfig b/.editorconfig index 850f4631d..cc00f0e9d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,3 +5,4 @@ root = true [*] end_of_line = lf insert_final_newline = true +charset = utf-8 diff --git a/README.md b/README.md index 8f7aad078..ada615984 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,10 @@ source. ``` 3. Initialize Submodules -```shell -git submodule init -git submodule update -``` + ```shell + git submodule init + git submodule update + ``` 4. Configure JFrog Artifactory Authentication by adding the following properties to your Gradle home gradle.properties (typically `$HOME/.gradle/gradle.properties`): ``` diff --git a/languages/java/.editorconfig b/languages/java/.editorconfig deleted file mode 100644 index a2a0ea774..000000000 --- a/languages/java/.editorconfig +++ /dev/null @@ -1,16 +0,0 @@ -# EditorConfig is awesome: https://EditorConfig.org - -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -# Set default charset -[*] -end_of_line = lf -insert_final_newline = true -charset = utf-8 - -# 4 space indentation -[*.xml] -indent_style = space -indent_size = 2 diff --git a/languages/java/.github/badges/branches.svg b/languages/java/.github/badges/branches.svg deleted file mode 100644 index 82e40743c..000000000 --- a/languages/java/.github/badges/branches.svg +++ /dev/null @@ -1 +0,0 @@ -branches66.4% \ No newline at end of file diff --git a/languages/java/.github/badges/jacoco.svg b/languages/java/.github/badges/jacoco.svg deleted file mode 100644 index 542c2bbee..000000000 --- a/languages/java/.github/badges/jacoco.svg +++ /dev/null @@ -1 +0,0 @@ -coverage88.6% \ No newline at end of file diff --git a/languages/java/.github/workflows/build.yml b/languages/java/.github/workflows/build.yml deleted file mode 100644 index 39b1172da..000000000 --- a/languages/java/.github/workflows/build.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Java CI - -on: [push] - -env: - MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2" - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: "Set up JDK 11" - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - - name: Set up Maven - uses: stCarolas/setup-maven@v4.4 - with: - maven-version: 3.8.2 - - - name: "Setting up Artifactory authentication" - uses: s4u/maven-settings-action@v2 - with: - servers: | - [ - {"id": "pixee-libs-release", "username": "${{ secrets.ARTIFACTORY_USER }}", "password": "${{ secrets.ARTIFACTORY_TOKEN }}"}, - {"id": "pixee-libs-snapshot", "username": "${{ secrets.ARTIFACTORY_USER }}", "password": "${{ secrets.ARTIFACTORY_TOKEN }}"} - ] - githubServer: false - - - name: "Build with Maven" - run: | - mvn --batch-mode --update-snapshots -Pci verify - - - name: "Generate Coverage Badge" - id: jacoco - uses: cicirello/jacoco-badge-generator@v2 - with: - generate-branches-badge: true - - - name: "Log coverage percentage" - run: | - echo "coverage = ${{ steps.jacoco.outputs.coverage }}" - echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" - - - name: "Commit the JaCoCo badge (if it changed)" - run: | - if [[ `git status --porcelain` ]]; then - git config --global user.name 'Jacoco Coverage Update Action' - git config --global user.email 'pixee@users.noreply.github.com' - git add -A - git commit -m "Autogenerated JaCoCo coverage badge" - git push - fi - - - name: "Upload JaCoCo coverage report" - uses: actions/upload-artifact@v2 - with: - name: jacoco-report - path: target/site/jacoco/ \ No newline at end of file diff --git a/languages/java/.github/workflows/publish.yml b/languages/java/.github/workflows/publish.yml deleted file mode 100644 index baee5d0f4..000000000 --- a/languages/java/.github/workflows/publish.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Create Release on Semantic Version Tag - -on: - push: - tags: - - "v*" - -jobs: - pre-release: - runs-on: "ubuntu-latest" - - steps: - - uses: actions/checkout@v2 - - - name: "Build, test and deploy" - uses: actions/setup-java@v2 - with: - java-version: '11' - distribution: 'adopt' - - - name: "Setting up Artifactory authentication" - uses: s4u/maven-settings-action@v2 - with: - servers: '[{"id": "central", "username": "${env.ARTIFACTORY_USER}", "password": "${env.ARTIFACTORY_TOKEN}"}]' - githubServer: false - - - name: "Publish to Artifactory" - env: - ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} - ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} - run: mvn deploy - - - name: "Create release" - uses: "marvinpinto/action-automatic-releases@latest" - with: - java-version: '11' - distribution: 'adopt' - repo_token: "${{ secrets.GITHUB_TOKEN }}" - prerelease: false - files: | - target/java-code-*.jar diff --git a/languages/java/.gitignore b/languages/java/.gitignore deleted file mode 100644 index 91b4cf461..000000000 --- a/languages/java/.gitignore +++ /dev/null @@ -1,60 +0,0 @@ -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar -*.iml - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -.idea/ - -target/ - -dependency-reduced-pom.xml - -# Gradle - -.gradle -**/build/ -!src/**/build/ - -# Ignore Gradle GUI config -gradle-app.setting - -# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) -!gradle-wrapper.jar - -# Avoid ignore Gradle wrappper properties -!gradle-wrapper.properties - -# Cache of project -.gradletasknamecache - -# Eclipse Gradle plugin generated files -# Eclipse Core -.project -# JDT-specific (Eclipse Java Development Tools) -.classpath - - - -.secrets - -output-*.txt diff --git a/languages/java/README.md b/languages/java/README.md deleted file mode 100644 index 5592377be..000000000 --- a/languages/java/README.md +++ /dev/null @@ -1,51 +0,0 @@ -[![Actions Status](https://github.com/pixeeworks/java-code-hardener/workflows/Java%20CI/badge.svg)](https://github.com/pixeeworks/java-code-hardener/actions) -![Coverage](.github/badges/jacoco.svg) - -# OpenPixee: Java Language Provider - -A utility for generating a list of suggested weaves. - -## How to use - -### How to configure - -TODO: We don't have configuration yet. There are lots of possible configurations: -* Should we try to inject a dependency and call that from our weaves, or just inline hardening? -* Should there be configuration to turn off rules individually? -* Should we inject comments that explain the security implications of this change? - -### Running the tool -You should hopefully be running this as part of a polyglot CLI TBD but if you need to run the JAR directly, you can do as follows: - -```shell -$ java -jar target/java-code-hardener-X.jar -``` - -Argument information here: -``` -Usage: java-code-hardener [-hvV] [-d=] -o= -r= - [-e=]... [-i=]... [-s=]... - [-x=]... -scans a repository with suggested weaves for Java - -d, --rule-default= - Specify the default rule setting ('enabled' or - 'disabled') - -e, --exclude= Specify the paths to exclude within the repository - -h, --help Show this help message and exit. - -i, --include= Specify the paths to include within the repository - -o, --output= Specify the file to write the output results to - -r, --repository= - Source code repository path - -s, --sarif= Specify the paths to SARIFs that the hardener - should act on - -v, --verbose Specify whether debug logging should be enabled - -V, --version Print version information and exit. - -x, --rule-exception= - Specify the rules that should have have the - opposite of the default rule setting - -``` - -### Consuming the output -The tool spits out results in the form of a JSON file whose path is passed in a command line argument. The file contains -suggested weaves that could harden the application. It also contains other diagnostic data. diff --git a/languages/java/build.gradle.kts b/languages/java/build.gradle.kts index 39f39c9f5..94b153df0 100644 --- a/languages/java/build.gradle.kts +++ b/languages/java/build.gradle.kts @@ -24,7 +24,6 @@ publishing { register("maven") { from(components["java"]) artifactId = "codetl-java-language-provider" - version = "1.0.3" } } } diff --git a/languages/java/pom.xml b/languages/java/pom.xml deleted file mode 100644 index 00aa3bb42..000000000 --- a/languages/java/pom.xml +++ /dev/null @@ -1,472 +0,0 @@ - - 4.0.0 - - io.openpixee - java-code-hardener - 1.0.2 - - - - pixee-libs-release - pixee-libs-release - https://pixee.jfrog.io/artifactory/default-maven-local - - - - - - pixee-libs-release - pixee-libs-release - https://pixee.jfrog.io/artifactory/default-maven-local - - true - - - false - - - - pixee-libs-snapshot - pixee-libs-snapshot - https://pixee.jfrog.io/artifactory/mailman-libs-snapshot - - false - - - true - - - - - - format - - - 23.0.0 - 1.9 - 0.0.2 - 4.4 - 2.9.0 - 2.2 - 2.9.0 - 2.13.1 - 3.23.0 - 4.9 - 2.0 - 1.0.0 - 1.0.0 - 0.0.8 - 3.5.0.201409260305-r - 2.6.2 - 5.8.2 - 2.4.0 - 1.2.11 - 4.3.1 - 4.5.2 - 0.0.1 - 0.9.3 - 0.0.7 - 1.2 - - - 2.18 - 3.8.1 - 3.2.4 - 3.0.0-M8 - - - - - org.javatuples - javatuples - ${versions.javatuples} - - - io.openpixee.maven - pom-operator - ${versions.pom-operator} - - - io.openpixee - java-jdbc-parameterizer - ${versions.jdbc-parameterizer} - - - com.fasterxml.jackson.core - jackson-core - ${versions.jackson} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - ${versions.jackson} - - - io.openpixee - java-security-toolkit - ${versions.jst} - - - io.github.pixee - codetf-java - ${versions.codetf-java} - - - io.github.java-diff-utils - java-diff-utils - ${versions.java-diff-utils} - - - net.sourceforge.pmd - pmd-java - 6.40.0 - - - - - io.codescan - sarif-java - 1.0 - - - com.contrastsecurity - java-sarif - ${versions.java-sarif} - - - org.apache.commons - commons-collections4 - ${versions.commons-collections4} - - - info.picocli - picocli - ${versions.picocli} - - - com.github.albfernandez - juniversalchardet - ${versions.juniversalchardet} - - - com.google.auto.value - auto-value-annotations - ${versions.auto-value} - - - org.immutables - value - ${versions.immutables} - provided - - - com.google.code.gson - gson - ${versions.gson} - - - com.github.javaparser - javaparser-core - 3.23.0 - - - com.github.javaparser - javaparser-symbol-solver-core - ${versions.javaparser} - - - com.github.javaparser - javaparser-symbol-solver-model - 3.15.15 - - - com.github.javaparser - javaparser-symbol-solver-logic - 3.15.15 - - - fr.inria.gforge.spoon - spoon-core - 8.3.0 - - - org.apache.logging.log4j - log4j-to-slf4j - - - - - org.jetbrains - annotations - ${versions.annotations} - - - me.tongfei - progressbar - ${versions.progressbar} - - - ch.qos.logback - logback-classic - ${versions.logback} - - - - - com.github.lalyos - jfiglet - ${versions.jfiglet} - - - - - org.junit.jupiter - junit-jupiter-api - ${versions.junit-jupiter} - test - - - org.junit.jupiter - junit-jupiter-params - ${versions.junit-jupiter} - test - - - org.assertj - assertj-core - 3.24.0 - test - - - - org.hamcrest - hamcrest-core - ${versions.hamcrest} - test - - - org.hamcrest - hamcrest-library - ${versions.hamcrest} - test - - - org.mockito - mockito-core - ${versions.mockito} - test - - - org.eclipse.jgit - org.eclipse.jgit - ${versions.jgit} - test - - - org.buildobjects - jproc - ${versions.jproc} - test - - - - javax.servlet - javax.servlet-api - 3.1.0 - test - - - - commons-fileupload - commons-fileupload - 1.4 - test - - - - org.springframework - spring-web - 4.3.11.RELEASE - test - - - - io.openpixee - java-security-toolkit-xstream - ${versions.jst-xstream} - test - - - com.thoughtworks.xstream - xstream - 1.4.7 - test - - - - io.jsonwebtoken - jjwt-api - 0.11.3 - test - - - - - org.owasp.encoder - encoder - 1.2.3 - test - - - - - - - - maven-compiler-plugin - ${versions.maven-compiler-plugin} - - 11 - 11 - - - - org.jacoco - jacoco-maven-plugin - 0.8.7 - - - - prepare-agent - - - - generate-code-coverage-report - test - - report - - - - - - maven-surefire-plugin - ${versions.maven-surefire-plugin} - - - com.spotify.fmt - fmt-maven-plugin - ${versions.fmt-maven-plugin} - - - format-java - validate - - ${fmt.goal} - - - - (${project.basedir}/src/main/java/.*|${project.basedir}/src/test/java/io/pixee/.*) - - - - - - - - org.apache.maven.plugins - maven-shade-plugin - ${versions.maven-shade-plugin} - - - package - - shade - - - - - *:* - - META-INF/*.SF - META-INF/*.DSA - META-INF/*.RSA - - - - - - io.openpixee.java.JavaFixitCli - - - - - - - - maven-failsafe-plugin - ${versions.maven-surefire-plugin} - - - - ${project.build.testSourceDirectory}/com - - - ${project.build.directory}/${project.build.finalName}.jar - - - - - - - - - com.spotify.fmt - fmt-maven-plugin - - - maven-compiler-plugin - - - org.jacoco - jacoco-maven-plugin - - - maven-surefire-plugin - - - maven-failsafe-plugin - - - - integration-test - - - - - - - org.apache.maven.plugins - maven-shade-plugin - - - - - - - ci - - - env.CI - - - - check - - - - -