Sample Spring Boot Application
Last updated
Was this helpful?
Last updated
Was this helpful?
This is the initial demo application that will be used for showing all security patterns when deploying and running this in Kubernetes.
This application provides two REST APIs:
Greetings API
GET : Shows greeting with configured default message
GET : Shows greeting with custom message
Actuator API
Exposes all available of Spring Boot (including sensitive ones)
The application is kept simple by intention to focus on the security parts instead of having to describe a complex use case model.
Just start it by running com.example.app.Step1App.
This should return the default greeting:
This should return a custom greeting:
This should return the default greeting:
This should return a custom greeting:
By using the browser we can try to put in some cross-site scripting (XSS) snippets into the message parameter.
Try to display a popup via javascript:
With the default code XSS is not working as there are multiple defense mechanisms in place:
Input validation only permits maximum length of 30 for url message parameter
The application is safe against interpreting the reflected greeting by using output escaping (Html AND javascript)
Content-Type is set to application/json
Note: If you disable all these precautions then you should see XSS working. Please do not disable those precautions in productive code !!!
The gradle build for this application includes specific security relevant parts:
SpotBugs (with Security Add-On): Automatically does static code analysis for security issues
OWASP Dependency Check: Automatically checks all gradle dependencies for known vulnerabilities
```http request alert('XSS')