Robot

Cyber Loss Prevention Challenge

This robot solves the Cyber Loss Prevention Challenge.

Playwright

This robot solves the Cyber Loss Prevention Challenge.

The Cyber Loss Prevention team at Eagle One Financial has reached out to you for help: Help the team by scraping all the leaked credit card numbers available for sale at "Ryan’s Club", run them against a database of Eagle One Financial customers to identify if any of Eagle One’s customers have been impacted, and capture the details for each impacted customer in a CSV so that Eagle One Financial can proactively deactivate and re-issue cards for impacted customers.

The robot code

Note: There is no one and only "correct" solution. This is just one example of how you might use Robocorp to solve this challenge.

The robot is split into multiple files.

tasks.robot

The tasks.robot file defines the high-level task. The keywords are split to separate robot files to avoid a long robot file. The separate robot files are imported using the Resource definition in the Settings section.

This robot uses the following libraries:

shared.robot

There are a couple of libraries that are needed in multiple robot files. These are placed in the shared.robot file, which can then be imported to other robot files.

scraper.robot

The scraper.robot contains the web scraping logic for the credit card dump data.

The login credentials are retrieved from the vault.

The robot figures out the number of pages it needs to scrape by looking at the pager element.

It scrapes the data from the table on each page and returns a list of dictionaries containing the customer and card data.

database.robot

The customer data is stored in an SQLite database. The robot downloads the database file using the RPA.HTTP library, connects to the database using the RPA.Database library, and uses SQL to query each of the customers found in the credit card data dump. If a match is found, that customer is compromised and needs to be reported using the cancellation CSV file.

The Catenate keyword is used to break the SQL statement on multiple lines for better readability.

csv.robot

The csv.robot contains the CSV logic. The Evaluate keyword executes a Python expression that transforms each customer data dictionary into a comma-separated string that is then appended to the CSV file. Finally, the CSV file is uploaded.

Take a screenshot of the result

Finally, the robot takes a screenshot of the result modal.