Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Egress blog part 2 #4232

Merged
merged 86 commits into from Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
864f87e
add the second part of the series about secure egress traffic control…
vadimeisenbergibm May 28, 2019
01ae898
requirements for your system -> requirements for a system for egress …
vadimeisenbergibm May 28, 2019
e40747e
add links from part 1 to part 2
vadimeisenbergibm May 28, 2019
32fb3a7
add istio-identity to .spelling
vadimeisenbergibm May 29, 2019
ebab675
add gateway and tls as keywords
vadimeisenbergibm Jun 10, 2019
41f57c1
This is -> Welcome to, a new series -> our new series
vadimeisenbergibm Jun 10, 2019
5f2bafa
an egress traffic control system -> a secure control system for egres…
vadimeisenbergibm Jun 10, 2019
bf8aaec
for controlling egress traffic securely ->to securely control the egr…
vadimeisenbergibm Jun 10, 2019
b250996
Egress traffic control by Istio -> Secure control of egress traffic i…
vadimeisenbergibm Jun 10, 2019
e4e6eed
add bullets regarding security measures for Istio control plane
vadimeisenbergibm Jun 10, 2019
ee44d6e
you can securely monitor the traffic and define security policies on …
vadimeisenbergibm Jul 4, 2019
73c2862
Possible attacks and their prevention -> Preventing possible attacks
vadimeisenbergibm Jul 4, 2019
e35fd31
e.g. -> like, add a comma, split a sentence
vadimeisenbergibm Jul 4, 2019
be8cd6e
the -> said
vadimeisenbergibm Jul 4, 2019
54310ab
remove "for TLS traffic"
vadimeisenbergibm Jul 4, 2019
3246d3b
monitor SNI and the service account of the source pod -> monitor SNI …
vadimeisenbergibm Jul 4, 2019
fba3171
L3 firewall -> an L3 firewall, remove parentheses, provided -> should…
vadimeisenbergibm Jul 4, 2019
9006b8d
The L3 firewall can have -> you can configure the L3 firewall
vadimeisenbergibm Jul 4, 2019
4e8499e
from pods only -> only allow. Remove "Note that"
vadimeisenbergibm Jul 4, 2019
1e6abbd
move the diagram right after its introduction
vadimeisenbergibm Jul 4, 2019
38cd520
remove parentheses
vadimeisenbergibm Jul 4, 2019
1168042
emphasize the label (A, B)
vadimeisenbergibm Jul 4, 2019
7ec2976
policy with regard -> policies as they regard
vadimeisenbergibm Jul 4, 2019
f9e7361
rewrite the sentence about a compromised pod
vadimeisenbergibm Jul 4, 2019
21dffa9
traffic must be monitored -> traffic is monitored
vadimeisenbergibm Jul 4, 2019
1a1fe95
Note that application A is allowed -> since application A is allowed
vadimeisenbergibm Jul 4, 2019
023d2fa
rewrite the sentence about monitoring access of the compromised versi…
vadimeisenbergibm Jul 4, 2019
2f5c8c1
split the sentence about detecting suspicious traffic
vadimeisenbergibm Jul 4, 2019
1ecd16e
rewrite the sentence about thwarting the second goal of the attackers
vadimeisenbergibm Jul 4, 2019
0ff7872
Istio must enforce -> enforces, forbids access of application A -> fo…
vadimeisenbergibm Jul 4, 2019
d6897ba
Rewrite the sentence "let's see which attacks"
vadimeisenbergibm Jul 4, 2019
871b59f
rewrite the sentence "I hope that"
vadimeisenbergibm Jul 4, 2019
7e233ec
in the next blog post -> in the next part
vadimeisenbergibm Jul 4, 2019
cb851b7
remove mentioning wildcard domains
vadimeisenbergibm Jul 4, 2019
085fdc4
rewrite the "Secure control of egress traffic in Istio" section
vadimeisenbergibm Jul 4, 2019
36ddd4e
remove a leftover from suggested changes
vadimeisenbergibm Jul 4, 2019
71a6ace
as they regard to egress traffic -> for egress traffic
vadimeisenbergibm Jul 4, 2019
45d8cb0
convert security policies into bullets
vadimeisenbergibm Jul 4, 2019
28ebd57
make the labels (A,B) bold
vadimeisenbergibm Jul 4, 2019
dc0c41a
remove the sentences about thwarting the second goal
vadimeisenbergibm Jul 4, 2019
3a6ef70
rewrite the paragraph about which goals of the attackers can be thwarted
vadimeisenbergibm Jul 4, 2019
cf2fe79
remove a leftover from the previous changes
vadimeisenbergibm Jul 4, 2019
646daae
such attacks -> the attacks
vadimeisenbergibm Jul 4, 2019
6b32e4b
rewrite the section about preventing the attacks
vadimeisenbergibm Jul 4, 2019
e19a520
secure egress traffic control -> secure control of egress traffic
vadimeisenbergibm Jul 4, 2019
ba764da
sending HTTP traffic -> sending unencrypted HTTP traffic
vadimeisenbergibm Jul 4, 2019
c451971
define security policies -> enforce security policies
vadimeisenbergibm Jul 4, 2019
5475653
Merge remote-tracking branch 'upstream/master' into egress_blog_part_2
vadimeisenbergibm Jul 4, 2019
eb5ecd0
change the publish date to July 9
vadimeisenbergibm Jul 4, 2019
f75c6c5
formatting
vadimeisenbergibm Jul 8, 2019
4a2f41f
Kubernetes Network Policies -> Kubernetes network policies
vadimeisenbergibm Jul 8, 2019
be2bfe0
[an example for Kubernetes Network Policies configuration] -> an exam…
vadimeisenbergibm Jul 8, 2019
abc996d
use proper capitalization and punctuation for bullet 1
vadimeisenbergibm Jul 9, 2019
78dc2c3
use proper capitalization and punctuation for bullet 2
vadimeisenbergibm Jul 9, 2019
07669dc
use proper capitalization and punctuation for bullet 3
vadimeisenbergibm Jul 9, 2019
4b21ebc
use proper capitalization and punctuation for bullet 4
vadimeisenbergibm Jul 9, 2019
7112f17
check -> verify, access the destination, mongo1, access mongo1
vadimeisenbergibm Jul 9, 2019
6cf8c6b
You can thwart the third goal -> to stop attackers from
vadimeisenbergibm Jul 9, 2019
9abcacc
remove mentioning anomaly detection
vadimeisenbergibm Jul 9, 2019
76bd3f5
Provide context instead of "after all"
vadimeisenbergibm Jul 9, 2019
eaf5ff8
split a long line
vadimeisenbergibm Jul 9, 2019
195327a
connect two sentences
vadimeisenbergibm Jul 9, 2019
0e57bef
First -> Next
vadimeisenbergibm Jul 9, 2019
c982b07
use - instead of * for bulleted lists
vadimeisenbergibm Jul 9, 2019
adead22
make the first attacker's goal a bullet
vadimeisenbergibm Jul 9, 2019
b28a3c5
make the first attacker's goal a bullet
vadimeisenbergibm Jul 9, 2019
3c03e27
make the second attacker's goal a bullet
vadimeisenbergibm Jul 9, 2019
e00708b
fix indentation
vadimeisenbergibm Jul 9, 2019
781f82d
make the reference to prevention of the first goal a bullet
vadimeisenbergibm Jul 9, 2019
78adaa2
make the reference to prevention of the second goal a bullet
vadimeisenbergibm Jul 9, 2019
1434b3a
rephrase the sentence about applying additional security measures
vadimeisenbergibm Jul 9, 2019
77711b3
remove leftover from a previous change
vadimeisenbergibm Jul 9, 2019
abebb00
that will enforce -> to enforce
vadimeisenbergibm Jul 9, 2019
1de47e3
split long lines
vadimeisenbergibm Jul 9, 2019
65dc36e
rewrite the part about increasing security of the control plane pods
vadimeisenbergibm Jul 9, 2019
539602e
fix indentation
vadimeisenbergibm Jul 9, 2019
6dc44eb
fix indentation and remove a leftover from a previous change
vadimeisenbergibm Jul 9, 2019
7134b43
extend the bold font from a single word to a phrase
vadimeisenbergibm Jul 9, 2019
1a82f2e
rewrite the prevention of the straightforward access and the attacks
vadimeisenbergibm Jul 9, 2019
66fb3db
add conclusion after the attacks part
vadimeisenbergibm Jul 9, 2019
297695d
control planes pods -> control plane pods
vadimeisenbergibm Jul 9, 2019
e74f844
control plane -> Istio control plane
vadimeisenbergibm Jul 9, 2019
df4ccc6
is able to access it indistinguishable -> is indistinguishable
vadimeisenbergibm Jul 10, 2019
16d8c6e
rewrite the sentence "The choice would mainly depend on"
vadimeisenbergibm Jul 10, 2019
3a7f4d8
insure -> ensure
vadimeisenbergibm Jul 10, 2019
5f5fd4e
update the publish date to 10-th of July
vadimeisenbergibm Jul 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .spelling
Expand Up @@ -254,6 +254,7 @@ istio.io
istio.io.
Istiofied
IstioMesh
istio-identity
istio-mixer
istio-system
jason
Expand Down
Expand Up @@ -9,12 +9,14 @@ keywords: [traffic-management,egress,security]

