NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

基本思想


"5.6. ロギング — TERASOLUNA Global Framework Development Guideline 1.0.2-SNAPSHOT documentation" https://terasolunaorg.github.io/guideline/1.0.x/ja/ArchitectureInDetail/Logging.html

LTSV(Labeled Tab Separated Value)



独自アノテーション制御
"アノテーションを利用する | Javaコード入門" https://java-code.jp/158

"Java で自前のアノテーションを処理する - Qiita" https://qiita.com/niwasawa/items/74351ab91f3710602e20



@Autowired 是非
"Spring FrameworkでDIする3つの方法" https://reasonable-code.com/spring-injection-method/

◎コンストラクタインジェクション+@RequiredArgsConstructorで省略
→省略とFUNK_ID,API_ID設定は両立できる?
→FUNK_ID,API_IDをsuperやめて実装クラス定義にするか?

◯フィールドインジェクション


"基礎から始めるJavaのコンストラクタ 構文から上手な使い方まで" https://www.bold.ne.jp/engineer-club/java-constructor

・オーバーロード:クラス内でメソッドを多重に定義すること


秘匿項目マスキング実現案

★案4 :ブラックリスト案【改】
・DBフィールド名に、重複しない前置詞or後置詞を付与するルールとする。(xxx_name__pii など)
・Beanフィールド名、変数名、リクエスト内包のJSON文字列のkey名等も同様の命名ルールとする。

補足:PII = Personally Identifiable Information(個人を特定できる情報)

≒この定義がブラックリストに相当する(多重管理不要)

→アプリ基盤ではそれを判断材料とし、マスキング込みの横断的ロギングを行う。

※変数名などは、Reflectionにて一つ一つ判断する為、ロギングの処理性能増となる懸念は多少あると思われる(要件充足度や多案とのトレードオフ)

※PKかつPIIな項目はどうする?(特例としてマスキング対象外としたい)
→PIIマスキングしたいクラスorメソッドorフィールドには、独自アノテーション @AopLoggingFieldWithPIIMasking を付与、したくないフィールドには @AopLoggingField 等を付与し、区別する事で実現可能?
→もしくは、単純に、PK項目名にはマーキングしないで普通の項目として扱う?
→具体的な項目事例を見て決めたい

メリット:
※案②のブラックリストの定義メンテ漏れリスクを低減できる(DB変更時と実装変更時に必ず対応するはず)

※DBフィールド名に定義を持つことで、Domaの自動生成Entity(手を入れづらいと想定)に置いても同様のマーキングができ、同様に扱えると想定する(Doma本格検討時に要検証)

※案⑥のような、各業務実装者にマスキング実装を委ねる方式より、統一的・機械的に実現でき、安全・確実。かつ、業務実装者側の労力も低。

※ブラックリスト方式の為、将来STEPで対向アプリを対応する際にも、同じ方式が流用できる

※副次的効果:DB/IF/ロジック/ログ等を見る際に、どれがPII項目であるのか直感的に判断でき、様々なシーンでの事故・漏洩の予防に繋がる。


デメリット:
※業務設計者/実装者がこの命名ルールを漏らしてフィールド名・変数名・key名を付けてしまうリスクは中程度残る(各種レビューや試験で救うしかない→当PJとしてのチェックリスト筆頭項目とするなどし、関係者全員の共通認識とするべき?)
※命名によっては、JavaのCheck Style等で変数名等が警告となる可能性があるが、安易に警告対応でリネームすると事故ってしまう。


案5:妥協案
・横断的ロギングでは、PII項目を判断しての値のマスキング出力は諦め、全フィールドに対して、値をマスキング出力する

案6:妥協案
・横断的ロギングでは、フィールド名までの出力とし、値のログ出力自体諦める

案7:妥協案
・横断的ロギングでは、リクエスト/レスポンスボディや、メソッド引数/返却値のログ出力までは手を出さない。各業務ロジック側で必要に応じて個別実装する(マスキングも含め)



余談:
"AWS Glue DataBrewで個人情報(PII)の検出とデータマスキング変換が出来るようになったようなので試してみた | DevelopersIO" https://dev.classmethod.jp/articles/aws-glue-databrew-pii-profile/



件数ロギング用独自アノテーション:
@AopLoggingXXXByRows
→クラス?メソッド?フィールド?
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.