Skip to content

Commit 1dd1ef4

Browse files
authored
Merge pull request #201 from f5devcentral:lad-matt
update api
2 parents e2491a4 + 16679cd commit 1dd1ef4

4 files changed

Lines changed: 4 additions & 107 deletions

File tree

docs/class4/module1/lab2/lab2.rst

Lines changed: 2 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Protect the modern API application with F5XC - static protection
2-
================================================================
1+
Start Protecting the modern API application with F5XC
2+
=====================================================
33

44
Assign OpenAPI spec file to the LB
55
----------------------------------
@@ -55,68 +55,3 @@ Assign the API definition to the LB
5555
.. image:: ../pictures/api-protection.png
5656
:align: center
5757
:scale: 70%
58-
59-
|
60-
61-
Apply API Protection rules
62-
--------------------------
63-
64-
Understand the difference between API Protection and API Validation
65-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66-
67-
Before enforcing any policy, it is important to understand the differences between ``API Protection`` and ``API Validation`` (+API Discovery)
68-
69-
In the slide below, you can understand the difference:
70-
71-
* API Protection only allow ``known API endpoints and methods`` and does not enforce responses.
72-
* API Protection is ``Failed-Close`` by design
73-
74-
* API Validation ``validates`` the OpenAPI Spec (OAS) file with methods, endpoints and parameters. It validates also the responses.
75-
* API Validation is ``Failed-Open`` by design
76-
77-
* API Discovery is on top of ``API Validation`` and provides discovery of unknown specifications (methods, endpoints and parameters)
78-
* API Discovery can be used alone without API Validation if API Dev can't deliver the OAS file.
79-
80-
.. image:: ../pictures/slide-api-protection.png
81-
:align: center
82-
:scale: 40%
83-
84-
85-
Create the default API Protection rule
86-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
87-
88-
In this lab, we will create an ``API Protection rule`` to enforce and allow only ``known specifications``. The endpoints defined in the OAS files are:
89-
90-
* /adjectives
91-
* /animals
92-
* /locations
93-
94-
.. note:: As a reminder, the endpoint ``/colors`` is not defined in the OAS file, and the base path is ``/api/``
95-
96-
#. Edit your "sentence-re-lb" application LB
97-
#. Go to ``API Protection`` - ``API Protection Rules`` and click ``configure``
98-
99-
.. image:: ../pictures/api-protection-rules.png
100-
:align: center
101-
102-
#. Click on ``Configure in Server URLs and API Groups`` and create the following two rules. Don't forget to click on ``Apply``
103-
104-
#. Rule 1: allows the methods and endpoints defined in the OAS file.
105-
106-
.. image:: ../pictures/allow-all-rule.png
107-
:align: left
108-
109-
#. Rule 2: deny the rest
110-
111-
.. image:: ../pictures/deny-unknown.png
112-
:align: left
113-
114-
#. You should now have 2 rules. Save all your configurations.
115-
116-
.. image:: ../pictures/all-rules.png
117-
:align: center
118-
:scale: 50%
119-
120-
#. Save and Exit.
121-
122-
.. note:: You are good to test your first API Protection Load Balancer in F5 Distributes Cloud

docs/class4/module1/lab3/lab3.rst

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,3 @@ Test your modern API application protection
1616
1717
curl -H "Content-Type: application/json;charset=UTF-8" http://sentence-re-$$makeId$$.workshop.emea.f5se.com/api/locations
1818
19-
.. note:: The 3 calls are successful because there are defined in the OAS file (method + endpoint)
20-
21-
#. Now, run the below call
22-
23-
.. code-block:: none
24-
25-
curl -H "Content-Type: application/json;charset=UTF-8" http://sentence-re-$$makeId$$.workshop.emea.f5se.com/api/colors
26-
27-
.. note:: This call is denied because not part of the OAS file
28-
29-
Check the logs
30-
--------------
31-
32-
* Go to the security dashboard (Overview > Security)
33-
* Scroll down and click on your ``sentence`` LB
34-
* Click on ``Security Analytics``
35-
36-
.. note:: Scroll and search for API events
37-
38-
.. image:: ../pictures/api-protect-event.png
39-
:align: center
40-

docs/class4/module2/lab1/lab1.rst

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
Enable API validation
22
=====================
33

4-
In the previous section, we enabled API Protection. API Protection is based on rules (allow, deny), but API Validation goes deeper into the validation.
5-
64
API Validation validates the requests and the responses, but also the content (JSON payload) based on the OpenAPI Specifications.
75

8-
As a reminder, this is the difference between Protection and API Validation.
9-
10-
.. image:: ../pictures/slide-api-protection.png
11-
:align: center
12-
:scale: 40%
13-
146
.. note:: As an example, API Validation validates if the value of a JSON key matches the specifications (integer, string, array ...)
157

168
Example below
@@ -60,7 +52,7 @@ Example below
6052
id: 4
6153
name: worried
6254
63-
Having said, let's enable API Validation, and disable API Protection. It does not make sense to use both at the same time except if you need a specific rule for a specific endpoint.
55+
Having said, let's enable API Validation.
6456

6557
Update your API Load Balancer
6658
-----------------------------
@@ -69,13 +61,7 @@ Update your API Load Balancer
6961
You can bypass this section if you are not part of an official F5 training, and continue to the API Discovery lab.
7062

7163
.. note:: Please don't open support ticket to increase this quota. This is done by F5ers in charge of the trainings (Matthieu Dierick, Sorin Boiangiu)
72-
73-
* Edit your Load Balancer and remove all API Protection rules (click on Reset Configuration and confirm)
74-
75-
.. image:: ../pictures/api-protection-reset.png
76-
:align: left
77-
:scale: 50%
78-
64+
7965
|
8066
8167
* Enable API Validation for ``All Endpoints``

docs/class4/module2/lab3/lab3.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)