Runtime Scanning (.NET)
When you run a runtime scan of your .NET application or IIS (web application) with Lineai you can view item dependencies you might not see with a binary scan, such as dynamically generated web calls.
Configure and Run the Agent
Section titled “Configure and Run the Agent”-
Edit the file:
C:\Program Files (x86)\Lineai\NetCape\NetCape.json. Replace all instances of127.0.0.1with the your Lineai URL. -
Open the Windows Command Line as an Administrator.
-
Run the Agent with your configuration options:
Terminal window Options:-p|--path [Required, SingleSpecification]Path to the application to be analyzed.[Example: --path=OtherFolder/Example.dll]-g|--show-compiler-generated [Optional, SingleSpecification, NoValue][Default: false. Will not show compiler generated code in resulting graph.]Show compiler generated code.[Example: -g]-pta|--pass-through-args [Optional, SingleSpecification][Default: null]Argument string to pass to the application being profiled.[Example: --pta "--some-flag"]--profiler [Optional, SingleSpecification][Default: <automatically detected by Agent>]Path to profiler. Use this option only when one of the following occurs:1) The Agent is unable to determine the 'bitness' of the target application (x86/x64)2) The profiler dll is not in the installation directory.[Example: --profiler "C:/location/profiler.dll"]--session [Optional, SingleSpecification][Default: <random guid>]SessionId to use. Under normal use, allow the Agent to generate this id.[Example: --session "babd9f45-9f56-4f2f-bf7f-a43bfca34b91"]-v|--verbose [Optional, SingleSpecification, NoValue][Default: false. Will not show verbose output.]Show verbose output.[Example: -v]-i|--iis [Windows Only][ConditionallyRequired, SingleSpecification, NoValue][Required If: '--path' is not given.]Analyzes IIS websites on this machine.[Example: -i]-ap|--application-pool [Optional, SingleSpecification][Default: DefaultAppPool]When Scanning IIS, the name of the ApplicationPool that will be executing the profiler.[Example: --application-pool "MyAppPool"]--force-registration [Optional, SingleSpecification, NoValue][Default: false. Will attempt to use known agent credentials if they exist.]Deletes previously generated agent credentials and forces the agent to reregister itself.This option is useful in instances where credentials have been revoked or are invalid, but can otherwise be ignored.[Example: --force-registration]-e|--expunge-scan-sessions [Optional, SingleSpecification, NoValue][Default: false - Keeps old data in addition to data found in this scan.]Marks data from previous scans found with the same ScanConfiguration fingerprint as ready to be pruned or garbage collected from the database.Useful in continuous integration pipelines where only the scan of the latest build should be kept.[Example: --expunge-scan-sessions]-?|-h|--help Show help information.Example Code for scanning an application
Terminal window > & 'C:\Program Files (x86)\Lineai\NetCape\NetCape.Profiler\ProfilerAgent.exe' C:\Program Files\MyApplication\MyApplication.exeIn the example above we are configuring the agent to run a scan on an application named MyApplication.
Example Code for scanning iis (web application)
Terminal window > & 'C:\Program Files (x86)\Lineai\NetCape\NetCape.Profiler\ProfilerAgent.exe' -iIn the example above we are configuring the agent to run a scan on IIS for a web application named WebApplication.
Authorize the Agent
Section titled “Authorize the Agent”For security, agents must be authorized before they will send metadata to Lineai.
Obtain AGENT_UUID and AGENT_PASSWORD from your Lineai administrator, or set these environment variables before starting the agent. If credentials are not pre-provisioned, the agent may register with the server and await administrator approval before scans are accepted.
Scanning
Section titled “Scanning”Scan Application
Section titled “Scan Application”- In the Windows Command Line terminal you will see
Profiler connected. Sending configuration.and the application you specified will open. - Click through your application to gather the metadata.
Scan IIS (Web Application)
Section titled “Scan IIS (Web Application)”- In the Windows Command Line terminal you will see
Profiler connected. Sending configuration.. - Open your browser and go to your web application.
- Click through your web application to gather the metadata.
Stop the Scan
Section titled “Stop the Scan”Stop Scan – Application
Section titled “Stop Scan – Application”- Close your application to stop the runtime scan.
Stop Scan – IIS (Web Application)
Section titled “Stop Scan – IIS (Web Application)”-
To stop the scan, restart IIS from a new Windows Command Line terminal as an Administrator.
Terminal window > iisreset
Next Steps: To scan another application or IIS (web application), repeat these steps. It will not be necessary to repeat the authorization step if you are rescanning the same application.