Scanning with the Lineai .NET Agent (Docker)
The Lineai .NET Agent for Docker provides an easy way to integrate Lineai scanning into your build process.
Run the Docker Image
Section titled “Run the Docker Image”Pull and run the .NET agent image from your Lineai server registry:
docker run --pull always --rm --interactive \ --env LINEAI_HOST="https://yourinstance.app.lineai.com/lineai/server/" \ --env AGENT_UUID="your-agent-uuid" \ --env AGENT_PASSWORD="your-agent-password" \ --volume /path/to/scan:/scan \ yourinstance.app.lineai.com/lineai_dotnet:latest \ --application "Your Application" \ --path /scanDocker options:
- —pull always — ensures that you always get the newest image
- —env LINEAI_HOST — Lineai server URL
- —env AGENT_UUID / —env AGENT_PASSWORD — agent credentials
- —volume — mounts the host directory to scan into the container
- See Docker Documentation for more options.
Optional filters and database targets use NetCapePro CLI flags:
--application "Your Application" --path /scan --namespace com.example --include MyAssembly --database jdbc:postgresql://localhost:5432/sampledbFor the native Windows agent CLI, see Binary Scanning via Command Line (.NET).
CI/CD Scanning
Section titled “CI/CD Scanning”Using the Docker agent with Jenkins
Section titled “Using the Docker agent with Jenkins”The Lineai .NET Agent for Docker can be used to scan artifacts in Jenkins pipelines.
Example:
stage('Lineai Scan EKS') { when { expression { BRANCH_NAME ==~ /(integration|v.*|feature\/.*)/ } } steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { // Publish Lineai Scan sh(''' docker run --pull always --rm --interactive \ --env LINEAI_HOST="https://yourinstance.app.lineai.com/lineai/server/" \ --env "AGENT_UUID=${AGENT_UUID}" \ --env "AGENT_PASSWORD=${AGENT_PASSWORD}" \ --volume "${WORKSPACE}/path/to/assemblies":/scan \ yourinstance.app.lineai.com/lineai_dotnet:latest \ --application "Your Application" \ --path /scan \ --scan-space-name "Development" \ --namespace Example \ --include Example \ --rescan \ --expunge-scan-sessions ''') } }}