ChamplainTechJournals/db-security-sec300/week2.md
2025-04-19 23:42:08 -04:00

1.1 KiB

Week2

DB Webserver Connection

  • create user for remote access:

  • allow connections through firewall: sudo ufw allow from 0.0.0.0 to 0.0.0.0 port 3306 proto tcp
  • get python dependencies: sudo apt update && sudo apt install python3 python3-pip python3-venv
  • cd /home/champuser/proj/
  • create virtual environment: python3 -m venv .venv activate: . .venv/bin/activate

install flask: pip install flask

Create directory for Flask: mkdir Flask, cd Flask

dependencies pip install Flask-MySQLdb pip install flask-mysql pip install cryptography

if localhost doesn't work, change bind-address in /etc/mysql/mysql.conf.d/mysqld.cnf

Filter from application

  • add form action

  • add python form processing

for pets db