Comments (5)
hi @dkajla
Make sure it is a Git repo, otherwise it will also error out.
On a mobile now. Try this:
- job: SAST
displayName: Static Application Security Test (SAST)
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
pool:
vmImage: 'ubuntu-latest'
container: 'scanmycode/scanmycode3-ce:worker-cli'
steps:
- script: |
sudo apt-get update
sudo apt-get install git-lfs
displayName: Install git LFS
- checkout: self
persistCredentials: true
- script: |
set -e
git config --global user.email "[email protected]"
git config --global user.name "Azure DevOps"
git checkout -b $(Build.SourceBranchName)
sudo CODE_DIR=$(Build.SourcesDirectory) checkmate init
sudo CODE_DIR=$(Build.SourcesDirectory) checkmate git init
sudo CODE_DIR=$(Build.SourcesDirectory) checkmate git analyze --branch $(Build.SourceBranchName)
checkmate issues html
displayName: Static Application Security Test (SAST)
env:
CODE_DIR: '$(Build.SourcesDirectory)'
- task: PublishBuildArtifacts@1
displayName: Publish SAST report
inputs:
PathtoPublish: $(Build.SourcesDirectory)
ArtifactName: CodeAnalysisLogs
- script: |
git add .checkmate/db.sqlite
git commit -m '[no ci] update checkmate db'
git push origin $(Build.SourceBranchName):$(Build.SourceBranch)
displayName: Commit and Push checkmate db
Notice two new lines:
sudo CODE_DIR=$(Build.SourcesDirectory) checkmate init
sudo CODE_DIR=$(Build.SourcesDirectory) checkmate git init
Please let me know how it works.
Also can you scan this repo and send screenshot from Azure DevOps server showing results:
https://github.com/topcodersonline/samplecode
from betterscan.
Hi @marcinguy Thanks for the response.
Yes it did fix the issue I was facing. Additionally, I had to add sudo CODE_DIR=$(Build.SourcesDirectory)
ahead of checkmate issues html
for the job to complete successfully.
I have few more questions :)
- Is the final script needed ? which is committing the db file into repo
git commit -m '[no ci] update checkmate db
, as its triggering pipeline continuously. - Is there a option that the tool can scan PR's and add comments automatically. Apologies for multiple questions, I couldn't find any detailed documentation about these configurations.
from betterscan.
- this step ensures state is preserved (project will not be rescanned each time for checked files)
I think you can do exclusion for ".checkmate" folder with file types exclusion trigger:
https://learn.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops
- Scanning PR is possible, then you would see findings for PR only. You should check what Azure DevOps server can do.
Maybe @carlin-q-scott knows more. He contributed Azure DevOps server setup.
P.S @devendrakajala Screenshot of sample repo from Azure DevOps server would be helpful. Maybe you can paste it here or send me on my email. I will add it to documentation.
from betterscan.
@devendrakajala The commit should not be triggering CI, as the [no ci]
commit message is supposed to prevent that. I've found that they broke support for that particular message recently, but [ci skip]
seems to work for me with a BitBucket repo.
Due to another bug I found with Azure DevOps, I ended up persisting my .checkmate folder to blob storage and leaving it out of the git repo entirely. My issue was that the git credentials aren't persisted properly within a container job when using BitBucket as the git repo.
from betterscan.
Thanks for your comments guys @marcinguy @carlin-q-scott using [ci skip]
helped.
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.