This is part 1 in a new series about secure control of egress traffic in Istio that I am going to publish.
In this installment, I explain why you should apply egress traffic control to your cluster, the attacks
involving egress traffic you want to prevent, and the requirements for your system to do so.
involving egress traffic you want to prevent, and the requirements for a system for egress traffic control
to do so.
Once you agree that you should control the egress traffic coming from your cluster, the following questions arise:
What requirements does a system have for secure control of egress traffic? Which is the best solution to fulfill
What is required from a system for secure control of egress traffic? Which is the best solution to fulfill
these requirements? (spoiler: Istio in my opinion)
Future installments will describe the implementation of the secure control of egress traffic in Istio and
compare it with other solutions.
Future installments will describe
[the implementation of the secure control of egress traffic in Istio](/blog/2019/egress-traffic-control-in-istio-part-2/)
and compare it with other solutions.

The most important security aspect for a service mesh is probably ingress traffic. You definitely must prevent attackers
from penetrating the cluster though ingress APIs. Having said that, securing
Expand Down Expand Up @@ -161,8 +163,9 @@ all of these requirements, in particular it is transparent, DNS-aware, and Kuber

## Summary

I hope that you are convinced that controlling egress traffic is important for the security of your cluster. In the
next blogs in this series I will describe the Istio way to perform secure control of egress traffic and compare it with
alternative solutions such as
I hope that you are convinced that controlling egress traffic is important for the security of your cluster. In [the
part 2 of this series](/blog/2019/egress-traffic-control-in-istio-part-2/) I describe the Istio way to perform secure
control of egress traffic.
Next, I will compare it with alternative solutions such as
[Kubernetes Network Policies](https://kubernetes.io/docs/concepts/services-networking/network-policies/) and legacy
egress proxies/firewalls.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 101 additions & 0 deletions content/blog/2019/egress-traffic-control-in-istio-part-2/index.md
@@ -0,0 +1,101 @@
---
title: Secure Control of Egress Traffic in Istio, part 2
subtitle: Use Istio Egress Traffic Control to prevent attacks involving egress traffic
description: Use Istio Egress Traffic Control to prevent attacks involving egress traffic.
publishdate: 2019-05-29
attribution: Vadim Eisenberg (IBM)
keywords: [traffic-management,egress,security]
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
---

This is part 2 in a new series about secure control of egress traffic in Istio.
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
In [the first part in the series](/blog/2019/egress-traffic-control-in-istio-part-1/), I presented the attacks involving
egress traffic and the requirements we collected for an egress traffic control system.
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
In this installment, I describe the Istio way for controlling egress traffic securely and show how Istio prevents the
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
attacks.

## Egress traffic control by Istio
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved

To implement secure egress traffic control in Istio, you must
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are letting folks know all the things they need to do but without a clear order or a reason why. The ultimate goal is clear but why do readers must direct TLS traffic to external services through an egress gateway in order to reach that goal, secure control of egress traffic, is not clear, for example. How do these things you want readers to do bring them closer to that secure control they want? In the previous part we tackled what the problem was. Here you are letting people know how to tackle that problem using the Istio feature.
Try introducing all these steps with a sentence like: "To securely control the egress traffic of your mesh, you must first perform the following configurations:"
That way, readers know why they are doing these things, namely, to configure the mesh to gain the secure control they seek.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rcaballeromx I wrote this post differently - first I tell the readers what they must do, and then I explain them how the steps they took prevent the attacks. It is like to tell the reader:

The threat: The attackers want to penetrate your house.
What the reader should do: Build a high fence and lock the gate, add a surveillance system.
How it will prevent the attacks:

  1. The attacker will try to climb over the fence - they will not be able since it is high.
  2. The attackers will try to open the gate - they will not be able since it is locked.
  3. If the attackers will bring a ladder and climb over the fence, the surveillance system will still detect them.

The issue is that for the secure control of egress traffic you apply a set of mechanisms, and together they prevent all possible attacks (that I can think about).

[direct TLS traffic to external services through an egress gateway](/docs/tasks/traffic-management/egress/egress-gateway/#egress-gateway-for-https-traffic).
(To support wildcard domains, you must create
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Number each step you want readers to take, even if the step is linking to a full task.

Suggested change
(To support wildcard domains, you must create
1. To support wildcard domains, you must create

[a custom version of an egress gateway](/docs/tasks/traffic-management/egress/wildcard-egress-hosts/)). Alternatively, you
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would advise you against including alternative or branching paths in your blog post. Pick the best path you want readers to follow and describe that single path clearly. Adding alternative ways of reaching the same result normally confuses folks getting started who do not know how to pick a path. Usually, picking the simplest path to success is best. In this case I would just provide the link to the task on how to create a custom version of the egress gateway and remove the mention of the alternative.

Suggested change
[a custom version of an egress gateway](/docs/tasks/traffic-management/egress/wildcard-egress-hosts/)). Alternatively, you
[a custom version of an egress gateway](/docs/tasks/traffic-management/egress/wildcard-egress-hosts/).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rcaballeromx

I removed the wildcard domains mentioning cb851b7.

I still propose to leave two main alternatives:

  1. TLS traffic
  2. HTTP + TLS origination by the gateway

None is better than the other, the reader should choose it according to their circumstances. Each has its pros and cons.

can [direct HTTP traffic through an egress gateway](/docs/tasks/traffic-management/egress/egress-gateway/#egress-gateway-for-http-traffic)
rcaballeromx marked this conversation as resolved.
Show resolved Hide resolved
and [let the egress gateway perform TLS origination](/docs/tasks/traffic-management/egress/egress-gateway-tls-origination/#perform-tls-origination-with-an-egress-gateway).
rcaballeromx marked this conversation as resolved.
Show resolved Hide resolved

In all cases you have to apply some
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
[additional security mechanisms](/docs/tasks/traffic-management/egress/egress-gateway/#additional-security-considerations),
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
like [Kubernetes Network Policies](https://kubernetes.io/docs/concepts/services-networking/network-policies/) or an L3
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
firewall that will enforce that traffic from the cluster to the outside is allowed for the egress gateway only. See
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
[an example for Kubernetes Network Policies configuration](/docs/tasks/traffic-management/egress/egress-gateway/#apply-kubernetes-network-policies).
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved

You must also increase the security measures applied to the Istio control plane and the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest you make this a list of general security best practices for meshes and introduce it as such:

Suggested change
You must also increase the security measures applied to the Istio control plane and the
To increase the security measures of the Istio control plane, follow these best practices:

egress gateway by running them on nodes separate from the application nodes, in a separate namespace, monitoring them
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
more thoroughly, etc. After all, if the attackers are able to attack Istio Mixer or the egress gateway, they could
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
more thoroughly, etc. After all, if the attackers are able to attack Istio Mixer or the egress gateway, they could
- Monitor the control plane services and the egress gateway carefully.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rcaballeromx Monitor the control plane more thoroughly means more thoroughly than you monitor application pods. For example, if you perform some inspection on the application pods once a month, perform such inspection on the control plane once a week.

violate any policy.

Once you direct egress traffic through an egress gateway and apply the additional security mechanisms,
you can securely monitor the traffic and define security policies on it.
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
If the application sends HTTP requests and the egress gateway performs TLS origination, you can monitor HTTP
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is an example of what you described in the previous sentence, you need to let readers know how the two are linked.

Suggested change
If the application sends HTTP requests and the egress gateway performs TLS origination, you can monitor HTTP
Take, for example, an application that sends HTTP requests and an egress gateway that performs TLS origination, then you can monitor HTTP

information, e.g. HTTP methods, headers and URL paths, and you can
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
[define policies](/blog/2018/egress-monitoring-access-control) based on the HTTP information. If the application
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
performs TLS origination, for TLS traffic you can
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
[monitor SNI and the service account](/docs/tasks/traffic-management/egress/egress_sni_monitoring_and_policies/) of the
source pod, and define policies based on them.
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved

The following diagram shows Istio's security architecture, augmented with L3 firewall (part of the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The following diagram shows Istio's security architecture, augmented with L3 firewall (part of the
The following diagram shows Istio's security architecture, augmented with a L3 firewall, which is part of the

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rcaballeromx it should be "an L3 firewall", right? Pronounced An el three firewall.

[additional security mechanisms](/docs/tasks/traffic-management/egress/egress-gateway/#additional-security-considerations)
provided outside of Istio by the cluster/cloud provider).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
provided outside of Istio by the cluster/cloud provider).
that your platform provided outside of Istio.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in fba3171. The meaning here is that someone (the reader, the cluster provider, should apply additional security mechanisms, outside of Istio).

The L3 firewall can have a trivial configuration that would allow incoming traffic into Istio ingress gateway pods only and
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
outgoing traffic from Istio egress gateway pods only. Note that the Istio proxy of the egress gateway performs
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
policy enforcement and reporting in the same way as the sidecar proxies in the application pods.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
policy enforcement and reporting in the same way as the sidecar proxies in the application pods.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rcaballeromx I do not understand this suggested change. Should I remove the sentence "Note that the Istio proxy of the egress gateway performs
policy enforcement and reporting in the same way as the sidecar proxies in the application pods." ?


{{< image width="80%" link="./SecurityArchitectureWithL3Firewalls.svg" caption="Istio Security Architecture with Egress Gateway and L3 Firewall" >}}
rcaballeromx marked this conversation as resolved.
Show resolved Hide resolved

Now let's examine possible attacks and let me show you how the secure control of egress traffic in Istio prevents them.

## Possible attacks and their prevention
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved

Consider the following security policy with regard to egress traffic:
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved

1. Application A is allowed to access `*.ibm.com` (all the external services with URL matching `*.ibm.com`,
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
e.g. `www.ibm.com`)
1. Application B is allowed to access `mongo1.composedb.com`
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
1. All egress traffic must be monitored
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved

Now consider a scenario in which one of application A's pods is compromised. Suppose the attackers have the
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
following goals:

1. Application A will try to access `*.ibm.com` unmonitored
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Application A will try to access `*.ibm.com` unmonitored
- Application **A** will try to access `*.ibm.com` unmonitored.

1. Application A will try to access `mongo1.composedb.com`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Application A will try to access `mongo1.composedb.com`
- Application **A** will try to access `mongo1.composedb.com`.


Note that application A is allowed to access `*.ibm.com`, so the attacker is able to access it. There is no way
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
to prevent such access since there is no way to distinguish, at least initially, between the original and the
compromised versions of application A. However, you want to monitor any access to external services to be able to
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
detect suspicious traffic, for example by applying anomaly detection tools on logs of the egress traffic.
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
The attackers, on the contrary, want to access external services unmonitored, so the attack will not be detected.
The second goal of the attackers is to access `mongo1.composedb.com`, which is forbidden for application A. Istio
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
must enforce the policy that forbids access of application A to `mongo1.composedb.com` and must prevent the attack.
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved

Now let's see which attacks the attackers will try to perform to achieve their goals and how Istio secure egress traffic
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
control will prevent each kind of attack. The attackers may try to:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
control will prevent each kind of attack. The attackers may try to:
helps prevent each kind of attack. Common attacks include:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rcaballeromx I do not like this change:

  1. Istio does not help to prevent, it actually prevents
  2. Common attacks - I do not claim that these are common attacks, these are the attacks that came to my mind.


1. **Bypass** the container's sidecar proxy and access external services directly. This attack is prevented by a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to provide the subject to your readers. Having a clear subject lets readers identify the actors in the narrative and helps them get immersed in that narrative. It's a great tool to make your writing more engaging.

Suggested change
1. **Bypass** the container's sidecar proxy and access external services directly. This attack is prevented by a
- **Bypass:** Attackers wish to access the container's sidecar proxy and external services directly. An egress
Kubernetes network policy or a properly configured L3 firewall help you prevent this type of attack, as discussed earlier in the post.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the meaning is different. The attackers want to access external services directly, for that they may try to bypass the container's sidecar proxy. (they do not wish to access the container's sidecar proxy).

The security mechanisms mentioned do not help to prevent the attack, they actually prevent it. The readers might understand "Help to prevent" as to reduce the probability of the attack, but still leave some possibility of the attack.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rcaballeromx "An egress
Kubernetes network policy or a properly configured L3 firewall help you prevent this type of attack, as discussed earlier in the post."

This does not explain how the attack is prevented. The attack is prevented by:
"a Kubernetes Network Policy or by an L3 firewall that allow egress traffic to exit the mesh only from the egress gateway." only from the egress gateway = not directly.

The attackers want to access the external service directly, the Kubernetes Network Policy or an L3 firewall force them to go through the gateway.

Kubernetes Network Policy or by an L3 firewall that allow egress traffic to exit the mesh only from the egress
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Kubernetes Network Policy or by an L3 firewall that allow egress traffic to exit the mesh only from the egress

gateway.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
gateway.

1. **Compromise** the egress gateway and force it to send fake information to the monitoring system or to disable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. **Compromise** the egress gateway and force it to send fake information to the monitoring system or to disable
- **Compromise:** Attackers gain access to the egress gateway forcing it to send fake information to the monitoring system or to disable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the meaning is: the attackers compromise the gateway (break into it) in order to force it to send fake info.

enforcement of the security policies.
This attack is prevented by applying the special security measures to the egress gateway pods.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This attack is prevented by applying the special security measures to the egress gateway pods.
Applying the special security measures we discussed helps prevent this attack to the egress gateway.

1. Since the previous attacks are prevented, the attackers have no other option but to direct the traffic through the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Hide: Attackers direct the traffic through the egress gateway hoping it will go undetected. Our configuration ensures all the traffic going through the egress gateway is monitored preventing this attack.
  • Impersonate: Attackers wish to access an external service through a service. Istio's strong
    identity support
    prevents this attack. In our example, attackers using service A cannot access mongo1.composedb.com thanks to our configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rcaballeromx the attackers hope it will go undetected - the attackers cannot be so naive :) We are talking about attackers who learned how Istio works and are trying to break various Istio mechanisms.

egress gateway. The traffic will be monitored by the egress gateway, so the goal of the attackers to access
external services unmonitored cannot be achieved. The attackers may want to try to achieve their second goal, that is
to access `mongo1.composedb.com`. To achieve it, they may try to **impersonate** as application B since
application B is allowed to access `mongo1.composedb.com`. This attack, fortunately, is prevented by Istio's [strong
identity support](/docs/concepts/security/#istio-identity).

## Summary

I hope that I managed to convince you that Istio can serve as an effective tool for preventing attacks involving egress
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
traffic. In the next blog post in this series I compare control of egress traffic in Istio with alternative
vadimeisenbergibm marked this conversation as resolved.
Show resolved Hide resolved
solutions such as
[Kubernetes Network Policies](https://kubernetes.io/docs/concepts/services-networking/network-policies/) and legacy
egress proxies/firewalls.