UPI Study › Courses › Database Programming › Free lessons › Lesson 12.1 Free with a free account
Managing Database Security: Key Practices and Tools
Database Programming · Chapter 12: Database Security and AuditingSection 12.1 · lesson 70 of 7610 min · free with a free account
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Database Programming.
Lesson complete
Earn the 3 college credits for Database Programming
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Securing Databases with SQL: Techniques and Examples →← Regular Expressions Across Platforms — MySQL and SQL Server Implementation ComparedNext lesson: Securing Databases with SQL: Techniques and Examples →
A free account plays all of Chapter 1 and 3 more lessons of Database Programming. Create a free account →
In this lesson
Protect confidentiality, integrity and availability with accounts, privileges and patching.
- Explain the CIA triad and match database threats to the goals they harm
- Distinguish authentication from authorization in MySQL and SQL Server
- Apply least privilege and account hygiene to database users
- Describe how patching, hardening and assessment tools reduce risk
Free study notes
Get this lesson's notes by email
The key points and 4 practice questions with answers, in your inbox. One email, free.
One email. Unsubscribe in one click.
Transcript
Everything said in the video, section by section (1,097 words). Read along, or search it.
Opening Scenario
A Backup Left in a Shared Folder
Maya Rao owns Lantern Books, our fictional campus bookstore. A backup of its customer database appears in a shared folder. Amina Diallo, the database administrator, closes access. The live shop still answers queries, and no prices have changed. Maya asks whether a working database means the business is secure. What exactly failed, and what would prevent another copy from escaping?
CIA Triad
Confidentiality, Integrity and Availability
Confidentiality means information reaches only people entitled to see it. The exposed customer copy violates that goal, even while the store keeps selling. Integrity means protection against improper changes or destruction. An unauthorized price edit could make every later receipt wrong. Availability means timely, reliable access for authorized users. A locked database on sale day threatens that goal. These goals form the CIA triad. One incident can harm several goals, and a safeguard can help more than one. Amina also checks tradeoffs. A lockout rule that blocks an attacker can accidentally block the cashier, so recovery needs planning.
Common Threats
From Stolen Passwords to Exposed Backups
A threat is something that could harm those goals. Stolen passwords let someone act through a real account, while excessive permissions magnify the damage. Unpatched software leaves known flaws available. Misconfiguration exposes unused accounts, open ports, or features that the store never needed. Insider error matters too. A trusted employee can delete the wrong rows, or deliberately misuse legitimate access. Exposed backups and network traffic can leak information without changing the live database. Ransomware and overload can make the service unavailable. Amina maps each threat to a safeguard. A firewall does little for a backup already sitting in a broadly readable folder.
Authentication and Authorization
Proving Identity, Then Limiting Actions
Authentication proves who is connecting. Authorization decides which actions that identity may perform on which objects. Amina can accept a valid login and still refuse a request to change product prices. Signing in does not grant unrestricted access. MySQL identifies an account using both its user name and its host. A local account and a remote account can have different rights. In MySQL 8.4, caching_sha2_password is the default authentication plugin. Older native-password configurations need migration planning. SQL Server distinguishes a server login from a database user. Windows authentication can centralize identity policy; mixed mode also permits SQL logins. A password-based connection needs network protection too. Proving identity does not automatically protect every query traveling over the connection.
Application Risk
When Input Becomes Part of a Query
Another threat enters through the application. Leo Park, the developer, discovers a search routine that pastes customer input into SQL text. A crafted value can become a condition in the command. This is SQL injection: data changes the meaning of the query. The database acts with the application account's permissions. It cannot infer which characters came from the programmer and which came from the visitor. Parameterized queries keep values separate from the command structure. Narrow application rights then limit the harm from another flaw. Amina keeps these jobs distinct. Binding prevents this route into the command; permission limits control what a compromised account can reach.
Least Privilege
Only the Rights Each Job Needs
Least privilege means giving each account only what its job requires. A report reader does not need to change orders. The order application can add orders and their items. It does not need permission to change product prices or grant other accounts access. An inventory task may need to update stock. Granting every product column would also expose price changes, so narrower rights deserve consideration. Use an identity for each person or application, and organize repeated permissions into roles. Shared powerful logins weaken accountability and complicate departures. Amina reserves administrator access for administration. For the website and daily reporting, she avoids MySQL root and SQL Server sa.
Account Hygiene
Retire, Review and Protect Accounts
Account hygiene means maintaining identities throughout their lives. Remove departed staff, review dormant accounts, and disable unneeded anonymous or test access. Use strong unique secrets, protect them outside source code, and review password and lockout policies for the deployment. MySQL offers password validation, history, expiry, and failed-login controls. SQL Server can apply Windows password policy to SQL logins. Those controls are options to configure thoughtfully. Amina does not copy a sample expiry schedule without considering the organization's requirements. Keep the built-in administrator protected. Restrict MySQL root connections; keep SQL Server sa disabled when it is unnecessary.
Patching and Hardening
Fix Known Flaws, Remove Extra Surface
A patch is a vendor update that fixes a flaw. Amina inventories database and operating-system versions, then watches their security notices. She tests an update with the store's applications on a copy. Before production changes, she confirms a usable backup and recovery plan. After installation, she verifies the version and the application behavior. An update is incomplete if the cashier can no longer place an order. Hardening reduces surface area: the features and entry points available to an attacker. Disable unneeded services, close exposed ports, and restrict sensitive files. Patching fixes known defects; hardening removes unnecessary opportunities. Both require repeated review, because software and settings change.
Security Tools
Scanners, Benchmarks, Firewalls and Encryption
For MySQL, mysql_secure_installation helps review initial accounts, remote root access, and test data. Its prompts depend on the installed configuration. For SQL Server, surface-area settings help disable unneeded features. Powerful operating-system features deserve special caution. Vulnerability assessment finds known risky settings. Data discovery and classification identify sensitive columns, so the team can choose protections deliberately. A benchmark is a published configuration guide. CIS Benchmarks support structured reviews, while firewalls limit who can reach database listeners. Encryption protects particular exposures in storage or transit. It complements permissions; an authorized query can still return readable information. Amina records an owner and a review date for each control. A scanner report alone does not keep a setting secure.
Quick Check
A Cashier Who Can Edit Prices
One staff member's sign-in can edit product prices, though that person only rings up purchases. Which proposed change directly addresses that exposure? Pause, and decide. Narrow the account to sales actions only. Least privilege gives an account just the actions its job requires. A port rule limits who can reach the server, not what a valid login may do. More backup copies help recovery, not excess rights. Then repeat the access test with that staff identity, so the change is verified rather than assumed.
Resolution
Restricted Backup Storage and Owned Tasks
Back at Lantern Books, Amina replaces the shared folder with restricted backup storage, checks who could access it, and reviews the incident. Maya sees why the working checkout never proved the data was safe. Confidentiality failed while availability continued. The team also schedules permission reviews, updates, and recovery tests. Each task has an owner, because security depends on sustained habits.
Key Takeaways
Security Depends on Sustained Habits
Protect confidentiality, integrity, and availability together. Ask which goal each control supports. Authenticate identities, then authorize only the actions their jobs require. Maintain accounts, patch supported software, and remove unnecessary surface area. Use tools to check the controls, and protect copies as carefully as the live database.
About Database Programming at UPI Study
Database Programming (Computer Science 381) is a self-paced online course of 76 video lessons in 12 chapters, from database applications, SQL setup, schema planning and normalization to keys and constraints, data types, filtering and sorting, joins, subqueries, views, indexes, ROLLUP and PIVOT, regular expressions and database security. It carries a NCCRS credit recommendation for 3 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus All Computer Science courses Every credit course with PRO →
Why take it here
Why students take Database Programming with UPI Study
Where the credit goes
Universities that work with NCCRS
Database Programming carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About Managing Database Security: Key Practices and Tools
What is the CIA triad in database security?
What is the difference between authentication and authorization in a database?
What is the principle of least privilege in databases?
What is the difference between patching and hardening a database server?
About the Database Programming course
How many college credits is Database Programming?
How much does Database Programming cost and what is included?
Which universities accept UPI Study credits?
How long does Database Programming take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 3 credits in Database Programming.
76 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
Updated
3 credits · NCCRSEnroll →