lucas.ferreira likes this.
  •  @Sohlae (Community Member)​ 

     

    For SCA Agent-based scans:

     

    Set up and agent scan and workspace

    1. Access the Platform >> Scans & Analysis >> Software Composition Analysis >> Agent based Scans >> Actions >> Create a workspace >> give a name >> Click on 'More Options" >> Select the teams that you would like to share the reports
    2. Enter into workspace created >> left side >> click on Agents
    3. Now you can create agents based on Operate System that yours pipelines works

     

    Linux/Mac agent pools

    1. Into agents, click on green button "Actions" >> create >> select any Integration options like bellow

    image 

    1. Click "create and generate token"
    2. Into your Azure Pipelines, create a variable into it named as SRCCLR_API_TOKEN and the value must be the token generated earlier
    3. Now, you can run SCA agent-based scan running a script like bellow:

     - task: CmdLine@2

          inputs:

            script: |

                    export SRCCLR_API_TOKEN=$(SRCCLR_API_TOKEN)

                    export SRCCLR_SCM_URI=$(Build.Repository.Uri)

                    export SRCCLR_SCM_REF=$(Build.SourceBranchName)

                    export SRCCLR_SCM_REF_TYPE="branch"

                    export SRCCLR_SCM_REV=$(Build.SourceVersion)

                    curl -sSL https://download.sourceclear.com/ci.sh | bash -s – scan  --allow-dirty --update-advisor --uri-as-name || true

          displayName: 'Veracode SCA - Agent-Based Scan' 

     

    Windows 

    1. For windows agent pools, you'll need to create a Windows agent   image
    2. Click into it and then select "Power Shell"
    3. Create the same variable into Azure Pipelines called SRCCLR_API_TOKEN
    4. Click on "create and generate token" and put the token value into Variable on Azure Pipelines
    5. Run the script bellow into a powershell task

     

    $env:SRCCLR_API_TOKEN

    $env:SRCCLR_API_TOKEN='$(SRCCLR_API_TOKEN)'

    $env:SRCCLR_SCM_URI='$(Build.Repository.Uri)'

    $env:SRCCLR_SCM_REF='$(Build.SourceBranchName)'

    $env:SRCCLR_SCM_REF_TYPE='branch'

    $env:SRCCLR_SCM_REV='$(Build.SourceVersion)'

     

    Set-ExecutionPolicy AllSigned -Scope Process -Force

     

    $ProgressPreference = "silentlyContinue"; iex ((New-Object System.Net.WebClient).DownloadString('https://download.sourceclear.com/ci.ps1'))

     

    srcclr scan $(local path that you app is in)

     

    ---

    Note: always review the pre requeriments for your language, example:

    .NET >> https://docs.veracode.com/r/c_sc_net

    Java >> https://docs.veracode.com/r/c_sc_java

    JavaScript >> https://docs.veracode.com/r/c_sc_javascript

    Expand Post
    Selected as Best
  •  @Sohlae (Community Member)​ 

     

    For SCA Agent-based scans:

     

    Set up and agent scan and workspace

    1. Access the Platform >> Scans & Analysis >> Software Composition Analysis >> Agent based Scans >> Actions >> Create a workspace >> give a name >> Click on 'More Options" >> Select the teams that you would like to share the reports
    2. Enter into workspace created >> left side >> click on Agents
    3. Now you can create agents based on Operate System that yours pipelines works

     

    Linux/Mac agent pools

    1. Into agents, click on green button "Actions" >> create >> select any Integration options like bellow

    image 

    1. Click "create and generate token"
    2. Into your Azure Pipelines, create a variable into it named as SRCCLR_API_TOKEN and the value must be the token generated earlier
    3. Now, you can run SCA agent-based scan running a script like bellow:

     - task: CmdLine@2

          inputs:

            script: |

                    export SRCCLR_API_TOKEN=$(SRCCLR_API_TOKEN)

                    export SRCCLR_SCM_URI=$(Build.Repository.Uri)

                    export SRCCLR_SCM_REF=$(Build.SourceBranchName)

                    export SRCCLR_SCM_REF_TYPE="branch"

                    export SRCCLR_SCM_REV=$(Build.SourceVersion)

                    curl -sSL https://download.sourceclear.com/ci.sh | bash -s – scan  --allow-dirty --update-advisor --uri-as-name || true

          displayName: 'Veracode SCA - Agent-Based Scan' 

     

    Windows 

    1. For windows agent pools, you'll need to create a Windows agent   image
    2. Click into it and then select "Power Shell"
    3. Create the same variable into Azure Pipelines called SRCCLR_API_TOKEN
    4. Click on "create and generate token" and put the token value into Variable on Azure Pipelines
    5. Run the script bellow into a powershell task

     

    $env:SRCCLR_API_TOKEN

    $env:SRCCLR_API_TOKEN='$(SRCCLR_API_TOKEN)'

    $env:SRCCLR_SCM_URI='$(Build.Repository.Uri)'

    $env:SRCCLR_SCM_REF='$(Build.SourceBranchName)'

    $env:SRCCLR_SCM_REF_TYPE='branch'

    $env:SRCCLR_SCM_REV='$(Build.SourceVersion)'

     

    Set-ExecutionPolicy AllSigned -Scope Process -Force

     

    $ProgressPreference = "silentlyContinue"; iex ((New-Object System.Net.WebClient).DownloadString('https://download.sourceclear.com/ci.ps1'))

     

    srcclr scan $(local path that you app is in)

     

    ---

    Note: always review the pre requeriments for your language, example:

    .NET >> https://docs.veracode.com/r/c_sc_net

    Java >> https://docs.veracode.com/r/c_sc_java

    JavaScript >> https://docs.veracode.com/r/c_sc_javascript

    Expand Post
    Selected as Best
  • Sohlae (Community Member)

    @lucas.ferreira (M3Corp)​, there doesn't seem to be an option for Azure DevOps in the Integration Options section. 

      • Sohlae (Community Member)

        I would prefer to stick with the official way of doing this. I tried to generate a token using Travis CI and added it under the SRCCLR_API_TOKEN as you have instructed, however I received this error.

         

        There was a problem authenticating with Veracode SCA. Please double check your Veracode SCA agent credentials or the value of the env variable "SRCCLR_API_TOKEN".

         

        Can you help me with this, please?

        Expand Post
  • Sohlae (Community Member)

    It's working now, thank you!

Topics (1)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.