/safeguarding-payments-fraud-detection-ai-ml-and-data-insights

Safeguarding Payments: Fraud Detection, AI/ML and Data Insights

Primary LanguageHCLMIT No AttributionMIT-0

Safeguarding Payments

Safeguarding Payments: Fraud Detection, AI/ML and Data Insights

Leveraging AI/ML and data analytics to build an intelligent fraud detection system that safeguards payments and provides financial institutions with actionable insights to stop fraudulent transactions.

Architecture Diagram

Architecture Diagram

Getting Started

This solution is designed to be flexible and robust with modular code stored across the following directories:

  1. iac/ - Infrastructure as Code
    • iac/cicd/ - CI/CD Pipeline Module
    • iac/core/ - Core Infrastructure Module
    • iac/quicksight/ - QuickSight Infrastructure Module
  2. app/ - Application Code
    • app/anomaly-detector/ - Anomaly Detector Microservice (Python-based Module)
    • app/data-collector/ - Data Collector Microservice (Java-based Module)
    • app/postgres/ - PostgreSQL Database

Pre-requisites

Deploy CI/CD Module

Starting at the ROOT level of this repository, run the following command:

/bin/bash ./bin/deploy.sh -d iac/cicd -r us-east-1 -s spf-backend-us-east-1

REMINDER: Make sure to replace us-east-1 with your target AWS region and spf-backend-us-east-1 with your S3 bucket.

Once the build execution is successful, you should be able to login to AWS Management Console, navigate to AWS CodeBuild service and see the newly created project named something like spf-cicd-pipeline-abcd1234.

The suffix abcd1234 in your AWS CodeBuild project name is the solution deployment ID. This value can be used to test this solution, once deployed successfully.

Deploy Core Module

Using CI/CD pipeline created in the previous step, run the following commands:

aws codebuild list-projects --region us-east-1 \
    --query 'projects[?contains(@, `spf-cicd-pipeline`) == `true`]'

REMINDER: Make sure to replace us-east-1 with your target AWS region.

The output from the previous command should be used as the project-name input in the next command (just replace spf-cicd-pipeline-abcd1234 with new value):

aws codebuild start-build --region us-east-1 \
    --project-name spf-cicd-pipeline-abcd1234

REMINDER: Make sure to replace us-east-1 with your target AWS region and spf-cicd-pipeline-abcd1234 with the value from the previous command.

Deploy Any Module

The CI/CD pipeline can be used to deploy any module (including itself, although not recommended). The order of operations for entire solution deployment is:

  1. In previous steps we deployed iac/cicd (CI/CD module) and iac/core (Core module)
  2. After done with iac/cicd and iac/core, deploy any other Infrastructure modules from iac/ directory (e.g. iac/quicksight)
  3. After done with Infrastructure modules, deploy any dependencies required by Application modules from app/ directory (e.g. app/postgres)
  4. After done with Application dependencies, deploy any other Application modules from app/ directory (e.g. app/anomaly-detector or app/data-collector)

To pick which module to deploy (e.g. app/postgres), simply pass the directory relative path value to SPF_DIR environment variable as shown below:

aws codebuild start-build --region us-east-1 \
    --project-name spf-cicd-pipeline-abcd1234 \
    --environment-variables-override "name=SPF_DIR,value=app/postgres"

Cleaning Up

If you decide to clean up your AWS environment and remove all AWS resources deployed by this solution, this can be easily achieved by running the following two commands:

/bin/bash ./bin/deploy.sh -c true -d iac/core -r us-east-1 -s spf-backend-us-east-1
/bin/bash ./bin/deploy.sh -c true -d iac/cicd -r us-east-1 -s spf-backend-us-east-1

REMINDER: Make sure to replace us-east-1 with your target AWS region and spf-backend-us-east-1 with your S3 bucket.

Support

Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.

Roadmap

If you have ideas for releases in the future, it is a good idea to list them in the README.

Authors and acknowledgment

Show your appreciation to those who have contributed to the project.

Contributing

See the CONTRIBUTING for more information.

Security

See the Security Issue Notifications for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE for more information.