Discrete Math demo is a tool built by Tarek Mulla, student number s3992651.
The purpose of this application is to demonstrate the material of Course MATH2415 - Discrete Mathematics in RMIT University | Master of Cyber Security.
The project contains 2 parts: Infrastructure, and Web application
The infrastructure part responsible for provisioning the cloud resources in AWS, this part is built using Terraform.
The RMIT infrastructure should be provisioned before the application infrastructure, this repo is responsable to create all base (e.g. ECR, S3) and shared (e.g. VPC, NAT) resources for RMIT projects; Please check the repository rmit-infrastructure for more details.
The following architecture shows all the components in the cloud infrastructure (both the base and the app resources):
The web application is built using flask framework, and is hosted in Fargate in AWS. The application uses the web template engine Jijna for the python programming language.
The web application can be accessed via the URL: discrete-math.rmit.mulla.au; The application interacts with the backend by sending requests to the API gateway api.discrete-math.rmit.mulla.au.
Note that the api gateway required a token to authorize access to its resources.
The web application provides access to the user after they signing in to the website, all user details are saved securely in Amazon Cognito.
Before you provision the infrastructure you will need to make sure the following requirements are satisfied:
- Make sure the RMIT nfrastructure is provisioned in the same account the web application will deployed to.
The application has couple of check to follow best practices, and make sure the application is secure, please notice that this part still in-progress.
The project use github action to check, test, and deploy the application. The followings are the actions it supported now:
- ecr-image: This action responsable on generating the ECR image and push it to AWS ECR when a new commit pushed to the main branch.
- check-python: This action is triggered whenever a new pull request opened, it runs couple of tools to check the python linting, format, static code analysis, and run unittests for the python source code.
- terraform-plan: This action checks the Terraform plan and shows it in the pull request.
- terraform-deploy: This action deploys the terraform infrastructure when a new commit pushed to the main branch.
The repository has integration with other tools to check the security for the source code; Those tools are:
- gitguardian: To scan the opened pull requests and check if it contains secrets or senstive information in the code changes.
- Snyk: To scan the source code, and find vulnerabilities in both Terraform and docker images, and suggest security best practices.
- Install Terraform
- Install and configure AWS CLI based on where you want to provision the tool.
- Create
terraform.tfvars
file, and customize the terraform variable values. - Init, plan and apply terraform. See: Provisioning Infrastructure
- Install docker
- Install docker compose
- Create .env by copying .env.example and update the values
- Make sure docker is running
- Run commands that provided in ./Makefile:
make run
: run the webapp, can be accessed on localhost:8080make stop
: stop the webapp
You can contact me directly using one of the following:
- Linkedin: Tarek Mulla
- Personal Email rmit@mulla.au
- University Email s3992651@student.rmit.edu.au
Resources used to help creating this application: