Giter Club home page Giter Club logo

Comments (4)

marcinguy avatar marcinguy commented on August 12, 2024

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.

ok-karthik avatar ok-karthik commented on August 12, 2024

@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.

marcinguy avatar marcinguy commented on August 12, 2024

@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.

marcinguy avatar marcinguy commented on August 12, 2024

Closing due to inactivity

from betterscan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.