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.
This solution is designed to be flexible and robust with modular code stored across the following directories:
iac/
- Infrastructure as Codeiac/cicd/
- CI/CD Pipeline Moduleiac/core/
- Core Infrastructure Moduleiac/quicksight/
- QuickSight Infrastructure Module
app/
- Application Codeapp/anomaly-detector/
- Anomaly Detector Microservice (Python-based Module)app/data-collector/
- Data Collector Microservice (Java-based Module)app/postgres/
- PostgreSQL Database
- an AWS account
- already installed AWS CLI, JQ, Kubectl, Terraform, and Terragrunt
- AWS access keys used by AWS CLI
- allowed AWS CLI permissions to create AWS Identity and Access Management (IAM) roles and AWS CodeBuild project (e.g., IAMFullAccess and AWSCodeBuildAdminAccess)
- an Amazon Simple Storage Service (S3) bucket used by Terraform remote state (e.g. spf-backend-us-east-1)
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.
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.
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:
- In previous steps we deployed
iac/cicd
(CI/CD module) andiac/core
(Core module) - After done with
iac/cicd
andiac/core
, deploy any other Infrastructure modules fromiac/
directory (e.g.iac/quicksight
) - After done with Infrastructure modules, deploy any dependencies required by
Application modules from
app/
directory (e.g.app/postgres
) - After done with Application dependencies, deploy any other Application
modules from
app/
directory (e.g.app/anomaly-detector
orapp/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"
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.
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.
If you have ideas for releases in the future, it is a good idea to list them in the README.
Show your appreciation to those who have contributed to the project.
See the CONTRIBUTING for more information.
See the Security Issue Notifications for more information.
This library is licensed under the MIT-0 License. See the LICENSE for more information.