ogg登陸資料庫使用者密碼加密
使用過gg的人應該都知道,在配置抽取和複製程式引數檔案的時候都需要配置ogg使用者以登陸資料庫,這裡就涉及到一個資料庫安全的問題,不過還好,ogg提供了一些加密方法,如下摘錄自gg的administrator guide中關於加密資料庫使用者密碼的一段說明:
To encrypt the password
1. Run GGSCI.
2. Issue the ENCRYPT PASSWORD command.
ENCRYPT PASSWORD
Where:
❍
quotes. If the password is case-sensitive, type it that way.
❍
◗ AES128 uses the AES-128 cipher, which has a key size of 128 bits.
◗ AES192 uses the AES-192 cipher, which has a key size of 192 bits.
◗ AES256 uses the AES-256 cipher, which has a key size of 256 bits.
◗ BLOWFISH uses Blowfish encryption with a 64-bit block size and a variablelength
key size from 32 bits to 128 bits. Use BLOWFISH only for backward
compatibility with earlier Oracle GoldenGate versions.
❍ ENCRYPTKEY
the ENCKEYS lookup file. The key name is used to look up the actual key in the
ENCKEYS file. Using a user-defined key and an ENCKEYS file is required for AES
encryption. To create a key and ENCKEYS file, see “Generating encryption keys” on
page 134.
❍ ENCRYPTKEY DEFAULT directs Oracle GoldenGate to generate a random key that is then
stored in the trail so that decryption can be performed by the downstream process.
This type of key is insecure and should not be used in a production environment.
Use this option only when BLOWFISH is specified. ENCRYPT PASSWORD returns an error
if AES is used with DEFAULT.
If no algorithm is specified, AES128 is the default for all database types except DB2 on
z/OS and NonStop SQL/MX, where BLOWFISH is the default.
3. The encrypted password is output to the screen when you run the ENCRYPT PASSWORD
command.
下面介紹下如何進行加密:
1.使用oracle預設生成的key的加密方法:
GGSCI (testdb) 31> encrypt password ogg,ENCRYPTKEY default
Using default key...
Encrypted password: AACAAAAAAAAAAADAHBLDCCIIOIRFNEPB
我這裡沒有指定具體的加密演算法,預設就是AES128演算法。
測試使用加密後的密碼登陸資料庫:
GGSCI (testdb) 45> dblogin userid ogg, password AACAAAAAAAAAAADAHBLDCCIIOIRFNEPB,ENCRYPTKEY default
Successfully logged into database.
然後修改抽取程式:
GGSCI (testdb) 35> edit params ext1
EXTRACT EXT1
setenv ( NLS_LANG = AMERICAN_AMERICA.ZHS16GBK )
USERID ogg,PASSWORD AACAAAAAAAAAAADAHBLDCCIIOIRFNEPB,ENCRYPTKEY default
exttrail /home/oracle/ggs/dirdat/k1
DYNAMICRESOLUTION
DDL INCLUDE MAPPED
DDLOPTIONS ADDTRANDATA,REPORT
FETCHOPTIONS, USESNAPSHOT, NOUSELATESTVERSION, MISSINGROW REPORT
STATOPTIONS REPORTFETCH
WARNLONGTRANS 1H, CHECKINTERVAL 5M
TABLE mynet_app.*;
最後重啟抽取程式就ok了~~
2.使用指定key的加密方法:
administrator guide中介紹如下:
Generating encryption keys
You must generate and store encryption keys when using:
❍ ENCRYPTTRAIL with KEYNAME
❍ ENCRYPT PASSWORD with ENCRYPTKEY
❍ RMTHOST or RMTHOSTOPTIONS with ENCRYPT (see page 133)
This procedure is not required if you are using the following encryption options:
● ENCRYPT PASSWORD with ENCRYPTKEY DEFAULT (valid only when using BLOWFISH)
● ENCRYPTTRAIL without options (for 256-key byte substitution)
In this procedure you will:
● Create one or more encryption keys.
● Store the keys in an ENCKEYS lookup file on the source system.
● Copy the ENCKEYS file to each target system.
You can define your own key or run the Oracle GoldenGate KEYGEN utility to create a
random key.
To define your own key
Use a tool of your choice. The key value can be up to 128 bits (16 bytes) as either of the
following:
● a quoted alphanumeric string (for example “Dailykey”)
● a hex string with the prefix 0x (for example 0x420E61BE7002D63560929CCA17A4E1FB)
To use KEYGEN to generate a key
Change directories to the Oracle GoldenGate home directory on the source system, and
issue the following shell command. You can create multiple keys, if needed. The key values
are returned to your screen. You can copy and paste them into the ENCKEYS file.
KEYGEN
Where:
❍
❍
Example:
KEYGEN 128 4
To store the keys in an ENCKEYS lookup file
1. On the source system, open a new ASCII text file.
2. For each key value that you generated, enter a logical name of your choosing, followed
by the key value itself.
❍ The key name can be a string of 1 to 24 alphanumeric characters without spaces or
quotes.
❍ Place multiple key definitions on separate lines.
❍ Do not enclose a key name or value within quotes; otherwise it will be interpreted
as text.
Use the following sample ENCKEYS file as a guide.
3. Save the file as the name ENCKEYS in all upper case letters, without an extension, in the
Oracle GoldenGate installation directory. 4. Copy the ENCKEYS file to the target Oracle GoldenGate installation directory. The key
names and values in the source ENCKEYS file must match those of the target ENCKEYS file,
or else the data exchange will fail and Extract and Collector will abort with the
following message:
GGS error 118 – TCP/IP Server with invalid data
下面介紹詳細的加密過程:
[oracle@testdb ggs]$ ./keygen 128 1
0xB793945154E4C74F9AF5D050E200E429
這裡的128代表128位的加密演算法,1表示生成幾個key。
然後把這串key值copy到一個ENCKEYS file(儲存名為:ENCKEYS )中,內容如下:
kasaur_key 0xB793945154E4C74F9AF5D050E200E429
然後將該檔案copy至目標庫。
使用這個金鑰來生成加密後的口令:
[oracle@testdb ggs]$ ./ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
Linux, x64, 64bit (optimized), Oracle 10g on Oct 4 2011 23:50:20
Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
GGSCI (testdb) 1> encrypt password ogg encryptkey kasaur_key
Encrypted password: AACAAAAAAAAAAADAFFCJKAOBLIPGBHBB
登陸測試:
GGSCI (testdb) 2> dblogin userid ogg,password AACAAAAAAAAAAADAFFCJKAOBLIPGBHBB,encryptkey kasaur_key
Successfully logged into database.
GGSCI (testdb) 3>
顯示成功~~
至於第一種加密方法,弊端很多,oracle也建議不要在生產庫上使用這種加密方式,切忌!!
ok,就介紹到此。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25618347/viewspace-722144/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 資料庫會話記錄使用者登陸的密碼資訊資料庫會話密碼
- 資料庫sqlserver2008登陸名密碼登陸不了怎麼辦?資料庫SQLServer密碼
- springboot使用者登陸密碼兩次md5加密Spring Boot密碼加密
- 新使用者首次登陸修改密碼密碼
- SSH安全登陸原理:密碼登陸與公鑰登陸密碼
- ssh免密碼登陸密碼
- 普通使用者ssh無密碼登陸失敗密碼
- Linux使用者密碼後不能登陸(回到原登陸狀態)問題Linux密碼
- 配置SSH免密碼登陸密碼
- PHP萬能密碼登陸PHP密碼
- 使用者密碼包含特殊字元時的登陸方法密碼字元
- linux 關閉只允許SSH登陸(允許使用者名稱、密碼登陸)Linux密碼
- 10G新特性:使用客戶端WALLET不用使用者名稱和密碼登陸遠端資料庫客戶端密碼資料庫
- 帝國CMS忘記後臺登陸使用者名稱 密碼 認證碼 安全提問答案 資料庫使用者名稱及密碼的解決方法密碼資料庫
- node js如何實現密碼雜湊加密以及jwt登陸驗證JS密碼加密JWT
- APEX 通過資料庫中使用者資訊驗證登陸資料庫
- 用觸發器記錄資料庫使用者登陸資訊觸發器資料庫
- 限制資料庫登陸trigger資料庫
- PbootCMS後臺登陸密碼忘記/找回密碼後臺登入密碼外掛boot密碼
- 10G密碼版本使用者無法登陸問題密碼
- Jupyter Notebook修改登陸密碼密碼
- CentOS7 配置免密碼登陸CentOS密碼
- windows登陸密碼破解方法之一Windows密碼
- SSH免密登陸
- 關於資料庫登陸名和資料庫使用者名稱的一點點心得資料庫
- 按 F12獲取登陸資料,一鍵登陸巴西衛生部資料庫資料庫
- 使用plsql develop內網登陸資料庫SQLdev內網資料庫
- 【方法】Oracle使用者密碼含特殊字元時的登陸問題Oracle密碼字元
- PbootCMS後臺登陸密碼忘記/找回後臺登入密碼外掛boot密碼
- SQL資料庫使用者只有“名稱”而無“登陸名”解決SQL資料庫
- 解鎖資料庫使用者、檢視登陸幾次才鎖定使用者資料庫
- shiro多realm配置免密碼登陸密碼
- 首次登陸系統強制修改密碼密碼
- 如何免密碼直接登陸win7密碼Win7
- 取消Windows的開機登陸密碼框Windows密碼
- Mysql鬧鬼!不要密碼也能登陸薦MySql密碼
- linux 設定ssh無密碼登陸Linux密碼
- MongoDB 資料庫安全之使用者密碼修改MongoDB資料庫密碼