クラス SqlInjectionCheck
java.lang.Object
jp.ne.mki.wedge.rule.base.AbstractBase
jp.ne.mki.wedge.rule.base.AbstractServer
jp.ne.mki.wedge.rule.server.sql.SqlInjectionCheck
- すべての実装されたインタフェース:
CommonInterface
,ServerInterface
,jp.ne.mki.wedge.run.interfaces.RuleEngineInterface
,jp.ne.mki.wedge.run.interfaces.ServerRuleInterface
入力レコードに指定されたデータに不正な SQL 文字がセットされていないかチェックします。
SQL 文字列をロジッククラスで組み立てる処理については、組み立てる元となる文字列を格納したデータを このロジッククラスを使ってチェックしてください。
デフォルトの動作は like モードとなり、Oracle, DB2, HSQLDB の
like 文の値をチェックするために使用されます。
(Like 式の場合は、columnName like 'value' escape ¥ と、
escape文字を指定する必要がある場合もありますのでご注意下さい。)
その他には下記のような モードが存在します。
SQL 文字列をロジッククラスで組み立てる処理については、組み立てる元となる文字列を格納したデータを このロジッククラスを使ってチェックしてください。
- エスケープ処理
' ⇒ ''
¥ ⇒ ¥¥
% ⇒ ¥%
_ ⇒ ¥_
(この動作はモードを変更することで変更することができます。) - エラー処理
; が含まれている場合 USER_ERROR を返します。
"-semicolon ok" をつけた場合は、この場合も正常なデータと認識する。
デフォルトの動作は like モードとなり、Oracle, DB2, HSQLDB の
like 文の値をチェックするために使用されます。
(Like 式の場合は、columnName like 'value' escape ¥ と、
escape文字を指定する必要がある場合もありますのでご注意下さい。)
その他には下記のような モードが存在します。
- equal モード
Oracle, DB2, HSQLDBの = や >、入力が無効です: '<'、>=、入力が無効です: '<'= 等の値を
チェックするために使用されます。
' ⇒ ''
- likep モード
PostgreSQLの Like式の値を
チェックするために使用されます。
' ⇒ ''
¥ ⇒ ¥¥¥¥
% ⇒ ¥¥%
_ ⇒ ¥¥_
- equalp モード
PostgreSQLの = や >、入力が無効です: '<'、>=、入力が無効です: '<'= 等の値を
チェックするために使用されます。
' ⇒ ''
¥ ⇒ ¥¥
- チェック対象データ
複数指定可能
TEXT, COLTEXt 指定可能
データベースのバージョン、種類によっては この用件で SqlInjectionCheckが
正しく行えない場合もあります。その場合はこちらのルールを元に
独自の SqlInjectionCheckを作成してください。
[I/O RECORD]
InputRecord | OutputRecord |
---|---|
|
出力レコードが指定されている場合は、チェックを行った結果、エスケープされた文字列を
セットします。 出力レコードが指定されていない場合は、入力レコードにエスケープされた文字列をセットします。 |
[RULE PARAMETER]
Parameter |
実行モードの設定 -mode like … Oracle、DB2、HSQLDBの LIKE 比較演算子の値として使用される項目の チェックを行います。(デフォルト) -mode equal … Oracle、DB2、HSQLDBの =、<、> 演算子の値として使用される項目の チェックを行います。 -mode likep … PostgreSQL式の LIKE 演算子の値として使用される項目の チェックを行います。 -mode equalp … PostgreSQL式の =、<、> 演算子の値として使用される項目の チェックを行います。 -escape [n] … エスケープ文字列を設定します。(デフォルトは¥) -semicolon OK … セミコロンが含まれた文字列があった場合も、それをデータとみなす。 -semicolon USER_ERROR … セミコロンが含まれた文字列があった場合、ユーザエラーを返す。(デフォルト) -alreadyconvertcheck true … 設定されたデータはコンバートされている可能性があるデータとして、コンバート済みの文字かどうかをチェックします。 このモードの場合 適切に変換が行えない場合があります。(デフォルト) -alreadyconvertcheck false … 設定されたデータはまだコンバートしていないデータとして、全ての文字を変換します。 |
---|
-
フィールドの概要
フィールドクラスから継承されたフィールド jp.ne.mki.wedge.rule.base.AbstractServer
serverControlData
クラスから継承されたフィールド jp.ne.mki.wedge.rule.base.AbstractBase
controlRecord, engineManager, errorMessage, executeType, id, inputRecord, logicalName, logicClassDelegate, outputRecord, physicalName, ruleParameter, ruleType, serverParameter, userConstant
インタフェースから継承されたフィールド jp.ne.mki.wedge.rule.base.interfaces.CommonInterface
CANCEL, ERROR, EXECUTE_BOTH, EXECUTE_CLIENT, EXECUTE_DEBUG, EXECUTE_HTMLGATEWAY, EXECUTE_SERVER, EXECUTE_SERVERDC, IO_ERROR, IO_ERROR_EXECUTE_PARAMETER, IO_ERROR_IN, IO_ERROR_IO_MUST_SAME_COUNT, IO_ERROR_ITEM_TYPE, IO_ERROR_OUT, IO_ERROR_PARAMETER, NONE, OK, PARAMETER_DELIMITER, SKIP, USER_ERROR
インタフェースから継承されたフィールド jp.ne.mki.wedge.run.interfaces.ServerRuleInterface
DTBREAK, DTTYPEBREAK, EXECUTESKIP, EXIT
-
コンストラクタの概要
コンストラクタ -
メソッドの概要
修飾子とタイプメソッド説明int
execute()
入力データを順に処理していきます。void
exit()
終了時に特に行う処理はありません。int
入力レコード、出力レコード、ロジッククラスパラメータが正しく指定されているか、チェックします。protected int
loopInRecordSub
(jp.ne.mki.wedge.run.interfaces.DataInterface inItem, int index) loopInRecord()から呼び出されるメソッドです。クラスから継承されたメソッド jp.ne.mki.wedge.rule.base.AbstractServer
errorFixed, executeCallStran, executeDecisionTable, executeDecisionTable, executeRule, executeServerDc, executeServerDcChangeConnection, executeServerDcChangeSql, executeServerDcChangeSqlConnection, executeServerRule, getBatchStatus, getExecuteParameter, getJobParameter, getLogicClassType, getServerControlData, getSkipNumber, getStepParameter, getStepParameter, getTransactionArea, setBatchStatus, setEngineManager, setExecuteParameter, setServerStatus, setSkipNumber, setSkipNumber, setThisRuleType, showErrorDialog, terminate, writeErrorLog, writeErrorLog, writeTraceLog, writeTraceLog
クラスから継承されたメソッド jp.ne.mki.wedge.rule.base.AbstractBase
callDispose, checkDelegate, createErrorMessage, createLogicErrorLogRecord, createLogicExceptionLogRecord, createLogicLogRecord, dataClearOfOutRecord, dataClearOfRecord, dispose, getAppAccount, getAppAuthority, getAppMenu, getAppPassword, getClassErrorName, getClientId, getConnectionId, getConnectionPoolId, getConstantKeys, getConstantValue, getConstantValueAsStringArray, getControlRecord, getDbAccessCount, getDbErrorCode, getDbErrorMessage, getDbStatus, getDbUpdatedRecordCount, getEngineManager, getErrorMessage, getErrorMessage, getErrorMessage, getExceptionMessage, getExecuteType, getId, getInputRecordIterator, getInRecord, getInRecord, getInRecord, getInRecordCount, getInRecordList, getIpAddress_G_Index, getIpAddress_P_Index, getLogicalErrorName, getLogicalName, getLogicClassDelegate, getOutputHtml, getOutputRecordIterator, getOutRecord, getOutRecord, getOutRecord, getOutRecordCount, getOutRecordList, getPhysicalErrorName, getPhysicalName, getProjectId, getQueryEndLine, getQueryMaxCount, getQueryPageCount, getQueryStartLine, getReturnString, getRowSize, getRowSizeOfInRecord, getRuleParameter, getRuleParameters, getRuleParameters, getRuleParameters, getRuleType, getRuleTypeName, getServerMessage, getServerParameter, getServerStatus, getServerSubName, getServerSubRevision, getServerTran, getUpdateErrorLine, getUpdateTargetCount, getWebServerIpAddress, isExecutable, isJDK15, log, logDebug, logError, logError, logFatal, logFatal, logInfo, logTrace, logWarn, logWarn, loopInOutRecord, loopInOutRecordSub, loopInRecord, loopOutRecord, loopOutRecordSub, setControlRecord, setErrorMessage, setErrorMessageMustInRecord, setErrorMessageMustOutRecord, setErrorMessageMustParamIsNumber, setExecuteType, setFatalError, setId, setInRecord, setLogicalName, setLogicClassDelegate, setOutputHtml, setOutRecord, setPhysicalName, setPropertyFromEngine, setRuleParameter, setRuleType, setServerParameter, setUserConstant, showErrorDialog, showErrorDialogAddRuleName, writeErrorLog, writeErrorLog, writeLog, writeLog, writeLog, writeTraceLog
クラスから継承されたメソッド java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
インタフェースから継承されたメソッド jp.ne.mki.wedge.rule.base.interfaces.CommonInterface
dispose, getAppAccount, getAppAuthority, getAppMenu, getAppPassword, getClassErrorName, getClientId, getConnectionId, getConnectionPoolId, getDbAccessCount, getDbErrorCode, getDbErrorMessage, getDbStatus, getEngineManager, getExceptionMessage, getExecuteType, getId, getInRecord, getInRecord, getInRecord, getInRecordCount, getIpAddress_G_Index, getIpAddress_P_Index, getLogicalErrorName, getLogicalName, getOutRecord, getOutRecord, getOutRecord, getOutRecordCount, getPhysicalErrorName, getPhysicalName, getProjectId, getQueryEndLine, getQueryMaxCount, getQueryPageCount, getQueryStartLine, getReturnString, getRuleParameter, getRuleParameters, getRuleType, getRuleTypeName, getServerMessage, getServerParameter, getServerStatus, getServerSubName, getServerSubRevision, getServerTran, getUpdateErrorLine, getUpdateTargetCount, getWebServerIpAddress, isExecutable, logDebug, logError, logError, logFatal, logFatal, logInfo, logTrace, logWarn, logWarn, setExecuteType, setRuleType, setServerParameter, showErrorDialog, showErrorDialogAddRuleName, writeErrorLog, writeLog, writeLog, writeTraceLog
インタフェースから継承されたメソッド jp.ne.mki.wedge.run.interfaces.RuleEngineInterface
createLogicErrorLogRecord, createLogicExceptionLogRecord, createLogicLogRecord, getLogicClassDelegate, setControlRecord, setId, setInRecord, setLogicalName, setLogicClassDelegate, setOutRecord, setPhysicalName, setPropertyFromEngine, setRuleParameter, setUserConstant
-
フィールド詳細
-
reader
ParamReader reader
-
-
コンストラクタの詳細
-
SqlInjectionCheck
public SqlInjectionCheck()
-
-
メソッドの詳細
-
getIOParameter
入力レコード、出力レコード、ロジッククラスパラメータが正しく指定されているか、チェックします。- 戻り値:
- int OK=処理続行、IO_ERROR=入出力レコードエラー、IO_ERROR_IN=入力レコードエラー、IO_ERROR_OUT=出力レコードエラー、 IO_ERROR_IO_MUST_SAME_COUNT=入力レコード数と出力レコー数の非合致エラー、IO_ERROR_PARAMETER=パラメータエラー、 IO_ERROR_EXECUTE_PARAMETER=実行リストパラメータエラー
- 例外:
Throwable
- 関連項目:
-
execute
入力データを順に処理していきます。- 戻り値:
- int OK=処理続行、ERROR=異常終了、CANCEL=処理を中断(正常終了)、SKIP=次行を実行しない、USER_ERROR=戻り値をユーザ側で任意に設定
- 例外:
Throwable
- 関連項目:
-
exit
終了時に特に行う処理はありません。- 例外:
Throwable
- 関連項目:
-
loopInRecordSub
protected int loopInRecordSub(jp.ne.mki.wedge.run.interfaces.DataInterface inItem, int index) クラスからコピーされた説明:AbstractBase
loopInRecord()から呼び出されるメソッドです。ユーザが任意に記述をします。- オーバーライド:
loopInRecordSub
クラス内AbstractBase
- パラメータ:
index
-- 戻り値:
- int 結果
-