Security Testing Tool for �Backend for Frontend (BFF) Microservices
BY
MS. CHANSIDA MAKARANOND 6188010
MR. PATTARAKRIT RATTANUKUL 6188018
MR. PUMIPAT WATANAKULCHARUS 6188026
ADVISORS
DR. CHAIYONG RAGKHITWETSAGUL, ASSOC. PROF. DR. VASAKA VISOOTTIVISETH, ICT, MAHIDOL UNIVERSITY
TANAPOL NEARUNCHORN, CHANON KHAMRONYUTHA, LINEMAN WONGNAI
Microservice Architecture
Microservices are small autonomous services that function together with lightweight coding mechanisms. Microservice utilizing technologies to separate the application processes to establish an autonomous small service group operating in its own processes.
Advantages
Build software more quickly
Leverage new technologies
Scalability
Ease of deployment
Autonomous functionality
Microservice Web Application
2
X
Microservice Statistic
3
X
22.5%
Growth
Annually for the
next five years
What is BFF ?
BFF (Backend For Frontend) is a pattern of microservice that connects with all other internal services.
4
https://tsh.io/blog/design-patterns-in-microservices-api-gateway-bff-and-more/
X
BFF Example
5
https://blogs.thebitx.com/index.php/2021/06/15/the-bff-pattern-backend-for-frontend-an-introduction-by-viduni-wickramarachchi/
X
BFF Errors Are Hard to Trace
6
X
5xx or 4xx with Response contain Error exception leakage
5xx or 4xx with Response contain Error exception
?
We do not know which service(s) cause the error.
?
https://blogs.thebitx.com/index.php/2021/06/15/the-bff-pattern-backend-for-frontend-an-introduction-by-viduni-wickramarachchi/
HTTP Response Status Codes
7
X
HTTP 500 Internal Server Error
Numerous 500 Internal Server Errors are just the result of an implementation which lacks of error handling.
(e.g. 500 Instead of 400)
Possible vulnerability from 500 Internal Server Errors
8
X
Why Leakage from API Error is Problematic?
OWASP API Security Top 10 (API7:2019) - Security Misconfiguration
Example:
9
X
API Fuzzing
Fuzzing is a technique to feed a string of random characters into a program in the hope to uncover failures.
Fuzzing is good for test the sets operation of parameters that contained unexpected values and is appropriate for API testing. (Also recommend by CWE)
These fuzzed values cause unexpected behaviors and errors in the API backend.
Benefit
Helps to discover more bugs
Reduce the manual task for inputting the unexpected values
Effective at finding input validation issues for API
10
Reference: Chen et al., A systematic review of fuzzing techniques, Computers & Security, 2018
The Fuzzing Book Tools and Techniques for Generating Software Tests by Andreas Zeller, Rahul Gopinath, Marcel Böhme, Gordon Fraser, and Christian Holler
X
Problem Statements
11
X
Project Objectives
To create an application that performs API security testing on BFF systems.
To creates visualizations to help the security testers understand the security issues easily.
To offers informative education related in the detection of API security issues.
12
Performs Testing
Creates
Visualization
Offers
Education
X
13
X
Our Solution
14
Free microservice and API security
online course
API security testing tool
With testing sandbox
Available as Web application
https://microusity.dev/
Target
15
Software Developers
Students
Free API security
online course
API security testing tool
Free Online Course
16
Content In Course
17
API Security Testing Tool
18
Sandbox BFF Project For Education
https://github.com/piomin/sample-spring-microservices-new
19
X
Applying to Lineman Wongnai BFF
20
X
21
Implementation
Fuzzing Tool: RESTler
22
1
2
3
RESTler is the first Stateful REST API fuzzing tool.
RESTler will fuzz APIs according to the Swagger spec.
RESTler will identify the response and then report the possible vulnerabilities.
4
RESTler supports customization.
Reference: Atlidakis et al., RESTler: Stateful REST API Fuzzing, ICSE 2019�Website: https://www.microsoft.com/en-us/research/publication/restler-stateful-rest-api-fuzzing/
X
23
Network Monitoring Tool: Zeek
1
2
3
Zeek is network security monitoring tool with turing-complete scripting.
Zeek provides event-based computing that can be extended as needed.
Zeek focuses on trace and session rather than full packet data.
Reference: https://docs.zeek.org/en/current/
X
System Architecture
24
X
How Does Microusity Work?
25
X
26
Use Cases of Microusity
RESTler
BFF
Core API
Bad BFF and Bad Core API
Fuzzed API request
Fuzzed API request
4XX or 5XX status code
Leakage error exception detail
4XX or 5XX status code
Leakage error exception detail
X
Request Mapping
27
Test Report Design
28
X
Graph Visualization Design
29
X
DEMO
30
X
31
X
Evaluation
Microusity's educational course Security testing tool sandbox
32
X
Evaluation
Microusity's educational course Security testing tool sandbox
*The user study is conducted by following the Mahidol Central Institutional
Review Board (IRB) guideline 2022/073.2503 (still under approval).
33
X
Evaluation - Educational Content
Recruitment
Do the pre-test
Watch Microusity Educational Video
Do the post-test
Evaluation procedure
34
X
Evaluation - Educational Content
Recruitment
Do the pre-test
Watch Microusity Educational Video
Do the post-test
Evaluation procedure
Understanding of the study participant of the educational content
by assessing the difference between pre-test and post-test score
What do we evaluate ?
35
X
Evaluation - Educational Content
Recruitment
14 IT Students
7 Non-IT students
Total of
21 research participants
36
X
Result - Educational Content
Pre-test score
of IT Student
Avg : 6.72
37
X
Result - Educational Content
Pre-test score
of IT Student
Avg : 6.72
Post-test score
of IT Student
Avg : 15.3
Result - Educational Content
Pre-test score
of IT Student
Avg : 6.72
Post-test score
of IT Student
Avg : 15.3
39
X
Result - Educational Content
Pre-test score
of Non-IT Student
Avg : 6.2
40
X
Result - Educational Content
Pre-test score
of Non-IT Student
Avg : 6.2
Post-test score
of Non-IT Student
Avg : 14.2
41
X
Result - Educational Content
Overall Pre-test score
42
X
Result - Educational Content
Overall Post-test score
43
X
Result - Educational Content
44
X
Evaluation - Security testing tool sandbox
Recruitment
Watch Microusity Security Testing Tool Demo video
Do the online
questionnaire
Evaluation procedure
Security Testing Tool Online Questionnaire
45
X
Evaluation - Security testing tool sandbox
Recruitment
Watch Microusity Security Testing Tool Demo video
Do the online
questionnaire
Evaluation procedure
Security Testing Tool Online Questionnaire
We evaluate the Microusity security testing tool sandbox on 4 criteria:
Ease of use, Clearness of the result, Real-world usage, User interface design
What do we evaluate ?
46
X
Recruitment
6 IT Students
6 Non-IT students
Total of
12 research participants
Evaluation - Security testing tool sandbox
Security Testing Tool Online Questionnaire
47
X
Result - Security testing tool sandbox
Security Testing Tool Online Questionnaire
48
X
Result - Security testing tool sandbox
Security Testing Tool Online Questionnaire
49
X
Result - Security testing tool sandbox
Security Testing Tool Online Questionnaire
50
X
Result - Security testing tool sandbox
Security Testing Tool Online Questionnaire
51
X
Result - Security testing tool sandbox
Security Testing Tool Online Questionnaire
52
X
Result - Security testing tool sandbox
Security Testing Tool Online Questionnaire
53
X
Result - Security testing tool sandbox
Security Testing Tool Online Questionnaire
54
X
Evaluation - Security Testing Tool
Recruitment
Schedule time & date for interview
Live interview
Evaluation procedure
Security Testing Tool Live Interview
Participant filled
out the consent form
Full-time software developer with microservice experience focused
55
X
Evaluation - Security testing tool sandbox
Recruitment
Schedule time & date for interview
Live interview
Evaluation procedure
Security Testing Tool Live Interview
Participant filled
out the consent form
We evaluate the Microusity security testing tool sandbox
on two aspects : usability and usefulness
What do we evaluate ?
56
X
Recruitment
5 participants from LMWN
1 participants from KBTG
Total of
8 research participants
Evaluation - Security Testing Tool
Security Testing Tool Live Interview
1 participants from Brikl
1 participants from Microsoft
57
X
Result - Security Testing Tool
Security Testing Tool Live Interview
58
X
Result - Security Testing Tool
Security Testing Tool Live Interview
Test result is easy to understand
59
X
Result - Security Testing Tool
Security Testing Tool Live Interview
Graph visualization is easy to understand
60
X
Result - Security Testing Tool
Security Testing Tool Live Interview
The usability of the overall system
61
X
Result - Security Testing Tool
Security Testing Tool Live Interview
Test real-world usefulness
62
X
Result - Security Testing Tool
Security Testing Tool Live Interview
63
X
Result - Security Testing Tool
Security Testing Tool Live Interview
64
X
Evaluation - Real-world Application
Evaluation procedure
Security Testing Tool Applied to Lineman Wongnai BFF System
Test with LMWN BFF system from
April 2021 - March 2022 (based on commit time)
Run the test 3 times per commit
Find the average no. of issue of each commit
Manipulate the test result
65
X
Evaluation - Real-world Application
Evaluation procedure
Security Testing Tool Applied to Lineman Wongnai BFF System
Test with LMWN BFF system from
April 2021 - March 2022 (based on commit time)
Run the test 3 times per commit
Find the average no. of issue of each commit
Manipulate the test result
We evaluate the practicality of Microusity by applying it to a real-world BFF system
What do we evaluate ?
66
X
Result - Real-world Application
Security Testing Tool Applied to Lineman Wongnai BFF System
*Security audit and fixing done in Aug 2021
*Change in BFF implementation after Sep 2021
67
X
Result - Real-world Application
Security Testing Tool Applied to Lineman Wongnai BFF System
68
X
Result - Real-world Application
Security Testing Tool Applied to Lineman Wongnai BFF System
69
X
Result - Real-world Application
Security Testing Tool Applied to Lineman Wongnai BFF System
70
X
Result - Real-world Application
Security Testing Tool Applied to Lineman Wongnai BFF System
71
X
Challenges
Configuring the input to increase the API's coverage takes
an inordinate amount of time
Note : Each company has unique business logic, which makes data preparation for each test API prohibitively time consuming.
72
X
Configuring the input to increase the API's coverage takes
an inordinate amount of time
Note : Each company has unique business logic, which makes data preparation for each test API prohibitively time consuming.
Challenges
73
X
Configuring the input to increase the API's coverage takes
an inordinate amount of time
Note : Each company has unique business logic, which makes data preparation for each test API prohibitively time consuming.
Challenges
74
X
Limitations
75
X
Future Works
Refine the graph visualization
Improve User interface /
User experience design
Extend other exception leakage tracking on other languages
Add more leakage case on the sandbox project to have more example
76
X
Conclusion
Microusity is an educational platform and sandbox for security testing tools
The evaluation reported that our tool has a good usability and significant amount of real-world usefulness.
Therefore, the problem statements that we defined have been all addressed.
However, Microusity's technology still has room for improvement in terms of user satisfaction, usability, and market prospects, which we will address in our future work plan.
Requests Mapping Concept
78
X
Time
Without Error
Contain Error
Request A (failed)
B
C
B
C
Request A
Response A
Request B
Response B
...
Microusity testing process
79
X
80
81
Use Cases of Microusity
RESTler
BFF
Core API
1. Good BFF and Good Core API
Fuzzed API request
Fuzzed API request
4XX or 5XX status code
No Leakage error exception detail
4XX or 5XX status code
No Leakage error exception detail
X
82
Use Cases of Microusity
RESTler
BFF
Core API
2. Good BFF and Bad Core API
Fuzzed API request
Fuzzed API request
4XX or 5XX status code
Leakage error exception detail
4XX or 5XX status code
No Leakage error exception detail
X
83
X
Evaluation - Security testing tool sandbox
Security Testing Tool Applied to Lineman Wongnai BFF System
Coverage Endpoint
Use case
84
X
RESTler: Working Steps
85
Reference: https://github.com/microsoft/restler-fuzzer
X
Current BFF Architecture at LMWN
86
X
Project detail
87
X
Scope of the Project
The scope of this project includes
88
X
Expected Benefits
89
X
Related works comparison
90
5xx Resource Leakage Problem
91
https://www.microsoft.com/en-us/research/video/stateful-rest-api-fuzzing-with-restler/
Hacker can keep creating >> DoS
RESTler Compile
92
https://www.microsoft.com/en-us/research/video/stateful-rest-api-fuzzing-with-restler/
RESTler Test
93
https://www.microsoft.com/en-us/research/video/stateful-rest-api-fuzzing-with-restler/
Magic String
94
https://www.microsoft.com/en-us/research/video/stateful-rest-api-fuzzing-with-restler/
Focus of Our Solution
95
Responses with �HTTP 4xx, 5xx
Responses with �error leakage
(i.e., Java Exception)
Security testing tool online questionnaire
96
Security testing tool online questionnaire
97
Security testing tool online questionnaire
98
Security testing tool online questionnaire
99
Security testing tool online questionnaire
100