From a955010c305a4e0501542e47f3785293c5e16660 Mon Sep 17 00:00:00 2001 From: niharrm Date: Mon, 11 Mar 2024 13:41:58 -0400 Subject: [PATCH 01/10] Addming the codeguru reviewer github workflow --- .github/workflows/codeguru.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeguru.yml b/.github/workflows/codeguru.yml index 0c781a9e..abbd2a8e 100644 --- a/.github/workflows/codeguru.yml +++ b/.github/workflows/codeguru.yml @@ -2,7 +2,7 @@ name: Analyze with CodeGuru Reviewer on: - push - - workflow_dispatch # This allows manual triggering of the action through the GitHub UI. + - workflow_dispatch # This allows manual triggering of the action through the GitHub UI.No changes Done. permissions: id-token: write From 46621ec1843c8265325340549f9dee76ca359524 Mon Sep 17 00:00:00 2001 From: niharrm Date: Mon, 11 Mar 2024 14:09:40 -0400 Subject: [PATCH 02/10] Adding the codeguru reviewer github workflow --- .github/workflows/codeguru.yml | 57 ---------------------------------- .github/workflows/workflow.yml | 44 ++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/codeguru.yml create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/codeguru.yml b/.github/workflows/codeguru.yml deleted file mode 100644 index abbd2a8e..00000000 --- a/.github/workflows/codeguru.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Analyze with CodeGuru Reviewer - -on: - - push - - workflow_dispatch # This allows manual triggering of the action through the GitHub UI.No changes Done. - -permissions: - id-token: write - contents: read - security-events: write - -jobs: - build: - name: Analyze with CodeGuru Reviewer - runs-on: ubuntu-latest - steps: - - name: Configure AWS credentials - id: iam-role - continue-on-error: true - uses: aws-actions/configure-aws-credentials@v1 - with: - role-to-assume: arn:aws:iam::048169001733:role/GuruGitHubCICDRole - aws-region: us-west-2 - - - uses: actions/checkout@v2 - if: steps.iam-role.outcome == 'success' - with: - fetch-depth: 0 - - name: Set up JDK 1.8 - if: steps.iam-role.outcome == 'success' - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Build project - if: steps.iam-role.outcome == 'success' - run: mvn compile -DskipTests - - - name: CodeGuru Reviewer - uses: aws-actions/codeguru-reviewer@v1.1 - if: steps.iam-role.outcome == 'success' - continue-on-error: false - with: - s3_bucket: codeguru-reviewer-github-profiler-demo-048169001733-uw2 - build_path: ./target/classes - - - name: Store SARIF file - if: steps.iam-role.outcome == 'success' - uses: actions/upload-artifact@v2 - with: - name: SARIF_recommendations - path: ./codeguru-results.sarif.json - - - name: Upload review result - if: steps.iam-role.outcome == 'success' - uses: github/codeql-action/upload-sarif@v1 - with: - sarif_file: codeguru-results.sarif.json diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 00000000..d226cdca --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,44 @@ +name: CodeGuru Workflow +on: + push: + branches: + - dev # or the name of your main branch + +jobs: + deploy: + runs-on: ubuntu-latest #for SRG + steps: + +# Step 1: Checkout the repository and provide your AWS credentials + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-2 # Region to access CodeGuru + + - name: Setup JDK + uses: actions/setup-java@v1 + with: + java-version: 1.8 + + - name: Build with Maven + run: mvn -B package --file pom.xml + + - name: Codeguru Reviewer + uses: aws-actions/codeguru-reviewer@v1.1 + with: + build_path: target # Path to the build artifact + s3_bucket: codeguru-reviewer-my-bucket-nihar # S3 Bucket with "codeguru-reviewer-*" prefix + + # Step 3: Upload results into GitHub + - name: Upload review result + if: ${{ github.event_name != 'push' }} + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: codeguru-results.sarif.json \ No newline at end of file From ebe09aca69a45295c3a4e1bb72097d2c8e6cc9f1 Mon Sep 17 00:00:00 2001 From: niharrm Date: Mon, 11 Mar 2024 14:14:24 -0400 Subject: [PATCH 03/10] Adding the codeguru reviewer github workflow - changed S3 bucket --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index d226cdca..a14b7aca 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -34,7 +34,7 @@ jobs: uses: aws-actions/codeguru-reviewer@v1.1 with: build_path: target # Path to the build artifact - s3_bucket: codeguru-reviewer-my-bucket-nihar # S3 Bucket with "codeguru-reviewer-*" prefix + s3_bucket: codeguru-reviewer-my-bucket-mar11 # S3 Bucket with "codeguru-reviewer-*" prefix # Step 3: Upload results into GitHub - name: Upload review result From 3994e4d3433fb76e9b907df962f903c2bd0c65f9 Mon Sep 17 00:00:00 2001 From: niharrm Date: Mon, 11 Mar 2024 14:20:44 -0400 Subject: [PATCH 04/10] Adding the codeguru reviewer github workflow - changed comment --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index a14b7aca..cfd9fd4f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -2,7 +2,7 @@ name: CodeGuru Workflow on: push: branches: - - dev # or the name of your main branch + - dev # or the name of your main branch , this can change jobs: deploy: From a5d4679a499761a5a6613fffcd92af9d27921133 Mon Sep 17 00:00:00 2001 From: niharrm Date: Mon, 11 Mar 2024 14:40:03 -0400 Subject: [PATCH 05/10] Adding the codeguru reviewer github workflow - changed comment again --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index cfd9fd4f..6a58f127 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -2,7 +2,7 @@ name: CodeGuru Workflow on: push: branches: - - dev # or the name of your main branch , this can change + - dev # or the name of your main branch , this can change again jobs: deploy: From edd109bb07ac5f0fe0a468c72ca030da6ce6b82a Mon Sep 17 00:00:00 2001 From: niharrm Date: Mon, 11 Mar 2024 16:05:19 -0400 Subject: [PATCH 06/10] Adding the codeguru reviewer github workflow - changed at Mar 11 4:04 PM EST --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 6a58f127..5536bdd6 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -2,7 +2,7 @@ name: CodeGuru Workflow on: push: branches: - - dev # or the name of your main branch , this can change again + - dev # or the name of your main branch , this can change again.Mar 11 4:04 PM EST jobs: deploy: From b333bbf70e1289bf352c0729eef8e406f1fd2bb3 Mon Sep 17 00:00:00 2001 From: nihar-r-mondal Date: Mon, 11 Mar 2024 16:10:19 -0400 Subject: [PATCH 07/10] Create SECURITY.md --- SECURITY.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..034e8480 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,21 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +Use this section to tell people how to report a vulnerability. + +Tell them where to go, how often they can expect to get an update on a +reported vulnerability, what to expect if the vulnerability is accepted or +declined, etc. From 32e71d2a340bceb2be90f56b24e62624816c4ed4 Mon Sep 17 00:00:00 2001 From: niharrm Date: Tue, 12 Mar 2024 13:40:51 -0400 Subject: [PATCH 08/10] Adding the codeguru reviewer github workflow - changed at Mar 12 1:40 PM EST --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 5536bdd6..371dcc13 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -2,7 +2,7 @@ name: CodeGuru Workflow on: push: branches: - - dev # or the name of your main branch , this can change again.Mar 11 4:04 PM EST + - dev # or the name of your main branch , this can change again.Mar 12 1:40 PM EST jobs: deploy: From e3d01f1b5ad79a8d141bf1175657a1e17d808ef8 Mon Sep 17 00:00:00 2001 From: niharrm Date: Tue, 12 Mar 2024 15:39:39 -0400 Subject: [PATCH 09/10] Adding the codeguru reviewer github workflow - changed at Mar 12 3:40 PM EST --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 371dcc13..e9eefc04 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -2,7 +2,7 @@ name: CodeGuru Workflow on: push: branches: - - dev # or the name of your main branch , this can change again.Mar 12 1:40 PM EST + - dev # or the name of your main branch , this can change again.Mar 12 3:40 PM EST jobs: deploy: From 2b00d70692b632e1c6fa1471f7b0c64b8047f834 Mon Sep 17 00:00:00 2001 From: niharrm Date: Tue, 12 Mar 2024 16:26:07 -0400 Subject: [PATCH 10/10] Adding the codeguru reviewer github workflow - changed at Mar 12 4:26 PM EST --- .github/workflows/workflow.yml | 2 +- src/some-package/java/com/mainpackage/FileSyntaxError.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e9eefc04..a7701f99 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -38,7 +38,7 @@ jobs: # Step 3: Upload results into GitHub - name: Upload review result - if: ${{ github.event_name != 'push' }} + if: ${{ github.event_name = 'push' }} # ${{ github.event_name != 'push' }} uses: github/codeql-action/upload-sarif@v1 with: sarif_file: codeguru-results.sarif.json \ No newline at end of file diff --git a/src/some-package/java/com/mainpackage/FileSyntaxError.java b/src/some-package/java/com/mainpackage/FileSyntaxError.java index c2d05e39..d7df61cc 100644 --- a/src/some-package/java/com/mainpackage/FileSyntaxError.java +++ b/src/some-package/java/com/mainpackage/FileSyntaxError.java @@ -6,6 +6,9 @@ import java.io.InputStream; import com.amazonaws.util.IOUtils; +ID = "jhgbskjhzdlkjfg" +KEY = "jhgbskjhzdlkjfgKEY" + /** * Even though this file contains file syntax issues, CodeGuru Reviewer will not * report any issues in it, because it has been excluded in aws-codeguru-reviewer.yml.