Java編碼指南編寫安全可靠程式的75條建議(英文版)

Java編碼指南編寫安全可靠程式的75條建議(英文版)

《Java編碼指南 編寫安全可靠程式的75條建議(英文版)》是2015年10月人民郵電出版社出版的圖書,作者是[美] 弗雷德·朗 ( FredLong ) ,德魯·莫欣達( Dhruv Mohindra ) ,羅伯特 C.西科德 (Robert C. Seacord ) ,迪恩 F.薩瑟蘭 (DeanF. Suther)。

基本介紹

  • 中文名:Java編碼指南編寫安全可靠程式的75條建議(英文版)
  • 作者:是[美] 弗雷德·朗 等
  • 出版時間:2015年10月
  • 出版社人民郵電出版社
  • 頁數:261 頁
  • ISBN:9787115404015
  • 定價:59 元
  • 開本:16 開
內容簡介,目錄,作者簡介,

內容簡介

全世界的各種組織都依賴Java代碼執行關鍵任務,因此代碼必須是可靠的、健壯的、快速的、可維護的、安全的。本書的主題就是如何編寫安全可靠的Java代碼。書中提供了更新的技術來防止蓄意攻擊和其他意想不到的事件。書中給出了編寫安全、可靠的Java代碼的75條建議,每一條都非常一致和直觀。對於每條編碼指南都指定了一致性要求,對大多數編碼指南還提供了違反這些原則的代碼示例和合規的解決方案。讀者不但可以在本書中找到改進代碼可靠性和清晰性的實踐,還能全面了解導致不佳代碼的常見誤解。

目錄

Chapter 1 Security / 安全 1
1. Limit the lifetime of sensitive data 2
限制敏感數據的生命周期
2. Do not store unencrypted sensitive information on the client side 5
不要在客戶端存儲未經加密的敏感數據
3. Provide sensitive mutable classes with unmodifiable wrappers 9
為敏感可變類提供不可修改的包裝器
4. Ensure that security-sensitive methods are called with validated arguments 11
確保全全敏感方法被調用時參數經過驗證
5. Prevent arbitrary file upload 13
防止任意檔案上傳
6. Properly encode or escape output 16
正確地編碼或轉義輸出
7. Prevent code injection 20
防止代碼注入
8. Prevent XPath injection 23
防止XPath注入
9. Prevent LDAP injection 27
防止LDAP注入
10. Do not use the clone() method to copy untrusted method parameters 31
不要使用clone()方法來複製不可信的方法參數
11. Do not use Object.equals() to compare cryptographic keys 34
不要使用Object.equals()來比較密鑰
12. Do not use insecure or weak cryptographic algorithms 36
不要使用不安全的弱加密算法
13. Store passwords using a hash function 37
使用散列函式存儲密碼
14. Ensure that SecureRandom is properly seeded 42
確保SecureRandom正確地選擇隨機數種子
15. Do not rely on methods that can be overridden by untrusted code 44
不要依賴可以被不可信代碼覆寫的方法
16. Avoid granting excess privileges 50
避免授予過多特權
17. Minimize privileged code 54
最小化特權代碼
18. Do not expose methods that use reduced-security checks to untrusted code 56
不要將使用降低安全性檢查的方法暴露給不可信代碼
19. Define custom security permissions for fine-grained security 64
對細粒度的安全定義自定義安全許可權
20. Create a secure sandbox using a security manager 67
使用安全管理器創建一個安全的沙盒
21. Do not let untrusted code misuse privileges of callback methods 72
不要讓不可信代碼誤用回調方法的特權
Chapter 2 Defensive Programming / 防禦式編程 79
22. Minimize the scope of variables 80
最小化變數的作用域
23. Minimize the scope of the @SuppressWarnings annotation 82
最小化@SuppressWarnings註解的作用域
24. Minimize the accessibility of classes and their members 84
最小化類及其成員的可訪問性
25. Document thread-safety and use annotations where applicable 89
文檔化代碼的執行緒安全性
26. Always provide feedback about the resulting value of a method 96
為方法的結果值提供反饋
27. Identify files using multiple file attributes 99
使用多個檔案屬性識別檔案
28. Do not attach significance to the ordinal associated with an enum 106
不要賦予枚舉常量的序號任何特殊意義
29. Be aware of numeric promotion behavior 108
注意數字提升行為
30. Enable compile-time type checking of variable arity parameter types 112
對可變參數的類型做編譯時類型檢查
31. Do not apply public final to constants whose value might change in later releases 115
不要把其值在以後版本里可能會發生變化的常量設定為public final
32. Avoid cyclic dependencies between packages 118
避免包之間的循環依賴
33. Prefer user-defined exceptions over more general exception types 121
使用用戶自定義的異常而非寬泛的異常類型
34. Try to gracefully recover from system errors 123
儘量從系統錯誤中優雅恢復
35. Carefully design interfaces before releasing them 125
布接口前請謹慎設計
36. Write garbage collection–friendly code 128
編寫對垃圾回收機制友好的代碼
Chapter 3 Reliability / 可靠性 131
37. Do not shadow or obscure identifiers in subscopes 132
不要在子作用域裡遮蔽或者掩蓋標識符
38. Do not declare more than one variable per declaration 134
不要在一個聲明里聲明多個變數
39. Use meaningful symbolic constantsto represent literal values in program logic 138
在程式邏輯中用有意義的符號常量代表文字值
40. Properly encode relationships in constant definitions 142
在常量定義中恰當地表示相互之間的關係
41. Return an empty array or collection instead of a null value for methods that return an array or collection 143
對於返回數組或者集合的方法,用返回一個空數組或者集合來替代返回一個空值
42. Use exceptions only for exceptional conditions 146
只在異常的情況下使用異常
43. Use a try-with-resources statement to safely handle closeable resources 148
使用try-with-resources語句安全處理可關閉的資源
44. Do not use assertions to verify the absence of runtime errors 151
不要使用斷言來驗證不存在的運行時錯誤
45. Use the same type for the second and third operands in conditional expressions 153
在條件表達式中,第二和第三個運算元應使用相同類型
46. Do not serialize direct handles to system resources 157
不要序列化直接指向系統資源的句柄
47. Prefer using iterators over enumerations 159
更傾向於使用疊代器而不是枚舉
48. Do not use direct buffers for short-lived, infrequently used objects 162
對於短生存周期、不常用的對象不要使用直接緩衝區
49. Remove short-lived objects from long-lived containe

作者簡介

Fred Long 英國Aberystwyth大學計算機科學系的高 級講師,自1992起一直擔任軟體工程研究所(Software Engineering Institute)的客座科學家。
Dhruv Mohindra 印度Persistent Systems有限公司安全實踐小組的技術領導,為金融、電信、健康領域的很多公司提供諮詢服務。
Robert C. Seacord 出版過多本軟體安全與軟體工程方面的書籍,是CERT安全編碼倡議小組的技術經理,另外他還在卡內基-梅隆大學教計算機科學。
Dean F. Sutherland CERT高 級軟體安全工程師,之前是Tartan公司技術組的高 級成員,他在Tartan公司主要負責開發最佳化編譯器。
David Svoboda CERT軟體安全工程師,是多個CMU項目的主要開發者。

相關詞條

熱門詞條

聯絡我們