Skip to content

Commit 87a1bd7

Browse files
authored
Merge pull request #188896 from shsha-msft/dev/shsha/ServiceFabricRuntimeAccess
RemoveServiceFabricRuntimeAccess: Isolate the cluster and its trusted…
2 parents 0b3753e + 0e8e881 commit 87a1bd7

6 files changed

+29
-14
lines changed

articles/security/fundamentals/service-fabric-best-practices.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ ms.topic: article
99
ms.date: 01/16/2019
1010
---
1111
# Azure Service Fabric security best practices
12+
In addition to this article, please also review [Service Fabric security checklist](../../service-fabric/service-fabric-best-practices-security.md) for more information.
13+
1214
Deploying an application on Azure is fast, easy, and cost-effective. Before you deploy your cloud application into production, review our list of essential and recommended best practices for implementing secure clusters in your application.
1315

1416
Azure Service Fabric is a distributed systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices. Service Fabric also addresses the significant challenges in developing and managing cloud applications. Developers and administrators can avoid complex infrastructure problems and focus on implementing mission-critical, demanding workloads that are scalable, reliable, and manageable.
@@ -30,6 +32,7 @@ We recommend the following Azure Service Fabric security best practices:
3032
- Use network isolation and security with Azure Service Fabric.
3133
- Configure Azure Key Vault for security.
3234
- Assign users to roles.
35+
- Things to consider if hosting untrusted applications in a Service Fabric cluster.
3336

3437

3538
## Best practices for securing your clusters
@@ -172,8 +175,11 @@ After you've created the applications to represent your cluster, assign your use
172175
173176
Azure Service Fabric supports two access control types for clients that are connected to a [Service Fabric cluster](../../service-fabric/service-fabric-cluster-creation-via-arm.md): administrator and user. The cluster administrator can use access control to limit access to certain cluster operations for different groups of users. Access control makes the cluster more secure.
174177

