Hello there, ('ω')ノ
ユーザは、開発者にデータを委託するので。
彼らの信頼を獲得して維持するには、不正アクセスからデータを保護する。
セキュリティ制御を採用する必要があって。
機密性は、情報セキュリティの3つの重要な要素の1つで。
CIAトライアド(機密性、整合性、可用性)とも呼ばれて。
データを保護するには、開発者は下記のようなベストプラクティスを。
採用する必要があって。
・パスワードを保存するために複数の反復で一方向のソルトハッシュの使用
・最新のTLSプロトコルと最強の暗号を使用したデータ送信の保護
・最強の暗号化アルゴリズムとキーを使用して保存データを暗号化
・制限されたKMSへの暗号化キーの保存
下記が、正しく保存されていることを示すコードスニペットで。
String usr = request.getParameter("usr");
String pwd = request.getParameter("pwd");
User user = UserColl.find(usr);
if(user.getPassword().equals(pwd)){
//password verified
⇩
下記は、パスワードがPBKDF2+ソルト+反復でハッシュされていることを示して。
String usr = request.getParameter("usr");
String pwd = request.getParameter("pwd");
User user = UserColl.find(usr);
String givenValue = Utils.PBKDF2(pwd, user.getSalt(), user.getIterations());
if(user.getPassHash().equals(givenValue)){
//password verified
String url = "http://my-service.cloud.biz/Login?usr="+usr+"&pwd="+pwd;
URL obj = new URL(url);
HTTPURLConnection con = (HTTPURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("User-Agent", USER_AGENT);
⇩
コードは、TLS'https://'を使用し、POSTを使用してデータを送信し。
POSTは、パラメータをWebログに保存せず。
String url = "https://my-service.cloud.biz/Login";
URL obj = new URL(url);
HTTPURLConnection con = (HTTPURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", USER_AGENT);
var transaction = {"custName":custName,"address":custAddress,"creditCardNumber":custCC.CCPAN};
s3.putObject({
"Bucket": "ACME-customer-billing",
"Key": "todayTransactions",
"Body": JSON.stringify(transaction),
"Content-Type": "application/json"
},
function(err,data){
});
⇩
下記は、クレジットカード番号を削除し、保存する前にデータを暗号化して。
var transaction = {"custName":custName,"address":custAddress,"creditCardNumber":dataCleaner.removeCCPAN(custCC)};
var encTransaction = cryptUtils.AES256GCM(transaction, secretsManager);
s3.putObject({
"Bucket": "ACME-customer-billing",
"Key": "todayTransactions",
"Body": JSON.stringify(encTransaction),
"Content-Type": "application/json"
},
function(err,data){
});
Best regards, (^^ゞ