
作者:(美)朗(FredLong)等著
页数:261
出版社:人民邮电出版社
出版日期:2015
ISBN:9787115404015
电子书格式:pdf/epub/txt
内容简介
– “java之父”james a. gosling作序推荐
- java领域 专家撰写的指南
- 所有java开发人员必读之作
全世界有很多组织依靠java代码来执行关键任务,因此这些任务的代码必须可靠、健壮、运行快、可维护,并且安全。本书汇聚了专家们提出的编码指南、建议以及代码示例来帮助大家满足这些需求。
本书由《the cert? oracle? secure coding standard for java?》一书的几位作者合著,书中的编码指南对专家安全建议进行了扩展,阐述了更多有价值的新内容。
本书为读者提供了75条编码指南,每一条指南的描述结构都是一致的、直观的。每一条指南都有遵从性的要求,大多数指南还提供了违规代码示例和合规解决方案。作者还指明了每条指南的适用场景,并提供了了解更多详细信息的参考资源。
本书体现了java安全领域的研究成果,提供了很多新的防护技巧,既能防护故意的攻击,也能防护一些意外导致的事件。本书还提供了构建可靠软件的实践,甚至还用一整章描述了一些常见的会导致代码不完美的误解。
作者简介
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项目的主要开发者。
相关资料
“本书强调了这样一个事实:所谓的安全性其实不是一个特性,而是一种针对所有的潜在的不安全因素都予以充分考虑的态度。安全性应该被持续贯穿在每一位软件工程师的设计思考过程中。它的基础是一系列的编码指南。本书精彩的地方就是这些编码指南背后的微妙之处。”
——james a. gosling,“java之父”
“所有java开发人员的必读之作……每一位开发者都有责任让自己写的代码没有明显的安全漏洞。本书提供了一些非常实际的指导来帮助java开发人员以安全、可靠、可维护性为目标来实现想要的功能。”
——mary ann davidson,oracle公司首席安全官
本书特色
全世界的各种组织都依赖java代码执行关键任务,因此代码必须是可靠的、健壮的、快速的、可维护的、安全的。本书的主题就是如何编写安全可靠的java代码。书中提供了更新的技术来防止蓄意攻击和其他意想不到的事件。书中给出了编写安全、可靠的java代码的75条建议,每一条都非常一致和直观。对于每条编码指南都指定了一致性要求,对大多数编码指南还提供了违反这些原则的代码示例和合规的解决方案。读者不但可以在本书中找到改进代码可靠性和清晰性的实践,还能全面了解导致不佳代码的常见误解。
目录
chapter 1 security / 安全 11. 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 / 防御式编程 7922. 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 final32. 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 / 可靠性 13137. 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
下载地址
立即下载(解压密码:www.teccses.org)
Article Title:《Java编码指南-编写安全可靠程序的75条建议-(英文版)》
Article link:
https://www.teccses.org/571372.html