Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ToolsController.java #3

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/build-and-scan.yml
Expand Up @@ -29,7 +29,7 @@ jobs:
run: java -Dpipeline.debug=true -jar pipeline-scan.jar --veracode_api_id "${{secrets.VERACODE_API_ID}}" --veracode_api_key "${{secrets.VERACODE_API_KEY}}" --file "target/verademo.war" --fail_on_severity="Very High, High,Medium" -jo true
- name: Convert pipeline scan output to SARIF format
id: convert
uses: Lerer/veracode-pipeline-scan-results-to-sarif-1@fix-normalize
uses: Veracode/veracode-pipeline-scan-results-to-sarif@v0.1.6
with:
pipeline-results-json: results.json
output-results-sarif: veracode-results.sarif
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/pipeline-to-pr-comment.yml
Expand Up @@ -28,14 +28,15 @@ jobs:
- name: Run Pipeline Scanner
id: pipeline-scan
continue-on-error: true
run: java -jar pipeline-scan.jar --veracode_api_id "${{secrets.VERACODE_API_ID}}" --veracode_api_key "${{secrets.VERACODE_API_KEY}}" --so true --file "./target/verademo.war" --fail_on_severity="Very High, High"
run: java -jar pipeline-scan.jar --veracode_api_id "${{secrets.VERACODE_API_ID}}" --veracode_api_key "${{secrets.VERACODE_API_KEY}}" -so true --file "./target/verademo.war" --fail_on_severity="Very High, High"
- id: get-comment-body
if: ${{ github.head_ref != '' }}
run: |
body=$(cat results.txt)
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo ::set-output name=body::$body
body="${body//$'===\n---'/'===\n<details><summary>details</summary><p>\n---'}"
body="${body//$'---\n\n==='/'---\n</p></details>\n==='}"
body="${body//$'\n'/'<br>'}"
echo "::set-output name=body1::$body"
- uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
Expand All @@ -44,5 +45,5 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: ${{ steps.get-comment-body.outputs.body }}
body: "${{ steps.get-comment-body.outputs.body1 }}"
})
Expand Up @@ -91,6 +91,15 @@ private String fortune(String fortuneFile)
proc = Runtime.getRuntime().exec(cmd);
}
/* END BAD CODE */

/* ANOTHER BAD CODE */
if (System.getProperty("os.name").startsWith("Windows")) {
proc = Runtime.getRuntime().exec(new String[] { "cmd.exe", "/c", cmd });
}
else {
proc = Runtime.getRuntime().exec(cmd);
}
/* END ANOTHER BAD CODE */

InputStreamReader isr = new InputStreamReader(proc.getInputStream());
BufferedReader br = new BufferedReader(isr);
Expand Down