diff --git a/.gitignore b/.gitignore index 306eec3..584d17f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /docs/_build/* #!/docs/_build/html/ #/docs/_build/html/* -#!/docs/_build/html/assets/ \ No newline at end of file +#!/docs/_build/html/assets/ +docs/__pycache__/custom_roles.cpython-311.pyc diff --git a/docs/__pycache__/custom_roles.cpython-311.pyc b/docs/__pycache__/custom_roles.cpython-311.pyc index c840a71..bb0f281 100644 Binary files a/docs/__pycache__/custom_roles.cpython-311.pyc and b/docs/__pycache__/custom_roles.cpython-311.pyc differ diff --git a/docs/class4/module2/lab2/lab2.rst b/docs/class4/module2/lab2/lab2.rst index caba69c..a3a76ce 100644 --- a/docs/class4/module2/lab2/lab2.rst +++ b/docs/class4/module2/lab2/lab2.rst @@ -1,28 +1,72 @@ Enable API code scanning discovery (under construction) ======================================================= -F5 Solutions can protect API during the full API Develoment Lifecycle. It means F5 can detect and learn API endpoints when developers push the code into the repository. -This is call **API Code Scanning Discovery** +F5 solutions can detect and protect APIs during the full API develoment lifecycle which includes also to learn API endpoints and further information to e.g. build the schema from the source code the developers create and maintain on the code repository. -The sentence application source code is available into our public Github repository : https://github.com/MattDierick/sentence-source-code +We use the "Sentence application" source code for this lab: https://github.com/ca-scans/sentence-source-code-v2 + + +.. note:: There is also a video and a FAQ available for F5 employees + + * FAQ - XC API code scan `FAQ `_ + * Video – API discovery from `code `_ + +| Enable Code Base Integration ---------------------------- * Goto Web App & API Protection > API Management > Code Base Ingration -* Add a new code base integration profile +* Add a new "Code Base Integration" with the following values * Name: ``github-sentence`` * Code base: ``Github Integration`` - * Github Name: ``f5xclab`` - * GitHub Personal Access Token: paste and blindfold below Token + * Github UserName: ``please check the "internal" tab in the UDF deployment for the username`` + * GitHub Personal Access Token: ``please check the "internal" tab in the UDF deployment for the token`` + + +.. image:: ../pictures/code-base-integration-username.png + :align: left + +| + +* Click on Configure under "GitHub Personal Access Token" to enter the token into "Secret to Blindfold". + +.. image:: ../pictures/code-base-integration-token-blindfold.png + :align: left + + +* Click Apply and Save and Exit +* Go to settings and change it as shown in the screenshot below to display further information. The Health status should change from "INITIALIZING" to "CONNECTED". - .. code-block:: bash - - sdlkjflksdjglkdfshglkjdflgjldksfgjlksd +.. image:: ../pictures/code-base-integration-initializing-and-show-settings.png + :align: left + +| + +* XC is going to scan the code, so give it some time until you see further updates on e.g. the "Number of API Repositories" + +.. image:: ../pictures/code-base-integration-connected.png + :align: left + +| + +Assign the Code Base Integration to the Load Balancer +----------------------------------------------------- + +* Edit your Load Balancer, go to the API Protection and enable API Discovery (keep the default settings) + + +.. image:: ../pictures/API-discovery-enable.png + :align: left +1. In the same configuration screen, look for API repositories and click on Configure +2. In "Select Code Base Integrations" click on "Add Item" +3. Select the previously created Code Base "github-sentence" +4. Select "Selected API Repositories" +5. Select ca-scans/sentence-source-code-v2 -.. image:: ../pictures/code-based-repo.png +.. image:: ../pictures/select-api-repo-code.png :align: left -* Save +Select Apply twice and Save and Exit \ No newline at end of file diff --git a/docs/class4/module2/pictures/API-discovery-enable.png b/docs/class4/module2/pictures/API-discovery-enable.png new file mode 100644 index 0000000..f26c2fd Binary files /dev/null and b/docs/class4/module2/pictures/API-discovery-enable.png differ diff --git a/docs/class4/module2/pictures/Internal.png b/docs/class4/module2/pictures/Internal.png new file mode 100644 index 0000000..d9d0116 Binary files /dev/null and b/docs/class4/module2/pictures/Internal.png differ diff --git a/docs/class4/module2/pictures/code-base-integration-connected.png b/docs/class4/module2/pictures/code-base-integration-connected.png new file mode 100644 index 0000000..34e09cd Binary files /dev/null and b/docs/class4/module2/pictures/code-base-integration-connected.png differ diff --git a/docs/class4/module2/pictures/code-base-integration-initializing-and-show-settings.png b/docs/class4/module2/pictures/code-base-integration-initializing-and-show-settings.png new file mode 100644 index 0000000..afe987b Binary files /dev/null and b/docs/class4/module2/pictures/code-base-integration-initializing-and-show-settings.png differ diff --git a/docs/class4/module2/pictures/code-base-integration-initializing.png b/docs/class4/module2/pictures/code-base-integration-initializing.png new file mode 100644 index 0000000..2665e95 Binary files /dev/null and b/docs/class4/module2/pictures/code-base-integration-initializing.png differ diff --git a/docs/class4/module2/pictures/code-base-integration-token-blindfold.png b/docs/class4/module2/pictures/code-base-integration-token-blindfold.png new file mode 100644 index 0000000..30e0cd8 Binary files /dev/null and b/docs/class4/module2/pictures/code-base-integration-token-blindfold.png differ diff --git a/docs/class4/module2/pictures/code-base-integration-username.png b/docs/class4/module2/pictures/code-base-integration-username.png new file mode 100644 index 0000000..de9755a Binary files /dev/null and b/docs/class4/module2/pictures/code-base-integration-username.png differ diff --git a/docs/class4/module2/pictures/select-api-repo-code.png b/docs/class4/module2/pictures/select-api-repo-code.png new file mode 100644 index 0000000..72044d9 Binary files /dev/null and b/docs/class4/module2/pictures/select-api-repo-code.png differ