
Step 1: Deny All Traffic in the Default Namespace
First, verify that your application is running. Then, apply an authorization policy to the default namespace. This policy, which contains no selectors and an empty spec, denies all traffic to all workloads within the namespace.
Examine the distributed traces in your tracing system; a dark red grouping of traces often highlights problematic traffic.
Step 2: Enable Traffic for the Product Page
To allow HTTP GET requests to the product page, create a policy that selects workloads with the labelapp: productpage in the default namespace:
Step 3: Sequentially Enable Additional Components
Next, add further authorization policies to enable full application functionality.
3.1 Create the Details Viewer Policy
This policy applies to workloads with the labelapp: details and permits HTTP GET requests from the product page service account (bookinfo-productpage):
3.2 Enable the Reviews Service
Create a policy for the reviews service. This policy selects workloads labeled withapp: reviews and allows GET requests from the product page service account:
3.3 Create the Ratings Viewer Policy
Address the issues with the ratings service by creating a policy that selects workloads with the labelapp: ratings and permits GET requests from the reviews service account (bookinfo-reviews):
Step 4: Review the Istio Configuration
Take a moment to review the overall Istio configuration. In the configuration section, you will see the global “allow nothing” policy applied across the mesh along with the specific viewer policies for each component.
Any traffic not explicitly allowed by the defined policies (such as POST requests or traffic from unrecognized sources) will be denied. This strict approach is critical for maintaining a robust security posture.
Conclusion
By sequentially applying targeted authorization policies, you can effectively secure your Istio service mesh while selectively enabling access to critical components of your application. For more details, consult the Istio Documentation.For further reading on securing microservices, see: