# Introduction

As a developer you should ask yourself: _"How can I make my application (more) secure?"_

In this workshop you will learn how to get started with Application Security from two perspectives:

* Platform security
* Authentication and Authorization implementation

We will show you with an example application:

* How to secure external access to a Kubernetes cluster with TLS
* How to secure communication between Microservices with Istio and mTLS
* How to implement authorization and authentication with the Open Source Identity and Access Management system Keycloak and JSON Web Tokens (JWT)

The exercises are based on an example application based on our Open Source Github project [Cloud Native Starter](https://github.com/IBM/cloud-native-starter/tree/master/security), build with Quarkus and Microprofile

The following screenshot shows the web application, you have to logon to see the list of articles.

![architecture](https://1980280846-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFGEw-4BAG72jtDCP4q%2Fsync%2Fc06c02cb031d6e144b03a22331a9f2a7e28fcc41.png?generation=1598017421575436\&alt=media)

## Architecture

The following diagram shows the architecture of the sample application. There is a Web-App service that serves the Javascript/Vue.js code to the browser. The Web-App code running in the browser invokes a REST API of the Web-API microservice. The Web-API microservice in turn invokes a REST API of the Articles microservice.

To see the results in the web application, users need to be authenticated and they need to have the role `user`.

![architecture](https://1980280846-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFGEw-4BAG72jtDCP4q%2Fsync%2Ff45fcdc57d3dc5a58007f5b55df8d540dcd925c2.png?generation=1598017430302576\&alt=media)

## Estimated time and level

| Time     | Level     |
| -------- | --------- |
| one hour | beginners |

## Objectives

After you complete this workshop, you'll understand the following [application security](https://en.wikipedia.org/wiki/Application_security) related topics:

**Application security provided by the platform**

* [TLS](https://en.wikipedia.org/wiki/Transport_Layer_Security)/[HTTPS](https://en.wikipedia.org/wiki/HTTPS)
* [mTLS](https://en.wikipedia.org/wiki/Mutual_authentication)

**Application security with Keycloak and Quarkus**

* [Authentication with Keycloak](https://en.wikipedia.org/wiki/Authentication) on the Web Fronted
* [Authorization in Quarkus](https://en.wikipedia.org/wiki/Authorization) for specific Microservices in the backend

_The scope of this workshop is not to explain every aspect of application security._

## About this workshop

## Agenda

These are the sections of this workshop, go through all of them in sequence, start with `1. Setup the IBM Cloud Environment` :

1. [Setup the IBM Cloud Environment](setup-the-ibm-cloud-environment/pre-work)
2. [Setup the IBM Cloud application environment](setup-the-ibm-cloud-application-environment/app-env-exercise-01)
3. [Platform security with mTLS](platform-security-with-mtls/p-sec-exercise-01)
4. [Application security with Keycloak and Quarkus](authentication-and-authorization-with-keycloak-and-quarkus/app-sec-exercise-01)

## Compatibility

The workshop with his two major parts, has been tested on the following platforms and local installations:

1. Platform security
   * IBM Cloud Kubernetes Service: Kubernetes Version 1.17, Istio Version 1.5 on IBM Cloud (pre-provisioned for the workshop or a paid cluster)
   * IBM Cloud Shell: Version 1.0.2
2. Authorization and authentication implementation
   * git 2.24.1
   * yarn 1.22.4
   * Node.js v14.6.0
   * Apache Maven 3.6.3
   * Docker 3.0.4
   * Java 9

## Technology Used

* [Microservices architecture](https://en.wikipedia.org/wiki/Microservices)
* [KEYCLOAK](https://www.keycloak.org)
* [Jakarta EE](https://jakarta.ee/)
* [MicroProfile](https://microprofile.io/)
* [Quarkus](https://quarkus.io/ingress)
* [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/)
* [Istio](https://https/istio.io)
* [Vue.js](https://vuejs.org/)
* [NGINX](https://www.nginx.com/)
* [Kubernetes](https://kubernetes.io/)
* [git 2.24.1 or higher](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
* [yarn 1.22.4 or higher](https://yarnpkg.com)
* [Node.js v14.6.0 or higher](https://nodejs.org/en/)
* [Apache Maven 3.6.3](https://maven.apache.org/ref/3.6.3/maven-embedder/cli.html)

## Credits

* [Niklas Heidloff](https://twitter.com/nheidloff)
* [Harald Uebele](https://twitter.com/Harald_U)
* [Thomas Südbröcker](https://twitter.com/tsuedbroecker)

## Additional resources

[Here](additional-resources/blogs) are some blogs that describe how this project has been implemented-

The presentation that goes with this workshop is available [here](https://github.com/IBM/cloud-native-starter-security-workshop/blob/master/workshop/images/App-Security-Final-V1-20201006.pdf).
