.NET Core installation and configuration in a container
Use this workflow with the Add New .NET Core agent wizard to ensure you have all the steps covered for installing and configuring the .NET Core agent with a container. Using the wizard is the simplest way to deploy a new agent.
Before you begin
Make sure you have everything you need before you start.
The agent will need to be able to reach your Contrast instance. It can be a local/on-premise instance or a hosted instance. A proxy can be configured if the environment has limited network access.
It must use supported technologies and system requirements.
Understand the order of precedence.
You will also need access to a command line interface (with a chosen directory for downloading the agent) and your organization's instance of Contrast.
Start the .NET Core agent wizard
Open the agent wizard:
Northstar: From the left navigation, select Administration > Agent management. Then, select Add agent at the top of the view.
Contrast: Use either of these options:
From the header, select Add New and then, select the Application card.
Select Administration > Agent management. Then, select Add agent at the top of the view.
Under Select a language, select .NET Core.
Select the operating system you are using.
Select method to deploy with containers
Under Select application deployment method, select Install in a container.
Under Select method, to deploy containers, select Dockerfile or Kubernetes (Linux only).
Dockerfile: Build image with agent
Under Build image with agent, copy the displayed commands and add them to your Dockerfile.
Use the displayed command to build the image.
Dockerfile: Configure the agent
Under Configure the agent, select the best options to get the configuration details that the agent needs to communicate with Contrast. The following steps may or may not apply to your configuration steps.
Optionally, select Register the application.
When you register an application, you can assign it to groups for access control. You can also assign tags and metadata to the application.
Select Use Connection Token.
This configuration method uses a single variable to specify authentication values. The Connection Token is the recommended configuration option.
Copy the displayed code and run the commands to pass the connection token to the container as an environment variable at startup.
Kubernetes: (Linux and OS X only)
Under Select method to configure agent operator, select Helm (recommended) or Manifest.
For Helm:
Under Download and set up files, copy the displayed commands to create a values file. Skip this step if the operator is already installed.
Under Install and deploy Helm chart, copy the displayed commands to complete the configuration. Skip this step if the operator is already installed.
Label your namespaces to add
AgentInjectors.kubectl label namespace/<YourNamespaceName> agents.contrastsecurity.com/agent-injectors=true
Under Label the deployments, use the displayed commands to label your deployments.
For Manifest:
Under Install operator, copy the displayed commands to install the Contrast agent operator.
Under Configure operator, copy the displayed commands to configure the Contrast agent operator.
Under Configure injector, copy or download the
clusterAgentInjector.yamlLabel your namespaces to add
AgentInjectors.kubectl label namespace/<YourNamespaceName> agents.contrastsecurity.com/agent-injectors=true
Under Label the deployments, use the displayed commands to label your deployments.
Optionally, under Configure cluster agent and cluster, copy the displayed commands to configure these entities.
Verify the agent deployment
Interact with your application as you normally would. For example, interact with your application's web interface or send API commands.
Select Administration, then Agent management to verify that your agent appears in the list.
Verify that you see the name of your application in the list.
Select Servers in the header.
Verify that you see the name of your local server in the list.