Linux hosts
About Linux host installs
To deploy the enforcer to a Linux host not orchestrated by Kubernetes or OpenShift, use one of the following procedures.
Procedure | Installation method | Install authentication | Registration and connection authentication | Discussion |
---|---|---|---|---|
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
- Make sure you meet the following prerequisites.EntityRequirementTarget host(s)Local host
- SSH access to target host(s)
Privileges- namespace.administrator privileges in the Microsegmentation namespace of the target host
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=. For examples, see below.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 that this enforcer should register in.It should be a grandchild namespace.export 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.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.echo $MICROSEG_APIAccess the target host, such as via SSH.Set a MICROSEG_API environment variable on the target host containing the URL of the Microsegmentation Console API you just echoed on your local host.export MICROSEG_API=https://api.microsegmentation.acme.coConfirm that the host can connect to the Microsegmentation Console API and trusts its certificate.curl -fsL $MICROSEG_APISet a TARGET_NS environment variable containing the Microsegmentation namespace that this enforcer should register in.It should be a grandchild namespace.export TARGET_NS=/acme/aws-dev/vm1Install apoctl using the following command.sudo curl -o /usr/local/bin/apoctl \ https://download.aporeto.com/releases/release-5.0.12/apoctl/linux/apoctl && \ sudo chmod 755 /usr/local/bin/apoctlSelect the tab that corresponds to the init system of the host and run the provided commands to ensure that any local firewalls are disabled and stopped, as required.systemdsudo systemctl disable ufw sudo systemctl stop ufw sudo systemctl disable iptables sudo systemctl stop iptables sudo systemctl disable firewalld sudo systemctl stop firewalldupstartsudo disable ufw sudo stop ufw sudo disable iptables sudo stop iptables sudo disable firewalld sudo stop firewalldinitdsudo /etc/init.d/ufw disable sudo /etc/init.d/ufw stop sudo /etc/init.d/iptables disable sudo /etc/init.d/iptables stop sudo /etc/init.d/firewalld disable sudo /etc/init.d/firewalld stopUse the following command to install the enforcer.sudo apoctl enforcer install linux --auth-mode cloud \ --namespace $TARGET_NS \ --api $MICROSEG_API \ --repo https://repo.aporeto.com/releases/release-5.0.12Refer to Enforcer configuration options if you wish to modify the enforcer’s default settings. You can also run apoctl enforcer install linux -h to review its flags. You can find more information about the enforcer install linux 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 terminal on the target host.Remove apoctl.sudo rm /usr/local/bin/apoctlRefer to Securing host communications to learn how to allow the desired traffic and disable discovery mode.On-premise install
- Ensure that you meet the following prerequisites.EntityRequirementTarget host(s)* Meets the system requirements * Set up to synchronize time with authoritative sources * curl installed * Can connect to the Microsegmentation Console API without TLS interception * Can connect to any subdomain of aporeto.comLocal host* apoctl * SSH access to target host(s)Privileges* User account on target host can sudo to gain root privileges without entering a password
- 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.Minimally 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.echo $MICROSEG_APIAccess the target host, such as via SSH.Set a TOKEN environment variable containing the token you just generated.We’ve truncated the example token value below for readability.export TOKEN=eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZWFsbSI6IkNlcnRpZmljYXRlIiwiZGF0YSI6eyJjb21tb25O....Set a MICROSEG_API environment variable containing the URL of the Microsegmentation Console API you just retrieved.export MICROSEG_API=https://api.microsegmentation.acme.coConfirm that the host can connect to the Microsegmentation Console API and trusts its certificate.curl -fsL $MICROSEG_APISet a TARGET_NS environment variable containing the Microsegmentation namespace of this enforcer.It should be a grandchild namespace.export TARGET_NS=/acme/aws-dev/vm1Install apoctl using the following command.sudo curl -o /usr/local/bin/apoctl \ https://download.aporeto.com/releases/release-5.0.12/apoctl/linux/apoctl && \ sudo chmod 755 /usr/local/bin/apoctlSelect the tab that corresponds to the init system of the host and run the provided commands to ensure that any local firewalls are disabled and stopped, as required.systemdsudo systemctl disable ufw sudo systemctl stop ufw sudo systemctl disable iptables sudo systemctl stop iptables sudo systemctl disable firewalld sudo systemctl stop firewalldupstartsudo disable ufw sudo stop ufw sudo disable iptables sudo stop iptables sudo disable firewalld sudo stop firewalldinitdsudo /etc/init.d/ufw disable sudo /etc/init.d/ufw stop sudo /etc/init.d/iptables disable sudo /etc/init.d/iptables stop sudo /etc/init.d/firewalld disable sudo /etc/init.d/firewalld stopUse the following command to install the enforcer.sudo apoctl enforcer install linux --token $TOKEN \ --auth-mode appcred \ --namespace $TARGET_NS \ --api $MICROSEG_API \ --repo https://repo.aporeto.com/releases/release-5.0.12Refer to Enforcer configuration options if you wish to modify the enforcer’s default settings. You can also run apoctl enforcer install linux -h to review its flags. You can find more information about the enforcer install linux 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 terminal on the target host.sudo rm /usr/local/bin/apoctl export TOKEN=""Refer to Securing host communications to learn how to allow the desired traffic and disable discovery mode.Advanced on-premise install
- Ensure that you meet the following prerequisites.EntityRequirementTarget host(s)
- curl installed
- Can connect to the Microsegmentation Console API without TLS interception
- Can connect to any subdomain of aporeto.com
Local host- SSH access to target host(s)
Privileges- namespace.administrator privileges in the Microsegmentation namespace of the target host
- User account on target host can sudo to gain root privileges without entering a password
- 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.Minimally restricted exampleapoctl auth appcred --path ~/.apoctl/default.creds \ --restrict-role @auth:role=enforcer \ --validity 60mFully restricted exampleapoctl auth appcred --path ~/.apoctl/default.creds \ --restrict-role @auth:role=enforcer \ --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 \ --validity <golang-duration> \ [--restrict-namespace <namespace>] \ [--restrict-network <cidr>]Retrieve the URL of your Microsegmentation Console API.echo $MICROSEG_APIAccess the target host, such as via SSH.Set a TOKEN environment variable containing the token you just generated.We’ve truncated the example token value below for readability.export TOKEN=eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZWFsbSI6IkNlcnRpZmljYXRlIiwiZGF0YSI6eyJjb21tb25O....Set a MICROSEG_API environment variable containing the URL of the Microsegmentation Console API you just retrieved.export MICROSEG_API=https://api.microsegmentation.acme.coConfirm that the host can connect to the Microsegmentation Console API and trusts its certificate.curl -fsL $MICROSEG_APIWe 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, the RPM/DEB repository, and the GPG key used to sign the packages.TUF_REPO="$(curl -sfSL $MICROSEG_API/_meta/config | sed -n 's/"//g;s/,//;s/.*tuf: //p;')" RPM_DEB_REPO="$(curl -sfSL $MICROSEG_API/_meta/config | sed -n 's/"//g;s/,//;s/.*repo: //p;')" GPG_KEY="$(curl -sfSL $MICROSEG_API/_meta/config | sed -n 's/"//g;s/,//;s/.*repo-signing-key: //p;')"Set a TARGET_NS environment variable containing the Microsegmentation namespace of this enforcer.It should be a grandchild namespace.export TARGET_NS=/acme/aws-dev/vm1Select the tab that corresponds to the init system of the host and run the provided commands to ensure that any local firewalls are disabled and stopped, as required.systemdsudo systemctl disable ufw sudo systemctl stop ufw sudo systemctl disable iptables sudo systemctl stop iptables sudo systemctl disable firewalld sudo systemctl stop firewalldupstartsudo disable ufw sudo stop ufw sudo disable iptables sudo stop iptables sudo disable firewalld sudo stop firewalldinitdsudo /etc/init.d/ufw disable sudo /etc/init.d/ufw stop sudo /etc/init.d/iptables disable sudo /etc/init.d/iptables stop sudo /etc/init.d/firewalld disable sudo /etc/init.d/firewalld stopUse the command that corresponds to the operating system of the target host to download and install the enforcer.Ubuntucurl -fsL $GPG_KEY | sudo apt-key add - echo "deb [arch=$(dpkg --print-architecture)] \ $RPM_DEB_REPO/ubuntu/$(lsb_release -cs) aporeto main" \ | sudo tee /etc/apt/sources.list.d/aporeto.list sudo apt update sudo apt install -y prisma-enforcerDebiansudo apt install -y apt-transport-https curl -fsL $GPG_KEY | sudo apt-key add - echo "deb [arch=$(dpkg --print-architecture)] \ $RPM_DEB_REPO/debian/$(lsb_release -cs) aporeto main" \ | sudo tee /etc/apt/sources.list.d/aporeto.list sudo apt update sudo apt install -y prisma-enforcerCentOScat << EOF | sudo tee /etc/yum.repos.d/Aporeto.repo [Aporeto] name=aporeto baseurl=$RPM_DEB_REPO/centos/\$releasever/ gpgkey=$GPG_KEY gpgcheck=1 repo_gpgcheck=1 enabled=1 EOF sudo yum install -y prisma-enforcerRedHatcat << EOF | sudo tee /etc/yum.repos.d/Aporeto.repo [Aporeto] name=aporeto baseurl=$RPM_DEB_REPO/rhel/\$releasever/ gpgkey=$GPG_KEY gpgcheck=1 repo_gpgcheck=1 enabled=1 EOF sudo yum install -y prisma-enforcerAmazon Linux 2cat << EOF | sudo tee /etc/yum.repos.d/Aporeto.repo [Aporeto] name=aporeto baseurl=$RPM_DEB_REPO/nodist/yum/ gpgkey=$GPG_KEY gpgcheck=1 repo_gpgcheck=1 enabled=1 EOF sudo yum install -y prisma-enforcerIssue the command that corresponds to your desired configuration and the init system of the target host.systemdecho "CNS_AGENT_TOKEN=$TOKEN" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "CNS_AGENT_ENFORCER_FIRST_INSTALL_VERSION=" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_TOKEN=$TOKEN" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_PERSIST_CREDENTIALS=true" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_API=$MICROSEG_API" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_ENABLE_HOST_MODE=true" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_NAMESPACE=$TARGET_NS" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "CNS_AGENT_TUF_REPO=$TUF_REPO" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf sudo systemctl enable --now prisma-enforcer sudo systemctl status prisma-enforcerupstartecho "CNS_AGENT_TOKEN=$TOKEN" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "CNS_AGENT_ENFORCER_FIRST_INSTALL_VERSION=" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_TOKEN=$TOKEN" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_PERSIST_CREDENTIALS=true" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_API=$MICROSEG_API" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_ENABLE_HOST_MODE=true" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_NAMESPACE=$TARGET_NS" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "CNS_AGENT_TUF_REPO=$TUF_REPO" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf sudo start prisma-enforcer sudo status prisma-enforcerinitdecho "CNS_AGENT_TOKEN=$TOKEN" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "CNS_AGENT_ENFORCER_FIRST_INSTALL_VERSION=" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_TOKEN=$TOKEN" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_PERSIST_CREDENTIALS=true" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_API=$MICROSEG_API" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_ENABLE_HOST_MODE=true" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "ENFORCERD_NAMESPACE=$TARGET_NS" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf echo "CNS_AGENT_TUF_REPO=$TUF_REPO" | sudo tee -a /var/lib/prisma-enforcer/prisma-enforcer.conf sudo /etc/init.d/prisma-enforcer start sudo /etc/init.d/prisma-enforcer status
- For versions of systemctl prior to 220, you may need to start and enable the service in two commands.
- Refer to Enforcer configuration options for other environment variables you can set to modify the enforcer’s default settings.
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 terminal on the target host.Clear TOKEN.export TOKEN=""Refer to Securing host communications to learn how to allow the desired traffic and disable discovery mode.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, using the --tag flag, you have to also delete the enforcer object from the Microsegmentation Console.You can modify the default configuration by passing one or more of the enforcer flags below as the value of --raw-flags. Example: apoctl enforcer install linux --raw-flags "--log-level=debug --log-format=human --log-to-console=true"enforcer flagenforcerd.conf optionDescriptionPass 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.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.(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.Microsegmentation 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 /var/lib/enforcerdMost Popular
Recommended For You
Recommended Videos
Recommended videos not found.