資訊安全
- Sanitize Your Inputs?
- The Basics of Web Application Security
- 分布式系統下的認證與授權
- 驗證與授權的差別,淺談 OAuth 2.0 與 OpenID Connect
- Understanding access tokens, refresh tokens, and ID tokens in OpenID Connect (OIDC) protocol · Logto blog
- Differences between Kerberos, SAML, OAuth, and OpenID Connect (OIDC)
- https://chatgpt.com/share/681475a5-dd74-8009-85cb-3a49637a25f2
- Day03 - 【入門篇】淺談身份驗證與授權
- 研究微服務下的授權設計 - Google Zanzibar 與 Open Policy Agent
- How does using an auth server for mobile app and not storing API keys on client add security
- Using Machine to Machine (M2M) Authorization
- Client Credentials Flow
- The OAuth 2.0 Authorization Framework
- RFC 6819: OAuth 2.0 Threat Model and Security Considerations - Threat: Obtaining Client Secrets
- What is the worst that can happen if your OAuth client secret is leaked
- The Client ID and Secret - OAuth 2.0 Simplified
- The
client credentials grant
from OAuth 2.0 attempts to fulfill the need for these scenarios. - In the client credentials grant, the client holds two pieces of information: the client ID and the client secret.
- 後端工程師面試考什麼 — OAuth 2.0 - MyApollo
- 後端工程師面試考什麼 — 從 SSO (Single Sign-On) 到 SAML 2.0 - MyApollo
- Client Credentials Flow
- Refresh Token Rotation
- PKI
- 認識 PKI 架構下的數位憑證格式與憑證格式轉換的心得分享 | The Will Will Web
- What Are the Differences Between RSA, DSA, and ECC Encryption Algorithms?
- The key size or bit length of public keys determines the strength of protection
- RSA encryption maximum data size
- RSA is only able to encrypt data to a maximum amount equal to your key size (2048 bits = 256 bytes), minus any padding and header data (11 bytes for PKCS#1 v1.5 padding).
- Difference Between RSA-OAEP and RSA-PKCS1.5
- What is RSA OAEP & RSA PSS in simple terms
- Why can't I use RSA OAEP padding when encrypting with a private key?
- Can we have multiple public keys with a single private key for RSA
- What is the difference between a certificate and a private key? - Information Security Stack Exchange
- Openssl Demo: Encrypting/Decrypting files using both Symmetric and Asymmetric Encryption
- cryptography - What is the actual value of a certificate fingerprint? - Information Security Stack Exchange
- Online Certificate Status Protocol - Wikipedia
- :star:有关 TLS/SSL 证书的一切 | 卡瓦邦噶!
- :star:從實務經驗重新認識 TLS | omegaatt
- GPG
- Master password/key
- IOT Security
- IoT device authentication options | Azure 部落格與更新 | Microsoft Azure
- 信賴平台模組技術概觀 (Windows) - Windows security | Microsoft Learn
- X.509 client certificates - AWS IoT Core
- Device provisioning - AWS IoT Core
- draft-hsothers-iotsens-ps-02 - The Need for New Authentication Methods for Internet of Things
- Authentication and Authorization for IoT Devices in Disadvantaged Environments | IEEE Conference Publication | IEEE Xplore
- Modern Authentication for Network Devices | by Leo Lee | Airwalk Reply | Medium
- How to Authenticate a Device? Formal Authentication Models for M2M Communications Defending against Ghost Compromising Attack - Wei Ren, Linchen Yu, Liangli Ma, Yi Ren, 2013
- IoT device authentication options | Azure 部落格與更新 | Microsoft Azure
- 看完眼眶濕濕的App開發者慘烈對抗險惡資安環境血與淚的控訴
- Password cracking speed - the Security Factory
- 如何使用 One Time Password 加強 Ubuntu 伺服器 SSH 安全性 | CodingMan
- Orange: 從 2013 到 2023: Web Security 十年之進化與趨勢!
- 20220811 - Web Conf 2023 - 使用 Passkeys 打造無密碼驗證服務
- 閒聊 - Y2Q 倒數與 Q-Day,當代資訊安全防線即將崩潰-黑暗執行緒
- 密碼都放 Vault 裡了,然後呢?!. 當然要來談談怎麼管理 Vault ^^ | by smalltown | Starbugs Weekly 星巴哥技術專欄 | Medium
- PQC 筆記 1 - 靠近一點看量子電腦對當代密碼學的威脅-黑暗執行緒
- PQC 筆記 2 - 簡單認識後量子時代密碼學演算法-黑暗執行緒
- 有趣的小遊戲 - Gandalf Adventures 之 prompt injection 攻略 | 是 Ray 不是 Array
- 筆記 - 可微調 Personal Access Token 讓 Github 存取更安全-黑暗執行緒
- 在企業裡面管理密碼的選擇 – Gea-Suan Lin's BLOG
- SPIFFE/SPIRE 从入门到入门 | 伪架构师
- [SSL] 一次弄懂 Let’s Encrypt 以及建議使用的工具 – DNSroboCert – 一介資男
- RBAC
弱點掃描
XSS
https://stackoverflow.com/questions/64152836/checkmarx-how-to-validate-and-sanitize-httpservletrequest-getinputstream-to-p https://stackoverflow.com/questions/1265282/what-is-the-recommended-way-to-escape-html-symbols-in-plain-java https://stackoverflow.com/questions/11478813/request-getparameter-protect-against-xss-what-is-the-best-practice
Code injection
https://stackoverflow.com/questions/15197673/using-pythons-eval-vs-ast-literal-eval
Insecure Randomness
如果這組偽隨機值被用做任何安全性使用,如密碼、金鑰、Session或是隱密辨識值,攻擊者就可以 預測下一個或已經產生的數值
Uncontrolled Format String
https://www.netsparker.com/blog/web-security/format-string-vulnerabilities/ Format strings are used in many programming languages to insert values into a text string. In some cases, this mechanism can be abused to perform - buffer overflow attacks - extract information - execute arbitrary code.
Command_Injection
python
https://docs.python.org/3.6/library/subprocess.html#subprocess.Popen
args is required for all calls and should be a string, or a sequence of program arguments.
Providing a sequence of arguments is generally preferred, as it allows the module to take care of any required escaping and quoting of arguments (e.g. to permit spaces in file names).
If passing a single string, either shell must be True (see below) or else the string must simply name the program to be executed without specifying any arguments.
``` python=
subprocess.call(["ping -c 1 8.8.8.8; rm test_file"], shell=True)
the test_file will be removed
subprocess.call(["ping", "-c", "1", "8.8.8.8", "rm", "test_file"], shell=True)
ping: usage error: Destination address required
subprocess.call(["ping", "-c", "1", "8.8.8.8", "rm", "test_file"])
ping: test_file: Temporary failure in name resolution
```
Popen Constructor , the default shell=False
If env is not None, it must be a mapping that defines the environment variables for the new process; these are used instead of the default behavior of inheriting the current process’ environment. Python - subprocess and the env argument
java
On Command Injection over Java’s ProcessBuilder
事件
log4j vulnerability
Certificate
Authorization & Authentication
Keycloak
- [Keycloak] 環境準備 & 基本設定 | CK's Notepad
- 如何用 Docker 快速上手 Keycloak 開發模式 | The Will Will Web
- 【用Keycloak學習身份驗證與授權】系列目錄 | 又LAG隨性筆記
- container
- 如何用 Docker 快速上手 Keycloak 開發模式 | The Will Will Web
- GitHub - slominskir/keycloak_ldap: Docker Compose with Keycloak and 389 LDAP Directory Server
- https
- Keycloak使用群晖Synology Directory Server作为AD/LDAP用户数据源
- 設定Keycloak v19串接Windows AD / LDAP - Jovepater
- user and group
- Keycloak, Mariadb, and OpenLDAP
Oso
Malware analysis
工具
Fail2ban
Infisical
- Infisical - Open Source SecretOps - MyApollo
- 開源的機密管理平台,專門用以儲存資料庫帳密、 API key, Token 等機敏性的資料,可以讓機密的管理更加方便
防毒技術
【科普】2017各款防毒軟體技術原理剖析 2017 預防尚未進入防毒資料庫的未知威脅 - 啟發法: 通過一系列的規則試圖推理出可能的目標,實際上,通過一系列手段還原出可執行檔案的實際行為,並將其與記錄病毒行為的啟發特徵庫相比對 - 靜態啟發: 在可疑文件讀入到記憶體執行前,先行一步反編譯,根據得到的代碼分析出程式可執行的命令種類和順序,再與啟發特徵庫中的行為比較,近似者報毒 - 動態啟發: 建立一個隔離的虛擬環境預先執行要掃描的程式幾十毫秒。通過監控程式最初的幾條或幾十條指令來判斷程式是否可疑(正常程式一般會先調用圖形 API 繪製界面等,但病毒通常直接開始讀寫硬碟,注入其他程序) - 行為攔截(Behavior Blocker) - HIPS: 主機入侵防禦的英文縮寫,分為 AD 應用程式防護、RD 註冊表防護、FD 文件防護三塊。在程式執行時攔截所有行為並詢問用戶是否放行 - 主動防禦: 有啟發能力的 HIPS,與啟發式的不同在於,擁有主動防禦的防毒可以在程式正常執行(不隔離)的情況下不間斷地監視程式的行為,發現與啟發特徵庫匹配的動作便終止該程序 - 雲分析 - 人工智慧(AI): 分析雲端的大量資料,機器學習後再下放到本地 - 廣譜/基因: 通過衡量某個未知的文件和已知惡意文件的相似度來進行判別。如果一個未知文件在關鍵的地方和已知惡意威脅高度相似則判為有害 - 沙盒(SandBox)
主防和 HIPS 都屬於執行後保護,在其運作時,可疑程式已經在記憶體中執行,可以說是防毒軟體的最後一道關卡
- Comodo
- 以防護為重,查殺為輔
- 防護思路
- 第一步一樣由 AntiVirus 做判斷,並連接到雲信譽庫,白名單文件放行,沒檢測到病毒又不在白名單裡的文件自動入沙;Viruscope 再對沙盒裡的檔案進行行為分析,判斷為有害立即清除
- Bitdefender
- 對於病毒的檢測率相當精準,很少有誤判的情況發生
- 防護流程包含四個步驟
- 入口防護,使用流量掃描(含 Web、Email、IM)
- 到達本地的文件將 hash 核對簽名數據庫
- 如果沒有簽名匹配,會使用 B-HAVE 引擎進行啟發檢測
- 主防監控程式的行為,當分數達到閾值立刻阻止執行
- ATC 主防
- Kaspersky
- 所有的雲都會靠 MD5、Hash 來判斷檔案的安全性,這就是所謂的雲拉黑,MD5 是一個快速判斷檔案的好方法,但對於卡巴來說不是唯一方法。首次執行程式會先進入 KSN 進行雲數據庫匹配,白 Hash 直接放入信任組,黑名單報 DangerousObject;而未知應用自動分析安全的話放入限制組(需搭配 HIPS 模塊),符合雲危險模型報 DangerousPattern
- 卡巴斯基有多個防護層。第一層是 Web 防護,網頁的木馬在第一層就被擋下;若病毒不幸被下載到本地,會被特徵碼和啟發檢測到;如果檔案資料沒有被收入在本地病毒庫,還會連上 KSN 查詢;再下一層是主動防禦模塊,分析程式的行為,若有可疑活動立刻阻止
- F-Secure