How to store sensitive information on a hosting provider's servers?

manidos :

I'm using hostinger's Single Shared Hosting for my website. I have created a MySQL database and I need to have access to username and password in my PHP api endpoints. So, I created a /config.php file with -rw-r--r-- permissions:

<?php
    define("dbHost", "localhost");
    define("dbUsername", "XXXXXXXXX");
    define("dbPassword", "XXXXXXXXX");
?>

Is it a good way of storing such information?

ARVIND IT :

You can't start without making a config file. But you can encrypt the data of your database. Below are a few simple steps to encrypt your data in MySQL 8.0. This process relies on a keyring file. This won’t meet compliance requirements (see KEY MANAGEMENT SYSTEMS below), but it’s a good first step.

  • Check your version of MySQL. It should be MySQL 5.7 or 8.0. Pre-load the plugin in your my.cnf: early-plugin-load = keyring_file.so

Execute the following queries:

  1. INSTALL PLUGIN keyring_udf SONAME ‘keyring_udf.so’;
  2. CREATE FUNCTION keyring_key_generate RETURNS INTEGER SONAME ‘keyring_udf.so’;
  3. SELECT keyring_key_generate(‘alongpassword’, ‘DSA’, 256);
  4. ALTER TABLE titles ENCRYPTION = ‘Y’;

Per documentation warning: The keyring_file and keyring_encrypted file plugins are not intended as regulatory compliance solutions. Security standards such as PCI, FIPS, and others require use of key management systems to secure, manage, and protect encryption keys in key vaults or hardware security modules (HSMs).

I hope this article will work for you.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to store sensitive information in COBOL?

How to store sensitive information on client side using wpf

object or container used to store sensitive information

Store sensitive information on the client side (Web)

How to store different user's information in database?

How to store user's provider account in Firebase Realtime Database?

Where to store user's sensitive data?

Why is using UserDefaults to store sensitive information on iOS not safe?

As the Azure Table Storage does not support Encryption, is it safe to store sensitive information into it?

Where do i store sensitive information in Node JS

how could `secret` protect sensitive information in Kubernetes

How to store sensitive data in React Native code?

How to store sensitive data in react js frontend?

Where does Netbeans store the information located in Services->Servers?

How to store information in solr?

How to store user's information for future use from MySQL

How best to store Subversion version information in EAR's?

Android - How to store an extra hidden information(s) (by tag) in layout

How does a compiler store information about an array's size?

How to install Web Deploy for Hosting Servers on Windows Server 2016

DNS only seems to work with VPS provider's servers

hosting an application with the hosting provider (shared hosting)

How to store audio files in server (during hosting)

Hosting multiple web servers under single static IP how web hosting companies manage this

How to store data for a user across servers discord

This Account has been suspended. Contact your hosting provider for more information

How to make sure hosting provider can not access my secrets?

How to find actual hosting provider for website that are connected to cloudflare.com

High traffic hosting provider