Windows hosts
About Windows host installs
To deploy the enforcer to a Windows host, use one of the following procedures.
Procedure | Installation method | Install authentication | Registration and connection authentication | Discussion |
---|---|---|---|---|
Short-lived token from AWS, GCP, or Azure | Short-lived token from AWS, GCP, or Azure | Requires no credentials saved on the host. You can run the procedure once, make an image of the host with the enforcer installed, and distribute the image. | ||
Least-privilege app credential | The short-lived Microsegmentation token can include various restrictions to make it more comfortable to pass around. | |||
Manual | Least-privilege app credential | Does not require apoctl to be installed on the target host. Suitable for air-gapped environments. |
Cloud install
- Ensure that you meet the following prerequisites.EntityRequirementTarget hostLocal hostPrivileges
- namespace.administrator privileges in the target Microsegmentation namespace
- Administrator access to the target instance
Cloud credentials - Construct a Microsegmentation tag that identifies your cloud account, project, tenant, or organization.The tag must begin with @auth: followed by a key-value pair. Refer to the table below for some common examples.Cloud providerValueMicrosegmentation tag syntaxMicrosegmentation tag exampleAzureMicrosoft tenant ID21You can find your AWS account ID underMy security credentialsin the AWS Management Console.2To learn how to find your tenant ID, refer to the Microsoft documentation.
- On your local host, set a CLOUD_ID_TAG environment variable containing the Microsegmentation tag you’ve constructed to identify authorized enforcers.If the target virtual machine is hosted on AWS, also set an AWS_IAM_ROLE environment variable containing the name of the IAM role attached to the instance prepended with @auth:rolename=. See below for examples.
- Windows local host:AWS$env:CLOUD_ID_TAG="@auth:account=942613894219" $env:AWS_IAM_ROLE="@auth:rolename=aporeto"GCP$env:CLOUD_ID_TAG="@auth:projectid=acme-dev"Azure$env:CLOUD_ID_TAG="@auth:tenantid=cd629cb5-2826-4126-82fd-3f2df5f5bc7"macOS/Linux local host:AWSexport CLOUD_ID_TAG="@auth:account=942613894219" export AWS_IAM_ROLE="@auth:rolename=aporeto"GCPexport CLOUD_ID_TAG="@auth:projectid=acme-dev"Azureexport CLOUD_ID_TAG="@auth:tenantid=cd629cb5-2826-4126-82fd-3f2df5f5bc7"Set a TARGET_NS environment variable containing the Microsegmentation namespace of this enforcer.It should be a grandchild namespace.Windows$env:TARGET_NS="/acme/aws-dev/vm1"macOS/Linuxexport TARGET_NS=/acme/aws-dev/vm1Use one of the following commands to create an API authorization that allows the enforcer to access the Microsegmentation Console.Select the tab that corresponds to the cloud provider of the target host and whether or not you are using the optional mapping.
- Windows local host:AWSSet-Content -Path enf-api-auth.yml -Value @" APIVersion: 0 label: ec2-enforcerd-auth data: apiauthorizationpolicies: - authorizedIdentities: - '@auth:role=enforcer' authorizedNamespace: $($env:TARGET_NS) authorizedSubnets: [] name: Authorize EC2 enforcer to access Microsegmentation Console propagate: true subject: - - "@auth:realm=awssecuritytoken" - "$($env:AWS_IAM_ROLE)" - "$($env:CLOUD_ID_TAG)" "@ ; if ($?) { apoctl api import -f enf-api-auth.yml }GCPSet-Content -Path enf-api-auth.yml -Value @" APIVersion: 0 label: gcp-enforcerd-auth data: apiauthorizationpolicies: - authorizedIdentities: - '@auth:role=enforcer' authorizedNamespace: $($env:TARGET_NS) authorizedSubnets: [] name: Authorize GCP enforcer to access Microsegmentation Console propagate: true subject: - - "@auth:realm=gcpidentitytoken" - "$($env:CLOUD_ID_TAG)" "@ ; if ($?) { apoctl api import -f enf-api-auth.yml }AzureSet-Content -Path enf-api-auth.yml -Value @" APIVersion: 0 label: azure-enforcerd-auth data: apiauthorizationpolicies: - authorizedIdentities: - '@auth:role=enforcer' authorizedNamespace: $($env:TARGET_NS) authorizedSubnets: [] name: Authorize Azure enforcer to access Microsegmentation Console propagate: true subject: - - "@auth:realm=azureidentitytoken" - "$($env:CLOUD_ID_TAG)" "@ ; if ($?) { apoctl api import -f enf-api-auth.yml }macOS/Linux local host:AWScat << EOF | apoctl api import -f - APIVersion: 0 label: ec2-enforcerd-auth data: apiauthorizationpolicies: - authorizedIdentities: - '@auth:role=enforcer' authorizedNamespace: $TARGET_NS authorizedSubnets: [] name: Authorize EC2 enforcer to access Microsegmentation Console propagate: true subject: - - "@auth:realm=awssecuritytoken" - "$AWS_IAM_ROLE" - "$CLOUD_ID_TAG" EOFGCPcat << EOF | apoctl api import -f - APIVersion: 0 label: gcp-enforcerd-auth data: apiauthorizationpolicies: - authorizedIdentities: - '@auth:role=enforcer' authorizedNamespace: $TARGET_NS authorizedSubnets: [] name: Authorize GCP enforcer to access Microsegmentation Console propagate: true subject: - - "@auth:realm=gcpidentitytoken" - "$CLOUD_ID_TAG" EOFAzurecat << EOF | apoctl api import -f - APIVersion: 0 label: azure-enforcerd-auth data: apiauthorizationpolicies: - authorizedIdentities: - '@auth:role=enforcer' authorizedNamespace: $TARGET_NS authorizedSubnets: [] name: Authorize Azure enforcer to access Microsegmentation Console propagate: true subject: - - "@auth:realm=azureidentitytoken" - "$CLOUD_ID_TAG" EOFRetrieve the URL of your Microsegmentation Console API.Windowsecho $Env:MICROSEG_APImacOS/Linuxecho $MICROSEG_APIAccess the target host, such as via Microsoft Remote Desktop.Set a MICROSEG_API environment variable containing the URL of your Microsegmentation Console API that you just echoed on your local host.$env:MICROSEG_API="https://api.microsegmentation.acme.co"Confirm that the host can connect to the Microsegmentation Console API and trusts its certificate.Invoke-WebRequest -URI $($env:MICROSEG_API)Set a TARGET_NS environment variable containing the Microsegmentation namespace of this enforcer.It should be a grandchild namespace.$env:TARGET_NS="/acme/aws-dev/vm1"Download the apoctl MSI to the target host and execute it in quiet mode.curl https://download.aporeto.com/releases/release-5.0.12/apoctl/windows/apoctl.msi -o apoctl.msi; ` if ($?) {. .\apoctl.msi /quiet} if ($?) {$env:PATH+="C:\Program Files\Apoctl;"}Use the following command to install the enforcer.apoctl enforcer install windows --auth-mode cloud ` --namespace $($env:TARGET_NS) ` --api $($env:MICROSEG_API) ` --repo https://repo.aporeto.com/releases/release-5.0.12/windows/prisma-enforcer.msiRefer to Enforcer configuration options if you wish to modify the enforcer’s default settings. You can also run apoctl enforcer install windows -h to review its flags. You can find more information about the enforcer install windows command in the apoctl.Open the Microsegmentation Console web interface, selectEnforcersunderManage, and navigate to the enforcer’s namespace.You should find your enforcer listed with a status ofconnected. Click the enforcer and review its metadata.SelectPlatformin the side navigation menu.You should see your host as a processing unit, with a dashed green line to a Somewhere external network. Your host is in discovery mode.Return to your Remote Desktop session.Start-Process msiexec.exe -ArgumentList '/x apoctl.msi /quiet' -Wait ; ` if($?) {rm 'apoctl.msi'} ; ` if($?) {rm '.apoctl' -r -fo}Refer to Securing host communications to learn how to allow the desired traffic and disable discovery mode.On-premise install
- Make sure you meet the following prerequisites.EntityRequirementTarget host(s)Local hostPrivileges
- namespace.administrator privileges in the Microsegmentation namespace of the target host
- Administrator access to the target host
- From your local host, generate a short-lived Microsegmentation token that the enforcer can exchange for an app credential.You can set a variety of restrictions on this token. If you’re in a hurry, just copy and paste the minimally restricted example below. The other tabs illustrate optional additional restrictions, such as requiring the enforcer to register in a specified namespace or make its request from a specific subnet.
- macOS/Linux local hostMinimally restricted exampleapoctl auth appcred --path ~/.apoctl/default.creds \ --restrict-role @auth:role=enforcer \ --restrict-role @auth:role=enforcer-installer \ --validity 60mFully restricted exampleapoctl auth appcred --path ~/.apoctl/default.creds \ --restrict-role @auth:role=enforcer \ --restrict-role @auth:role=enforcer-installer \ --validity 60m \ --restrict-namespace /acme/aws-dev/vm1 \ --restrict-network 10.0.0.0/8Syntaxapoctl auth appcred --path <app-credential-file> \ --restrict-role @auth:role=enforcer \ @auth:role=enforcer-installer \ --validity <golang-duration> \ [--restrict-namespace <namespace>] \ [--restrict-network <cidr>]Windows local hostMinimally restricted exampleapoctl auth appcred --path '.apoctl/default.creds' ` --restrict-role @auth:role=enforcer ` --restrict-role @auth:role=enforcer-installer ` --validity 60mFully restricted exampleapoctl auth appcred --path '.apoctl/default.creds' ` --restrict-role @auth:role=enforcer ` --restrict-role @auth:role=enforcer-installer ` --validity 60m ` --restrict-namespace /acme/aws-dev/vm1 ` --restrict-network 10.0.0.0/8Syntaxapoctl auth appcred --path <app-credential-file> ` --restrict-role @auth:role=enforcer ` @auth:role=enforcer-installer ` --validity <golang-duration> ` [--restrict-namespace <namespace>] ` [--restrict-network <cidr>]Retrieve the URL of your Microsegmentation Console API.macOS/Linuxecho $MICROSEG_APIWindowsecho $Env:MICROSEG_APIAccess the target host, such as via Microsoft Remote Desktop.Set a TOKEN environment variable containing the token you just generated.We’ve truncated the example token value below for readability.$env:TOKEN="eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZWFsbSI6IkNlcnRpZmljYXRlIiwiZGF0YSI6eyJjb21tb25O...."Set a MICROSEG_API environment variable containing the URL of your Microsegmentation Console API.You can copy and paste this value from your local host terminal where you just echoed it.$env:MICROSEG_API="https://api.microsegmentation.acme.co"Confirm that the host can connect to the Microsegmentation Console API and trusts its certificate.Invoke-WebRequest -URI $($env:MICROSEG_API)Set a TARGET_NS environment variable containing the Microsegmentation namespace of this enforcer.It should be a grandchild namespace.$env:TARGET_NS="/acme/aws-dev/vm1"Download the apoctl MSI to the target host and execute it in quiet mode.curl https://download.aporeto.com/releases/release-5.0.12/apoctl/windows/apoctl.msi -o apoctl.msi; ` if ($?) {. .\apoctl.msi /quiet} if ($?) {$env:PATH+="C:\Program Files\Apoctl;"}Use the following command to install the enforcer.apoctl enforcer install windows --token $($env:TOKEN) ` --auth-mode appcred ` --namespace $($env:TARGET_NS) ` --api $($env:MICROSEG_API) ` --repo https://repo.aporeto.com/releases/release-5.0.12/windows/prisma-enforcer.msiRefer to Enforcer configuration options if you wish to modify the enforcer’s default settings. You can also run apoctl enforcer install windows -h to review its flags. You can find more information about the enforcer install windows command in the apoctl.Open the Microsegmentation Console web interface, selectEnforcersunderManage, and navigate to the enforcer’s namespace.You should find your enforcer listed with a status ofconnected. Click the enforcer and review its metadata.SelectPlatformin the side navigation menu.You should see your host as a processing unit, with a dashed green line to a Somewhere external network. Your host is in discovery mode.Return to your Remote Desktop session.Uninstall apoctl, remove the apoctl.msi file, remove the .apoctl directory, and clear the TOKEN variable.Start-Process msiexec.exe -ArgumentList '/x apoctl.msi /quiet' -Wait ; ` if($?) {rm 'apoctl.msi'} ` if($?) {$env:TOKEN=""} ; ` if($?) {rm '.apoctl' -r -fo}Refer to Securing host communications to learn how to allow the desired traffic and disable discovery mode.Advanced on-premise install
- From your local host, generate a short-lived Microsegmentation token that the enforcer can exchange for an app credential.apoctl auth appcred --path .apoctl/default.creds --restrict-role @auth:role=enforcer --restrict-role @auth:role=enforcer-installer --validity 60mAccess the target host, such as via Microsoft Remote Desktop.Set a TOKEN environment variable containing the token you just generated. We’ve truncated the example token value below for readability.$env:TOKEN="eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZWFsbSI6IkNlcnRpZmljYXRlIiwiZGF0YSI6eyJjb21tb25O...."Set a MICROSEG_API environment variable containing the URL of your Microsegmentation Console API.$env:MICROSEG_API="https://"Confirm that the host can connect to the Microsegmentation Console API and trusts its certificate.Invoke-WebRequest -UseBasicParsing -URI $($env:MICROSEG_API)Set a TARGET_NS environment variable containing the Microsegmentation namespace of this enforcer. It should be a grandchild namespace.$env:TARGET_NS="/acme/aws-dev/vm1"We will pull the images from your Microsegmentation Console.You can review the metadata at $MICROSEG_API/_meta/config. Use the following commands to set environment variables containing the paths to your TUF repository and MSI download location.$env:TUF_REPO=((Invoke-WebRequest -UseBasicParsing $env:MICROSEG_API/_meta/config).Content | Select-String """tuf"": ""(.*)""").Matches.Groups[1].Value $env:MSI_REPO=((Invoke-WebRequest -UseBasicParsing $env:MICROSEG_API/_meta/config).Content | Select-String """repo"": ""(.*)""").Matches.Groups[1].ValueDownload the enforcer installer.curl $env:MSI_REPO/windows/prisma-enforcer.msi -o prisma-enforcer.msiInstall the enforcer.msiexec /i prisma-enforcer.msi /q /Lmeow prisma-enforcer.msi.logOptionally, verify the installation by checking that the service is installed and the prisma-enforcer.conf file exists. Any installer errors should be reported in the prisma-enforcer.msi.log fileGet-Service "Prisma Enforcer" Test-Path "$env:ProgramData\prisma-enforcer\prisma-enforcer.conf"Setup the configuration.(Get-Content $env:ProgramData\prisma-enforcer\prisma-enforcer.conf).replace('/var/lib', 'C:/ProgramData') | Set-Content $env:ProgramData\prisma-enforcer\prisma-enforcer.conf Add-Content -Path $env:ProgramData\prisma-enforcer\prisma-enforcer.conf -Value "CNS_AGENT_TOKEN=""$env:TOKEN""" Add-Content -Path $env:ProgramData\prisma-enforcer\prisma-enforcer.conf -Value "ENFORCERD_TOKEN=""$env:TOKEN""" Add-Content -Path $env:ProgramData\prisma-enforcer\prisma-enforcer.conf -Value "ENFORCERD_PERSIST_CREDENTIALS=""true""" Add-Content -Path $env:ProgramData\prisma-enforcer\prisma-enforcer.conf -Value "ENFORCERD_API=""$env:MICROSEG_API""" Add-Content -Path $env:ProgramData\prisma-enforcer\prisma-enforcer.conf -Value "ENFORCERD_ENABLE_HOST_MODE=""true""" Add-Content -Path $env:ProgramData\prisma-enforcer\prisma-enforcer.conf -Value "ENFORCERD_NAMESPACE=""$env:TARGET_NS""" Add-Content -Path $env:ProgramData\prisma-enforcer\prisma-enforcer.conf -Value "CNS_AGENT_TUF_REPO=""$env:TUF_REPO"""Optionally, watch enforcer log file for progress in a separate Powershell window.while ($true) { if (!(Test-Path "$env:ProgramData\prisma-enforcer\enforcerd\log\enforcer.log" -PathType Leaf -ErrorAction SilentlyContinue)) { Write-Output "Waiting for enforcer to start..." Start-Sleep 1 continue } Get-Content -Path "$env:ProgramData\prisma-enforcer\enforcerd\log\enforcer.log" -Wait break }Start the enforcer.Start-Service "Prisma Enforcer"Enforcer configuration optionsThe enforcer exposes the following configuration options at startup. To modify the configuration of a running enforcer, you must restart it. To modify the enforcer’s tags, you have to also delete the enforcer object from the Microsegmentation Console.You can modify the default configuration by passing the flags with apoctl enforcer install linux as the value of --raw-flags. Example: apoctl enforcer install linux --raw-flags "--log-level=debug --log-format=human --log-to-console=true"enforcer flagDescriptionPass this flag if you wish to recognize the Microsegmentation Console as a processing unit, allowing its communications to be monitored and controlled. By default, the enforcer ignores them.The URL of the Microsegmentation Console API.Path to CA certificate.Disables check on certificate signature as trusted.Path to application credentials.Start of the port range for ports used by the enforcer application proxy. Defaults to 20992. You may adjust this if you experience conflicts.The enforcer can determine if it is running in a cloud environment, such as AWS, GCP, or Azure. This is the maximum amount of time to wait for these internal probes to complete. Defaults to two seconds: 2sPass this flag to disable the enforcer DNS proxy, which allows policies to be written based on FQDN, in cases where an exact IP address may be unpredictable.DNS server address or CIDR that is observed by the enforcer DNS proxy. Defaults to 0.0.0.0/0.(Beta) Pass this flag to gain performance improvements by using extended Berkeley Packet Filter (eBPF) on systems that support it.The enforcer ignores IPv6 communications by default. If you have IPv6 enabled and wish to monitor and control these connections, pass this flag.Controls whether the enforcer’s logs are written to stdout. Boolean that defaults to false.The Microsegmentation namespace the enforcer should register in.Microsegmentation tag for this enforcerMicrosegmentation token for the enforcer to use to register to the Microsegmentation Console.A persistent working directory with write, read, and execute permissions. Files such as logs are stored here. Defaults to %PROGRAMDATA%\enforcerd
Most Popular
Recommended For You
Recommended Videos
Recommended videos not found.