you can keep your database vendor portable by using an encapsulation class such as adoDB for php or other framework like zend, codeigniter/cake/symphony,
it will add more header to the processing power (debatable) but it will far reduce the time to develop the app, and the DB.
데이터베이스 보안
Table of Contents
최근에, 데이터베이스는 웹사이트에 다양한 동적 내용을 제공하기 위한 모든 웹 기반 어플리케이션의 기본 구성 요소입니다. 매우 민감하거나 비밀스러운 정보가 데이터베이스에 저장될 수 있으므로, 데이터베이스의 보호에 대하여 심각하게 고려해야 합니다.
어떠한 정보를 가져오거나 넣으려면 데이터베이스에 접속하고, 적합한 질의를 전송하고, 결과를 가져오고, 접속을 닫습니다. 최근에, 이 작업에 가장 많이 사용하는 질의 언어는 구조적 질의 언어(SQL)입니다. 어떻게 공격자가 SQL 질의를 건들일 수 있는지 확인하십시오.
예측할 수 있듯이, PHP는 데이터베이스 자체를 보호할 수 없습니다. 다음 섹션은 PHP 스크립트에서 데이터베이스에 접근하고 조작하는 방법에 대한 매우 기초적인 설명입니다.
간단한 규칙을 명심하십시오: 철저하게 방어. 더 많은 위치에서 데이터베이스의 보호를 증가하기 위한 작업을 한다면, 공격자가 저장된 정보를 빼낼 수 있는 성공 가능성이 줄어듭니다. 데이터베이스 스키마와 어플리케이션 처리의 좋은 디자인은 최대한의 공포와 함께 하는 것입니다.
r at rpl dot name
25-Feb-2011 04:39
ja4chem at yahoo dot co dot uk
17-Jan-2008 06:07
SQL injection could be prevented by inserting only base64_encoded data into the data base. Before searching the data base for a certain value or string base64_encode the search string and then start the query.
Dave Martin
16-Aug-2007 09:45
The posting below is at the very best extremely POV.
There is no more reason to assume you would want to change database vendor than there is to assume you might want to port your php code to Java for example. In either case, its going to be a matter of luck where your business rules sit.
Even if your business rules sit in your application, SQL is NOT portable. Oracle outer joins and pivot queries for example, can look completely different to those in other vendors software (particularly from 8i or lower). This fact alone means that changing your DB vendor requires work on your business rules either in the database or in the application.
Having your rules in the database and keeping the sql in application simple, will at least keep the work in the database if you need to change DB vendor. If you have the rules in the PHP, you'll have to change both.
x12code at yahoo dot com
14-Aug-2007 07:18
About offloading business logic to views and queries facilitated by the database engine, I seek to avoid this as much as possible, and only do so when such would drastically improve efficiency and user response time.
For instance, where I am there is database staff and application staff. Trying to do analysis on existent applications can easily become a snipe hunt.
The database should be kept discreet as much as possible from the application, such that any database or database provider can easily be substituted with a minimum of cognitive effort on the part of the one setting up a new database. If functionality has been offloaded to the database, additional testing is required to make sure triggers and views were done correctly, again, and that they work right.
Also, keeping all business logic with the application allows all functionality and documentation to be readable in one place, which is invaluable when doing subsequent analysis on an existing application. The worst thing is to have functionality scattered here and there.
Keeping everything with the application means one group of people is responsible, as in my case, application staff. Fewer requests go back and forth. Remember, anytime someone else is brought into the picture, such as asking a DBA to create a view or trigger for you, that DBA must take responsibility over his or her work, with whatever requirements, causing more bureaucracy and administrative complexity.
me at meme dot com
28-Jun-2007 09:53
<?php
$getal1 = 5.5;
$getal2 = 2.0;
function printDeling() {
$resultaat = global $getal1 / global $getal2;
return $resultaat;
}
function printVermenigvuldiging() {
$resultaat = global $getal1 * global $getal2;
return $resultaat;
}
function printSom() {
$resultaat = global $getal1 + global $getal2;
return $resultaat;
}
function printAftrekking() {
$resultaat = global $getal1 - global $getal2;
return $resultaat;
}
(printDeling()>=7) ? print "<font color=\"green\"> printDeling()</font>" : print "<font color=\"red\"> printDeling()</font>" ;
?>
somebody at whocares dot com
10-May-2006 06:33
Encrypting user input doesn't do much to guard against SQL injection attacks. Naturally, you want to encrypt sensitive information across the wire, but if a user puts in malicious data into an input field, any encryption scheme will just dutifully unpack it at the other and and still run the SQL injection hack if you haven't guarded against it.
Encryption is not magic pixie dust to sprinkle on things to make them more secure.
30-Jun-2005 01:27
you can also chamge CHMOD for some file containing "user names" or "passwords"
webmaster at rackhouse dot net
13-Mar-2005 12:38
On a database design point of view, you should make sure that you design databases in a manor that any query run from them need minimal input from the user and if it requires user input, that you encrypt where possible.
jjahn at SPAMSUCKS dot signicast dot com
20-Jun-2003 07:47
I would say one of the best ways to guard against SQL injection is to use the excellent PEAR DB package. If you prepare() and execute() your queries, PEAR will automagically addslashes and handle the query depending on your RDBMS. And of course, for repeatable queries prepare and execute will give you a bit of a readability and speed increase.