178+
## Things to consider if hosting untrusted applications in a Service Fabric cluster
179+
Please see [Hosting untrusted applications in a Service Fabric cluster](../../service-fabric/service-fabric-best-practices-security.md#hosting-untrusted-applications-in-a-service-fabric-cluster).
180+
175181
## Next steps
176182

177183
- [Service Fabric security checklist](../../service-fabric/service-fabric-best-practices-security.md)
178184
- Set up your Service Fabric [development environment](../../service-fabric/service-fabric-get-started.md).
179-
- Learn about [Service Fabric support options](../../service-fabric/service-fabric-support.md).
185+
- Learn about [Service Fabric support options](../../service-fabric/service-fabric-support.md).

articles/service-fabric/service-fabric-application-and-service-manifests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ Within the ServiceManifestImport, you override configuration values in Settings.
157157

158158
**Policies** (not set in the preceding example) describes the log collection, [default run-as](service-fabric-application-runas-security.md), [health](service-fabric-health-introduction.md#health-policies), and [security access](service-fabric-application-runas-security.md) policies to set at the application level, including whether the service(s) have access to the Service Fabric runtime.
159159

160-
> [!NOTE]
161-
> By default, Service Fabric applications have access to the Service Fabric runtime, in the form of an endpoint accepting application-specific requests, and environment variables pointing to file paths on the host containing Fabric and application-specific files. Consider disabling this access when the application hosts untrusted code (i.e. code whose provenance is unknown, or which the application owner knows not to be safe to execute). For more information, please see [security best practices in Service Fabric](service-fabric-best-practices-security.md#platform-isolation).
160+
> [!NOTE]
161+
> A Service Fabric cluster is single tenant by design and hosted applications are considered **trusted**. If you are considering hosting **untrusted applications**, please see [Hosting untrusted applications in a Service Fabric cluster](service-fabric-best-practices-security.md#hosting-untrusted-applications-in-a-service-fabric-cluster).
162162
>
163163
164164
**Principals** (not set in the preceding example) describe the security principals (users or groups) required to [run services and secure service resources](service-fabric-application-runas-security.md). Principals are referenced in the **Policies** sections.

articles/service-fabric/service-fabric-best-practices-security.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,17 @@ By default, Windows Defender antivirus is installed on Windows Server 2016. For
254254
> Refer to your Antimalware documentation for configuration rules if you are not using Windows Defender.
255255
> Windows Defender isn't supported on Linux.
256256
257-
## Platform Isolation
258-
By default, Service Fabric applications are granted access to the Service Fabric runtime itself, which manifests itself in different forms: [environment variables](service-fabric-environment-variables-reference.md) pointing to file paths on the host corresponding to application and Fabric files, an inter-process communication endpoint which accepts application-specific requests, and the client certificate which Fabric expects the application to use to authenticate itself. In the eventuality that the service hosts itself untrusted code, it is advisable to disable this access to the SF runtime - unless explicitly needed. Access to the runtime is removed using the following declaration in the Policies section of the application manifest:
257+
## Hosting untrusted applications in a Service Fabric cluster
258+
A Service Fabric cluster is single tenant by design and hosted applications are considered **trusted**. Applications are, therefore, granted access to the Service Fabric runtime, which manifests in different forms, some of which are: [environment variables](service-fabric-environment-variables-reference.md) pointing to file paths on the host corresponding to application and Fabric files, host paths mounted with write access onto container workloads, an inter-process communication endpoint which accepts application-specific requests, and the client certificate which Fabric expects the application to use to authenticate itself.
259+
260+
If you are considering hosting **untrusted applications**, you must take additional steps to define and own the hostile multi-tenant experience for your Service Fabric cluster. This will require you to consider multiple aspects, in the context of your scenario, including, but not limited to, the following:
261+
* A thorough security review of the untrusted applications' interactions with other applications, the cluster itself, and the underlying compute infrastructure.
262+
* Use of the strongest sandboxing technology applicable (e.g., appropriate [isolation modes](/virtualization/windowscontainers/manage-containers/hyperv-container.md) for container workloads).
263+
* Risk assessment of the untrusted applications escaping the sandboxing technology, as the next trust and security boundary is the cluster itself.
264+
* Removal of the untrusted applications' [access to Service Fabric runtime](service-fabric-service-model-schema-complex-types.md#servicefabricruntimeaccesspolicytype-complextype).
265+
266+
### RemoveServiceFabricRuntimeAccess
267+
Access to Service Fabric runtime can be removed by using the following declaration in the Policies section of the application manifest:
259268

260269
```xml
261270
<ServiceManifestImport>

articles/service-fabric/service-fabric-containers-overview.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ Service Fabric supports the deployment of Docker containers on Linux, and Window
7474
> [!NOTE]
7575
> Containers are not supported on local single node Service Fabric clusters (neither Linux clusters on OneBox, nor Windows clusters on local Service Fabric installations).
7676
77+
> [!NOTE]
78+
> A Service Fabric cluster is single tenant by design and hosted applications are considered **trusted**. If you are considering hosting **untrusted applications**, please see [Hosting untrusted applications in a Service Fabric cluster](service-fabric-best-practices-security.md#hosting-untrusted-applications-in-a-service-fabric-cluster).
79+
7780
Service Fabric provides an [application model](service-fabric-application-model.md) in which a container represents an application host in which multiple service replicas are placed. Service Fabric also supports a [guest executable scenario](service-fabric-guest-executables-introduction.md) in which you don't use the built-in Service Fabric programming models but instead package an existing application, written using any language or framework, inside a container. This scenario is the common use-case for containers.
7881

7982
You can also run [Service Fabric services inside a container](service-fabric-services-inside-containers.md). Support for running Service Fabric services inside containers is currently limited.

articles/service-fabric/service-fabric-guest-executables-introduction.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ You can run any type of code, such as Node.js, Java, or C++ in Azure Service Fab
1010

1111
Guest executables are treated by Service Fabric like stateless services. As a result, they are placed on nodes in a cluster, based on availability and other metrics. This article describes how to package and deploy a guest executable to a Service Fabric cluster, by using Visual Studio or a command-line utility.
1212

13+
> [!NOTE]
14+
> A Service Fabric cluster is single tenant by design and hosted applications are considered **trusted**. If you are considering hosting **untrusted applications**, please see [Hosting untrusted applications in a Service Fabric cluster](service-fabric-best-practices-security.md#hosting-untrusted-applications-in-a-service-fabric-cluster).
15+
1316
## Benefits of running a guest executable in Service Fabric
1417
There are several advantages to running a guest executable in a Service Fabric cluster:
1518

articles/service-fabric/service-fabric-services-inside-containers.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,8 @@ This document provides guidance to get your service running inside a Windows con
105105
</Policies>
106106
```
107107

108-
> [!NOTE]
109-
> By default, Service Fabric applications have access to the Service Fabric runtime, in the form of an endpoint accepting application-specific requests. Consider disabling this access when the application hosts untrusted code. For more information, please see [security best practices in Service Fabric](service-fabric-best-practices-security.md#platform-isolation). To disable access to the Service Fabric runtime, add the following setting in the Policies section of the application manifest corresponding to the imported service manifest, as follows:
110-
>
111-
```xml
112-
<Policies>
113-
<ServiceFabricRuntimeAccessPolicy RemoveServiceFabricRuntimeAccess="true"/>
114-
</Policies>
115-
```
108+
> [!NOTE]
109+
> A Service Fabric cluster is single tenant by design and hosted applications are considered **trusted**. If you are considering hosting **untrusted container applications**, consider deploying them as [guest containers](service-fabric-containers-overview.md#service-fabric-support-for-containers) and please see [Hosting untrusted applications in a Service Fabric cluster](service-fabric-best-practices-security.md#hosting-untrusted-applications-in-a-service-fabric-cluster).
116110
>
117111

118112
10. To test this application, you need to deploy it to a cluster that is running version 5.7 or higher. For runtime versions 6.1 or lower, you need to edit and update the cluster settings to enable this preview feature. Follow the steps in this [article](service-fabric-cluster-fabric-settings.md) to add the setting shown next.
@@ -134,4 +128,4 @@ You should now have a containerized Service Fabric application running your clus
134128

135129
## Next steps
136130
* Learn more about running [containers on Service Fabric](service-fabric-get-started-containers.md).
137-
* Learn about the Service Fabric [application life-cycle](service-fabric-application-lifecycle.md).
131+
* Learn about the Service Fabric [application life-cycle](service-fabric-application-lifecycle.md).

0 commit comments

Comments
 (0)