Comments (4)
Hi @ok-karthik
Thanks for your issue. I think you are missing the CODE_DIR
env setup step and cd'ing into it.
If you exec into Container, pass the env var (-e
) or export it there.
Below is also using Arm64 image (should be faster)
Below assume your code is under /code
. Feel free to adjust.
export CODE_DIR=/code
cd $CODE_DIR
docker run -e CODE_DIR -v /code:/code -ti scanmycode/scanmycode3-ce:worker-cli-arm64 /bin/sh -c 'cd $CODE_DIR && checkmate init'
docker run -e CODE_DIR -v /code:/code -ti scanmycode/scanmycode3-ce:worker-cli-arm64 /bin/sh -c 'cd $CODE_DIR && checkmate git init'
docker run -e CODE_DIR -v /code:/code -ti scanmycode/scanmycode3-ce:worker-cli-arm64 /bin/sh -c 'cd $CODE_DIR && checkmate git analyze'
docker run -e CODE_DIR -v /code:/code -ti scanmycode/scanmycode3-ce:worker-cli-arm64 /bin/sh -c 'cd $CODE_DIR && checkmate issues'
Let me know if this helped.
P. S Only have Linux on my end
from betterscan.
@marcinguy , thanks for your response. Thanks for highlighting about CODE_DIR.
I've tested by passing the env var, it seems to work like a charm.
I think the problem was with the code repo being used.. For my particular private code repo, init step seems stuck at "checkmate git init". But when I use it with a sample public code repo, it seems to work okay (both results below)
On Linux and Mac M1 with https://github.com/skeeto/sample-java-project.git - Works Okay
jenkins-agent-1 orugondakart01 # export CODE_DIR=/tmp/sample-java-project; docker run -e CODE_DIR -v ${CODE_DIR}:${CODE_DIR} -ti scanmycode/scanmycode3-ce:worker-cli /bin/sh -c 'cd $CODE_DIR && checkmate init' /root /tmp/sample-java-project Loading plugin: git Loading plugin: trufflehog3 Loading plugin: trojansource Loading plugin: metrics Loading plugin: bandit Loading plugin: brakeman Loading plugin: phpanalyzer Loading plugin: gosec Loading plugin: confused Loading plugin: pmd Loading plugin: semgrep Loading plugin: semgrepdefi Loading plugin: semgrepjs Loading plugin: checkov Initializing new project in the current directory. jenkins-agent-1 orugondakart01 # jenkins-agent-1 orugondakart01 # export CODE_DIR=/tmp/sample-java-project; docker run -e CODE_DIR -v ${CODE_DIR}:${CODE_DIR} -ti scanmycode/scanmycode3-ce:worker-cli /bin/sh -c 'cd $CODE_DIR && checkmate git init' /root /tmp/sample-java-project /tmp/sample-java-project Loading plugin: git Loading plugin: trufflehog3 Loading plugin: trojansource Loading plugin: metrics Loading plugin: bandit Loading plugin: brakeman Loading plugin: phpanalyzer Loading plugin: gosec Loading plugin: confused Loading plugin: pmd Loading plugin: semgrep Loading plugin: semgrepdefi Loading plugin: semgrepjs Loading plugin: checkov jenkins-agent-1 orugondakart01 # export CODE_DIR=/tmp/sample-java-project; docker run -e CODE_DIR -v ${CODE_DIR}:${CODE_DIR} -ti scanmycode/scanmycode3-ce:worker-cli /bin/sh -c 'cd $CODE_DIR && checkmate git analyze' /root /tmp/sample-java-project /tmp/sample-java-project Loading plugin: git Loading plugin: trufflehog3 Loading plugin: trojansource Loading plugin: metrics Loading plugin: bandit Loading plugin: brakeman Loading plugin: phpanalyzer Loading plugin: gosec Loading plugin: confused Loading plugin: pmd Loading plugin: semgrep Loading plugin: semgrepdefi Loading plugin: semgrepjs Loading plugin: checkov Analyzing the 1 most recent commits in branch master (offset: 0) Excluding 0 file revisions Analyzing 12 new file revisions (0 are already analyzed) Analyzing and saving: 0 - 10 (12 remaining) Analyzing file revision .gitignore [main] INFO profile include tests: None [main] INFO profile exclude tests: None [main] INFO cli include tests: None [main] INFO cli exclude tests: None Please supply the path to a Rails application (looking in /tmp/12dba0595a514341a1e28bef134809f5). Use
--force` to run a scan anyway.
PHP Notice: Trying to access array offset on value of type int in phar:///root/phpscan/progpilot_dev20180720-215434.phar/vendor/progpilot/package/src/progpilot/Transformations/Php/Expr.php on line 36
PHP Notice: Trying to access array offset on value of type int in phar:///root/phpscan/progpilot_dev20180720-215434.phar/vendor/progpilot/package/src/progpilot/Transformations/Php/Expr.php on line 36
PHP Notice: Trying to access array offset on value of type int in phar:///root/phpscan/progpilot_dev20180720-215434.phar/vendor/progpilot/package/src/progpilot/Transformations/Php/Expr.php on line 36
[gosec] 2022/06/17 11:51:13 Including rules: default
[gosec] 2022/06/17 11:51:13 Excluding rules: default
[gosec] 2022/06/17 11:51:13 No packages found
Jun 17, 2022 11:51:14 AM net.sourceforge.pmd.PMD encourageToUseIncrementalAnalysis
WARNING: This analysis could be faster, please consider using Incremental Analysis: https://pmd.github.io/pmd-6.41.0/pmd_userdocs_incremental_analysis.html
METRICS: Using configs from the Registry (like --config=p/ci) reports pseudonymous rule metrics to semgrep.dev.
To disable Registry rule metrics, use "--metrics=off".
Using configs only from local files (like --config=xyz.yml) does not enable metrics.
More information: https://semgrep.dev/docs/metrics
Scanning 1 file.
Ran 1 rule on 1 file: 0 findings.
Scanning 1 file with 21 solidity rules.
Some files were skipped or only partially analyzed.
Partially scanned: 1 files only partially analyzed due to a parsing or internal Semgrep error
Ran 21 rules on 1 file: 0 findings.
Scanning across multiple languages:
js | 111 rules × 1 file
ts | 111 rules × 1 file
100%|██████████████████████████████████████████████████████████████████████████████████████████████████|2/2 tasks
Ran 111 rules on 1 file: 0 findings.`
On Linux and Mac M1 with private code repo - unresponsive at "checkmate git init" step
❯ export CODE_DIR="/Users/karthik.orugonda/Downloads/java-project-master"; docker run -e CODE_DIR -v ${CODE_DIR}:${CODE_DIR} -ti scanmycode/scanmycode3-ce:worker-cli-arm64 /bin/sh -c 'cd $CODE_DIR && checkmate git init' /root /Users/karthik.orugonda/Downloads/java-project-master /Users/karthik.orugonda/Downloads/java-project-master Loading plugin: git Loading plugin: trufflehog3 Loading plugin: trojansource Loading plugin: metrics Loading plugin: bandit Loading plugin: brakeman Loading plugin: phpanalyzer Loading plugin: gosec Loading plugin: confused Loading plugin: pmd Loading plugin: semgrep Loading plugin: semgrepdefi Loading plugin: semgrepjs Loading plugin: checkov
from betterscan.
@ok-karthik I will add a check to make sure code is a git repo clone and CODE_DIR env var is set, so it can warn about it. Thanks for your hint.
I think your java-project-master
is not a git repo, but just a directory with source files.
Do you have .git
folder inside?
If not please run git init && git add . && git commit
in it to make it a Git repo.
Let me know if it helps.
from betterscan.
Closing due to inactivity
from betterscan.
Related Issues (20)
- Dependency files should always be scanned HOT 7
- Update osv-scan to v1.1.0 to include support for NuGet and PIP HOT 1
- How can SBOM in cyclonedx format be integrated? HOT 2
- Docker is failing during building HOT 2
- Error during analysis HOT 4
- setup fails to create tasks directory and blocks worker from working on tasks HOT 2
- Getting error in checkmate issue HOT 12
- Is analyzers\yara\WShell_THOR_Webshells.yar an active exploit? HOT 3
- find_unicode_control2.py incorrectly flags UTF-8 BOM as a Trojan Source exploit HOT 1
- Checkmate error(?) HOT 2
- Private github repo fails to fetch despite adding public ssh key to github account? HOT 1
- only enable specified plugins HOT 2
- CE edition default run requires PRO to view files? HOT 2
- Purchased Pro License in September haven't recieved it yet HOT 2
- No space left on device during build HOT 8
- betterscan/betterscan-ce image cannot be found HOT 3
- Error execution HOT 2
- Issue building docker images HOT 1
- Errors with server (backend) and worker images HOT 3
- Please consider adopting OpenSSF Scorecard HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from betterscan.