웹서버에서 injection 공격에 의해서 의도치 않는 데이터 위변조를 막기위해서
서버측 에서 접속하는 mysql 계정에 select 권한만 주고 데이터 변경 로직은 프로시저로
처리 하기 위한 권한 설정.
use mysql;
-- 계정 확인
select host,user from user;
1.
-- 이미 존재할 경우만 계정 삭제
DROP USER 'client'@'%'; -- client 라는 계정 생성 하고 myschema 스키마 에 모든 테이블에 모든 원격접속을 허용하고 패스워드를 설정.
grant usage on myschema.* to 'client'@'%' identified by 'password'
-- myschema 스키마에 모든 테이블에 모든 권한 부여
grant all privileges on myschema.* to 'client'@'%' identified by 'password' with grant option;
-- myschema 스키마에 모든 테이블에 추가,삭제,변경 권한 삭제.
revoke DELETE,UPDATE,INSERT on myschema.* from 'client'@'%';
-- 적용
flush privileges;
-- 기타
-- 특정 권한주기
grant select on myschema.* to 'client'@'%' identified by 'password';
-- 프로 시저 실행 권한 주기.
grant execute on procedure myschema.* to 'client'@'%' identified by 'password'; -- 프로시저 실행 권한 추가.
피드 구독하기:
댓글 (Atom)
[lunux]리눅스 폴더별 용량 확인
리눅스 폴더별 용량 확인 조회 하고자 하는 디렉토리 리스트가있는 경로로 이동후 du -h --max-depth=1
-
pom.xml <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId&g...
-
수십대의 서버에 특정 쉘을 실행한다거나 파일을 수정해야할경우 호스트 입력 아이디 입력 패스워드 입력은 여간 짜증나는일이 아닐수 없다. 이를 한방에 해주는 방법 teraterm 를 설치한다( putty 는 버리자 ) 예를 들면 19...
-
다른 페이지로 이동 해서 프로세스 실행후 다시 이전 페이지로 돌아와야할경우 page url 을 파라미터로 넘겨야 하는데 location.protocol : 프로토콜 예) https: location.host : 도메인 예) naver.com l...
댓글 없음:
댓글 쓰기