Complete guide for configuring Fluid Attacks' PR/MR scanner with Azure DevOps pipelines.
This guide covers the setup process for integrating Smells security analysis into Azure DevOps pipelines, including token creation, variable configuration, and pipeline examples.
Smells Security Analysis
Scope | Permission | Purpose |
---|---|---|
Code | Read & write | Access repository content and pull requests |
Configure these variables in your Azure DevOps project:
Variable Name | Description | Type |
---|---|---|
FLUIDATTACKS_JWT | JWT token for Fluid Attacks API | Secret |
AZURE_TOKEN | Personal Access Token created above | Secret |
These are automatically provided by Azure DevOps:
Variable Name | Description | Auto-Populated |
---|---|---|
SYSTEM_TEAMFOUNDATIONCOLLECTIONURI | Organization URI | ✅ |
SYSTEM_TEAMPROJECT | Project name | ✅ |
BUILD_REPOSITORY_ID | Repository UUID | ✅ |
SYSTEM_PULLREQUEST_PULLREQUESTID | Pull request ID | ✅ (PR builds only) |
smells-secrets
FLUIDATTACKS_JWT = [your-jwt-token] (Secret) AZURE_TOKEN = [your-pat-token] (Secret)
Save the variable group
Alternatively, configure variables directly in the pipeline:
# azure-pipelines.yml trigger: none pool: name: 'agent-pools' jobs: - job: FluidAttacksAnalysis displayName: 'Fluid Attacks Analysis' steps: - checkout: self fetchDepth: 1 - bash: | docker run --rm \ -v "$(Build.SourcesDirectory):/src" \ -w /src \ -e SYSTEM_TEAMFOUNDATIONCOLLECTIONURI="$(System.TeamFoundationCollectionUri)" \ -e SYSTEM_TEAMPROJECT="$(System.TeamProject)" \ -e SYSTEM_PULLREQUEST_PULLREQUESTID="$(System.PullRequest.PullRequestId)" \ -e BUILD_REPOSITORY_ID="$(Build.Repository.ID)" \ -e AZURE_TOKEN="$(AZURE_TOKEN)" \ -e FLUIDATTACKS_JWT="$(FLUIDATTACKS_JWT)" \ fluidattacks/smells:latest smells-pipeline displayName: 'Executing Fluid Attacks Analysis' env: AZURE_TOKEN: $(AZURE_TOKEN) FLUIDATTACKS_JWT: $(FLUIDATTACKS_JWT) condition: eq(variables['Build.Reason'], 'PullRequest')
Your Azure DevOps user/service account needs:
Error: Invalid Azure DevOps token or insufficient permissions
Solutions:
Error: Neither GitLab nor Azure DevOps environment variables found
Solutions:
pr:
trigger is configured in YAMLError: Invalid organization format
Solutions:
SYSTEM_TEAMFOUNDATIONCOLLECTIONURI
format