Security Testing Automation
Security Analyst Consultant | Arogya.ai
Trainer | SCADEMY - Secure Coding Academy
Community Volunteer | winja.nullcon.net
Conference Speaker | BSides, c0c0n, Nullcon, ISC2, Hack-In-The-Box, TexasCyber, Wicked6
GitHub: riddhi-shree Linkedin: riddhi-shree-001
About This Talk!
When conducting security assessments:
- Tools are important
- Numerous tools exist
- Often, one tool isn't sufficient
Is it possible to build our own tool that can consume other tools, add its own steps, reduce the manual intervention, and generate a consolidated report? How hard could this be?
Let the robots do the grunt work.
Standard Security Testing Approach
Place of Security in SDLC
In traditional software development, security is a bottleneck
- Open source automation framework
- For test automation
- For robotic process automation (RPA)
- Uses SeleniumLibrary and many other libraries
- Auto-generates test summary and test log
- Understands files with .robot extension
Basic Demo: Web Crawling
Basic Elements of Robot Framework
- Test Cases
- Report and Log
Analyze the data captured by the robots as per your instructions.
Maintain a folder structure
Power Features of Robot Framework
- Extend the capabilities of robot framework by writing custom keywords via Python scripts
- Include script results in final report auto-generated by robot framework
It is possible to repeat a set of test steps easily for an entirely different data set.
Intercepting API Requests & Responses
While robots are busy exploring the web pages, mitmproxy intercepts and saves server requests and responses.
$ mitmweb -r traffic.mitm
mitmweb can be used to further analyze the saved server requests and responses.
Apply Human Intelligence... Now!
While the robots were at work, it was a break for you. With a refreshed mind, now is the time to look at all the gathered data and identify potential attack vectors. You can get a good understanding about the target application.
If there's a need, the robot test cases can be enhanced further to automate the form filling process, or any other manual task, including reading emails from your email account or running commands in your bash shell, etc.
If you have clarity in your mind regarding the exact steps that you wish to perform, writing robot test cases is really a trivial process.
Pabot: Parallel Processing
- A parallel executor for Robot Framework tests
Split one execution into multiple and save test execution time
If same action needs to be performed on different URL's, then parallel processing can be applied
It's easy to take our automation to the next level:
- Prepare automation test cases
- Build a Jenkins pipeline
- Every time code is pushed to GitHub, trigger a Jenkins build via webhook
- Jenkins will spin up docker containers and execute test cases
- Test report is pushed to S3 bucket
- The updated test report is served via CloudFront
$ ngrok http 8080
Serving Test Report via S3 and CloudFront
By Riddhi Shree Chaurasia