Keynote presentation by Phillip Ruthven from IBISWorld Pty Ltd giving his thoughts and perspectives on what keeps CEOs awake at night. 2011 actKM Conference. Melbourne, Australia. 10 October 2011.
Presentation by Matthew Cain of the Australian Army sharing their model and methods for knowledge management made at the 2011 actKM Conference in Melbourne.
This document provides an agenda for the actKM 2012 conference taking place on October 23-24, 2012 at the University of Canberra. The conference will focus on the theme of "Connecting Knowledge - building the knowledge-centric organisation" and will include keynote speeches, presentations, and networking opportunities on topics related to knowledge management, collaboration, social media, and building connected organizations. Sponsor and committee information is also provided.
The document presents a conceptual framework for integrating data mining within a strategic knowledge management approach to create sustainable competitive advantage in the Australian mining sector. The framework combines the benefits of data mining techniques for identifying patterns and relationships in large databases with a strategic KM framework. It is proposed that incorporating different strategic perspectives into company strategies and operational plans could optimize business performance and increase knowledge capabilities to better solve complex, unstructured problems in mining. Next steps discussed include validating the framework through case studies with mining organizations in Western Australia and developing an inventory of data mining and KM processes based on the results.
Keynote presentation by Phillip Ruthven from IBISWorld Pty Ltd giving his thoughts and perspectives on what keeps CEOs awake at night. 2011 actKM Conference. Melbourne, Australia. 10 October 2011.
Presentation by Matthew Cain of the Australian Army sharing their model and methods for knowledge management made at the 2011 actKM Conference in Melbourne.
This document provides an agenda for the actKM 2012 conference taking place on October 23-24, 2012 at the University of Canberra. The conference will focus on the theme of "Connecting Knowledge - building the knowledge-centric organisation" and will include keynote speeches, presentations, and networking opportunities on topics related to knowledge management, collaboration, social media, and building connected organizations. Sponsor and committee information is also provided.
The document presents a conceptual framework for integrating data mining within a strategic knowledge management approach to create sustainable competitive advantage in the Australian mining sector. The framework combines the benefits of data mining techniques for identifying patterns and relationships in large databases with a strategic KM framework. It is proposed that incorporating different strategic perspectives into company strategies and operational plans could optimize business performance and increase knowledge capabilities to better solve complex, unstructured problems in mining. Next steps discussed include validating the framework through case studies with mining organizations in Western Australia and developing an inventory of data mining and KM processes based on the results.
This document summarizes a workshop on business-IT fusion. It introduces the presenters and their backgrounds, then discusses the traditional disconnect between business and IT. It frames alignment and fusion as ways to bridge this gap. Fusion is defined as a merging of business and IT elements into a unified whole.
The workshop agenda is then outlined. Participants are asked to consider key outcomes from the perspectives of different roles in a fusion initiative. A business-IT fusion framework is presented, consisting of constancy of purpose, a shared world view, and adapting to change. Groups then discuss desired outcomes from their assigned roles after 18 months of a fusion program.
1) The documents discuss various metrics for analyzing social networks, including degree centrality, closeness centrality, betweenness centrality, and eigenvector centrality.
2) Degree centrality measures how active individuals are based on the number of direct connections they have. Closeness centrality measures an individual's average distance to all others in the network. Betweenness centrality identifies people who connect disparate groups. Eigenvector centrality measures how well connected one is to highly connected individuals.
3) The documents provide examples of how these network analysis metrics can be applied to understand roles, influence, and dynamics within organizations.
The Knowledge Bucket: Practicing what we preachactkm
Hear about the purpose and focus of the Knowledge Bucket, an open source project to develop a body of knowledge on Knowledge Management. Presented at the 2011 actKM conference in Melbourne by Cory Banks.
The document discusses a community campaign to save a threatened local emergency department. An integrated suite of collaborative social media tools was developed using mobile and cloud technologies to share information about the campaign. These included Twitter, Hootsuite, Facebook, WordPress blog and pages, Skype, YouTube/Vimeo. The tools helped engage the community, media and politicians. The campaign made progress in documenting its efforts and exposing team members to useful social media strategies, though the outcome of saving the emergency department was still pending.
Wikis can be used in education to facilitate collaborative learning between students. Students are assessed both on their individual work and how well they link their topics to other students' work, rewarding knowledge sharing over hoarding. Key outcomes include professionals who understand relationship building, networking, and leveraging others' expertise. Wikis also allow students to actively learn together across disciplines and collectively build knowledge from multiple sources. Administration of courses using wikis is simpler, with assessment and feedback embedded in the online platform.
The document discusses knowledge management (KM) education and outlines three key conversations: 1) What KM education is currently available, 2) Whether the current approach is optimal, and 3) How the KM community can influence and improve KM education. It provides an example of one university's KM course and encourages participants in the actKM conference to consider getting involved in shaping KM education. The presentation concludes by promoting the speaker's behavioral profiling and consulting services.
Presentation by Vladimir Videnovic of Oracle sharing the story of New York's efforts for sharing performance data at the 2011 actKM Conference in Melbourne.
This document provides an overview of a workshop on decision making that seeks to introduce and compare the work of Malcolm Gladwell and Daniel Kahneman, explore how knowledge is used in rapid cognition, and generate ideas to improve organizational decision making. It outlines Gladwell and Kahneman's research on fast and slow thinking as well as Gary Klein's work on naturalistic decision making. The document also discusses biases, heuristics, and conditions that influence decision quality. Tools, models, and strategies for decision making are presented along with examples of good and bad decisions.
Web-application-security dành cho sinh viên IT gồm Web application attack and defense thông qua thống kê nền tảng website phổi biến, lỗ hổng web, phát hiện, kiểm tra lỗ hổng, tại sao dùng web application firewall? Tại sao triển khai WAF trên Reverse Proxy? Modsecurity
This document summarizes a workshop on business-IT fusion. It introduces the presenters and their backgrounds, then discusses the traditional disconnect between business and IT. It frames alignment and fusion as ways to bridge this gap. Fusion is defined as a merging of business and IT elements into a unified whole.
The workshop agenda is then outlined. Participants are asked to consider key outcomes from the perspectives of different roles in a fusion initiative. A business-IT fusion framework is presented, consisting of constancy of purpose, a shared world view, and adapting to change. Groups then discuss desired outcomes from their assigned roles after 18 months of a fusion program.
1) The documents discuss various metrics for analyzing social networks, including degree centrality, closeness centrality, betweenness centrality, and eigenvector centrality.
2) Degree centrality measures how active individuals are based on the number of direct connections they have. Closeness centrality measures an individual's average distance to all others in the network. Betweenness centrality identifies people who connect disparate groups. Eigenvector centrality measures how well connected one is to highly connected individuals.
3) The documents provide examples of how these network analysis metrics can be applied to understand roles, influence, and dynamics within organizations.
The Knowledge Bucket: Practicing what we preachactkm
Hear about the purpose and focus of the Knowledge Bucket, an open source project to develop a body of knowledge on Knowledge Management. Presented at the 2011 actKM conference in Melbourne by Cory Banks.
The document discusses a community campaign to save a threatened local emergency department. An integrated suite of collaborative social media tools was developed using mobile and cloud technologies to share information about the campaign. These included Twitter, Hootsuite, Facebook, WordPress blog and pages, Skype, YouTube/Vimeo. The tools helped engage the community, media and politicians. The campaign made progress in documenting its efforts and exposing team members to useful social media strategies, though the outcome of saving the emergency department was still pending.
Wikis can be used in education to facilitate collaborative learning between students. Students are assessed both on their individual work and how well they link their topics to other students' work, rewarding knowledge sharing over hoarding. Key outcomes include professionals who understand relationship building, networking, and leveraging others' expertise. Wikis also allow students to actively learn together across disciplines and collectively build knowledge from multiple sources. Administration of courses using wikis is simpler, with assessment and feedback embedded in the online platform.
The document discusses knowledge management (KM) education and outlines three key conversations: 1) What KM education is currently available, 2) Whether the current approach is optimal, and 3) How the KM community can influence and improve KM education. It provides an example of one university's KM course and encourages participants in the actKM conference to consider getting involved in shaping KM education. The presentation concludes by promoting the speaker's behavioral profiling and consulting services.
Presentation by Vladimir Videnovic of Oracle sharing the story of New York's efforts for sharing performance data at the 2011 actKM Conference in Melbourne.
This document provides an overview of a workshop on decision making that seeks to introduce and compare the work of Malcolm Gladwell and Daniel Kahneman, explore how knowledge is used in rapid cognition, and generate ideas to improve organizational decision making. It outlines Gladwell and Kahneman's research on fast and slow thinking as well as Gary Klein's work on naturalistic decision making. The document also discusses biases, heuristics, and conditions that influence decision quality. Tools, models, and strategies for decision making are presented along with examples of good and bad decisions.
Web-application-security dành cho sinh viên IT gồm Web application attack and defense thông qua thống kê nền tảng website phổi biến, lỗ hổng web, phát hiện, kiểm tra lỗ hổng, tại sao dùng web application firewall? Tại sao triển khai WAF trên Reverse Proxy? Modsecurity
Hành vi tình dục không an toàn và các yếu tố liên quan trong nhóm nam quan hệ...Man_Ebook
Hành vi tình dục không an toàn và các yếu tố liên quan trong nhóm nam quan hệ tình dục đồng giới tại Hà Nội năm 2009-2010
Liên hệ tài tài liệu (Free): https://www.facebook.com/man.trl/
kl_HOÀN THIỆN CÔNG TÁC ĐÁNH GIÁ THỰC HIỆN CÔNG VIỆC TẠI CÔNG TY CỔ PHẦN ĐẦU T...Luận Văn Uy Tín
Luận Văn Uy Tín cung cấp dịch vụ viết thuê luận văn thạc sĩ, tốt nghiệp, báo cáo thực tập, hoàn tiền 100% nếu bài bị đánh rớt, bảo mật thông tin, giao bài đúng hạn.
Tuyển tập 9 chuyên đề bồi dưỡng Toán lớp 5 cơ bản và nâng cao ôn thi vào lớp ...Bồi Dưỡng HSG Toán Lớp 3
Tuyển tập 9 chuyên đề bồi dưỡng Toán lớp 5 cơ bản và nâng cao ôn thi vào lớp 6 trường chuyên. Đăng ký mua tài liệu Toán 5 vui lòng liên hệ: 0948.228.325 (Zalo - Cô Trang Toán IQ).
1. 9/10/2011
1
LẬP TRÌNH WEB HƯỚNG JAVA
Bài 18: Kỹ thuật security cho ứng
dụng Web
Giảng viên: ThS. Trịnh Tuấn Đạt
Bộ môn CNPM
Email: trinhtuandat.bk@gmail.com/dattt@soict.hut.edu.vn
Bộ môn Công nghệ Phần mềm
Viện CNTT & TT
Trường Đại học Bách Khoa Hà Nội
1DatTT-DSE-SOICT-HUST
Nội dung
1. Các vấn đề chung về Security
2. Các kỹ thuật và yêu cầu về Security trên tầng
Web
3. Xác thực
3.1. Kỹ thuật xác thực “HTTP basic authentication”
3.2. Kỹ thuật xác thực “Form-based authentication”
3.3. Quản lý Realm
3.4. Bảo mật Passwords trên đường truyền cho kỹ thuật
Basic & Form-based Authentications
3.5. Hướng dẫn cài đặt Security cho tầng Web
3.6. Xác thực Client sử dụng kỹ thuật xác thực dựa trên
Certificate 2DatTT-DSE-SOICT-HUST
Nội dung
3.7. Digest Authentication
3.8. Programmatic authentication
4. Authorization
4.1. Điều khiển truy cập Declarative ở tầng Web
4.2. Điều khiển truy cập Programmatic ở tầng
Web
3DatTT-DSE-SOICT-HUST
1. Các vấn đề chung về
Security
4DatTT-DSE-SOICT-HUST
Các vấn đề chung về Security
Xác thực (Authentication)
Đảm bảo 1 user đúng là người mà anh ta tuyên bố
Phân quyền-Authorization (Điều khiển truy cập -
Access control)
Đảm bảo chỉ những người có quyền truy cập mới được
truy cập tài nguyên
Người dùng phải được xác thực trước
Bảo mật-Confidentiality (Chính sách-Privacy)
Bảo vệ dữ liệu khỏi những kẻ nghe nén/tòmò khi đang
trên đường truyền
5DatTT-DSE-SOICT-HUST
2. Các kỹ thuật và yêu cầu về
Security trên tầng Web
6DatTT-DSE-SOICT-HUST
2. 9/10/2011
2
Các yêu cầu về Security trên tầng Web
Ngăn người dùng chưa xác thực truy cập vàp các
tài nguyên được “điều khiển truy cập”
Nếu 1 người dùng chưa xác thực cố gắng truy cập vào tài
nguyên web có “điều khiển truy cập”, web container sẽ
tự động yêu cầu user xác thực (authenticate) trước
Một khi user đã xác thực, web container (và/hoặc web
components) tiến hành áp dụng điều khiển truy cập
Ngăn attackers thay đổi hoặc đọc các dữ liệu nhạy
cảm trên đường truyền
Dữ liệu có thể được bảo vệ nhờ SSL
7DatTT-DSE-SOICT-HUST
Các kỹ thuật về Security trên tầng Web
cần tập trung vào “Authentication”
Lấy về thông tin danh tính (identity
information) của người dùng cuối
Thường qua giao diện trên trình duyệt
Thông tin danh tính người dùng bao gồm
username và password
Gọi là “logging in”
Truyền thông tin danh tính lấy được cho web
server
unsecurely (HTTP) hoặc securely (HTTP trên
SSL)
8DatTT-DSE-SOICT-HUST
Các kỹ thuật về Security trên tầng Web
cần tập trung vào “Authentication” (2)
Thực hiện kiểm tra danh tính, so khớp với “security
database”
Web container kiểm tra xem danh tính người dùng có
trùng với danh tính nào trong “security database” phía
sau không
“Security database” còn được gọi là Realms
Realms lưu trữ/bảo trì
Username, password, roles, ...
Cách thức tổ chức & quản lý các realms phụ thuộc vào
sản phẩm, môi trường
LDAP, RDBMS, Flat-file, Solaris PAM, Windows AD
9DatTT-DSE-SOICT-HUST
Các kỹ thuật về Security trên tầng Web
cần tập trung vào “Authentication” (3)
Web container lưu vết lại các user đã xác
thực cho các thao tác HTTP về sau
Sử dụng trạng thái session được lưu trữ, web
container biết được rằng 1 người dùng khi gửi
các HTTP requests đã được xác thực chưa
Web container cũng tạo các đối tượng
HttpServletRequest ứng với các HTTP requests
gửi đến
Đối tượng HttpServletRequest chứa các thông tin
“security context”
Principal, Role, Username
10DatTT-DSE-SOICT-HUST
Các kỹ thuật về Security trên tầng Web
cần tập trung vào “Access control”
Access control: điều khiển truy cập
LTV và những người triển khai ứng dụng
Web (deployer) chỉ định điều khiển truy cập
cho các tài nguyên web (web resources)
Sử dụng điều khiển truy cập loại Declarative
và/hoặc loại Programmatic
11DatTT-DSE-SOICT-HUST
Các kỹ thuật về Security trên tầng Web
cần tập trung vào “Data confidentiality”
Data confidentiality: bảo mật dữ liệu
Cung cấp cơ chế bảo mật (confidentiality)
cho các dữ liệu nhạy cảm (sensitive) trên
đường truyền
Giữa trình duyệt và web server
Ví dụ: số thẻ tín dụng (Credit card number)
Sử dụng SSL
12DatTT-DSE-SOICT-HUST
3. 9/10/2011
3
Các kỹ thuật xác thực trên tầng Web
Xác thực HTTP cơ bản (HTTP basic authentication)
Sử dụng hoặc không sử dụng với SSL
Xác thực sử dụng Form (Form-based
authentication)
Sử dụng hoặc không sử dụng với SSL
Xác thực sử dụng Client-certificate (Client-certificate
authentication)
Phải sử dụng SSL
Xác thực biến đổi (Digest authentication)
Không cần sử dụng SSL
13DatTT-DSE-SOICT-HUST
3.1. Kỹ thuật xác thực “HTTP
basic authentication”
14DatTT-DSE-SOICT-HUST
HTTP Basic Authentication
Web server thu thập thông tin danh tính
người dùng (user name & password) qua 1
hộp thoại trên browser
Không an toàn vì user name và password ở
dạng “dễ dàng decodable” trên đường truyền
Kỹ thuật encoding là Base64
Một người bất kỳ dễ dàng thực hiện decode
Không được mật mã (encrypted)
Cần SSL để mật mã password
15DatTT-DSE-SOICT-HUST
Các bước cài đặt “Basic Authentication”
Thiết lập username, passwords, và roles
(realms)
Thông báo với web container kỹ thuật đang
sử dụng là Basic authentication
Chỉ định URLs nào (web resources) cần được
điều khiển truy cập (password-protected)
Chỉ định URLs nào được cung cấp chỉ với SSL
(data integrity & confidentiality protected)
16DatTT-DSE-SOICT-HUST
Bước 1: Thiết lập username, passwords,
và roles (Realms)
Các kỹ thuật (Schemes), APIs, và các công cụ thiết
lập usernames, passwords & roles (realms) tùy theo
web container và môi trường (operational
environment)
Flat-file based, Database, LDAP server
Passwords có thể ở dạng mã mật (encrypted form) hoặc
không
Tomcat 4.0 có thể làm việc với các loại realms sau
Mặc định: file, dạng không mã mật (unencrypted form)
Relational database (qua JDBCRealm)
LDAP server (qua LDAPRealm)
17DatTT-DSE-SOICT-HUST
Ví dụ: mặc định trong Tomcat
<install-dir>/config/tomcat-users.xml
Dạng không mã mật: không an toàn nhưng dễ cài
đặt và bảo trì
<?xml version='1.0'?>
<tomcat-users>
<role rolename="manager"/>
<role rolename="employee"/>
<role rolename="admin"/>
<user username="sang" password="sangPassword"
roles="manager,employee"/>
</tomcat-users>
18DatTT-DSE-SOICT-HUST
4. 9/10/2011
4
Bước 2: Chỉ dẫn web container sử dụng
kỹ thuật Basic authentication
Trong file web.xml của ứng dụng web:
<web-app>
...
<security-constraint>...</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>realm name</realm-name>
</login-config>
...
</web-app>
19DatTT-DSE-SOICT-HUST
Bước 3: Chỉ định các URLs được điều
khiển truy cập
<web-app>
...
<security-constraint>
<web-resource-collection>
<web-resource-name>WRCollection</web-resource-name>
<url-pattern>/loadpricelist</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method> <realm-name></realm-name>
</login-config>
...
</web-app>
20DatTT-DSE-SOICT-HUST
Bước 4: Chỉ định các resources
(URLs) áp dụng SSL
<web-app>
...
<security-constraint>
<web-resource-collection>
<web-resource-name>WRCollection</web-resource-name>
<url-pattern>/loadpricelist</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method> <realm-name></realm-name>
</login-config>
...
</web-app>
21DatTT-DSE-SOICT-HUST
3.2. Kỹ thuật xác thực “Form-
based authentication”
22DatTT-DSE-SOICT-HUST
Form-based Authentication
Ứng dụng Web application thu thập thông tin
danh tính người dùng (user name, password,
và các thông tin khác) qua 1 trang login
thông thường
Không an toàn vì user name và password ở
dạng “dễ dàng decodable” trên đường truyền
Kỹ thuật encoding là Base64
Một người bất kỳ dễ dàng thực hiện decode
Không được mật mã (encrypted)
Cần SSL để mật mã password 23DatTT-DSE-SOICT-HUST
Luồng điều khiển
1. Request made by client
2. Is client authenticated?
3. Unauthenticated client
redirected
4. Login form returned to client
5. Client submits login form
6. Authentication Login succeeded,
redirected to resource
7. Authorization Permission tested,
result returned
8. Login failed, redirect to error page
9. Error page returned to client
1
2
Protected
Resource
Login.jsp j_security_check Error.html
Request Response
Page
Login
Form
Error Page
3
6 8
7 4 5 9
24DatTT-DSE-SOICT-HUST
5. 9/10/2011
5
Các bước cài đặt “Form-based
Authentication”
Thiết lập các username, passwords, and roles
(realms)
Thông báo với web container kỹ thuật đang sử
dụng là Form-based authentication
Tạo trang “Login page”
Tạo trang “Login failure error page”
Chỉ định URLs nào (web resources) được điều khiển
truy cập (password-protected)
Chỉ định URLs nào được cung cấp chỉ với SSL (data
integrity & confidentiality protected)
25DatTT-DSE-SOICT-HUST
Bước 1: Thiết lập username, passwords,
và roles (Realms)
Như trong Basic-authentication
26DatTT-DSE-SOICT-HUST
Bước 2: Chỉ dẫn web container sử dụng
kỹ thuật “Form-based authentication”
Trong file web.xml của ứng dụng Web:
<web-app>
...
<security-constraint>...</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>realm name</realm-name>
</login-config>
...
</web-app>
27DatTT-DSE-SOICT-HUST
Bước 3: Tạo trang “Login Page”
Có thể là trang HTML hoặc JSP
Chứa form HTML như sau:
<FORM ACTION="j_security_check" METHOD="POST">
…
<INPUT TYPE="TEXT" NAME="j_username">
…
<INPUT TYPE="PASSWORD" NAME="j_password">
…
</FORM>
28DatTT-DSE-SOICT-HUST
Bước 4: Tạo trang login fail
Có thể là trang HTML hoặc JSP
Nội dung bất kỳ
29DatTT-DSE-SOICT-HUST
Bước 5: Chỉ định URLs nào được điều
khiển truy cập (như trong Basic Auth)
<web-app>
...
<security-constraint>
<web-resource-collection>
<web-resource-name>WRCollection</web-resource-name>
<url-pattern>/loadpricelist</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
<role-name>executive</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method> <realm-name></realm-name>
</login-config>
...
</web-app>
30DatTT-DSE-SOICT-HUST
6. 9/10/2011
6
Bước 6: Chỉ định các resources (URLs) áp
dụng SSL (như trong Basic Auth)
<web-app>
...
<security-constraint>
<web-resource-collection>
<web-resource-name>WRCollection</web-resource-name>
<url-pattern>/loadpricelist</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method> <realm-name></realm-name>
</login-config>
...
</web-app>
31DatTT-DSE-SOICT-HUST
Form-based
Basic vs. Form-based Authentication
• Uses “browser provided
dialog box” to get
username and password
• Only username and
password can be collected
• Might result in different
look and feel
• HTTP Authentication
header is used to convey
username and password
• No good way to enter a
new user name
• Uses “web application
provided login page” to get
username and password
• Custom data can be
collected
• Can enforce consistent look
and feel
• Form data is used to convey
username and password
• Can enter a new user name
via login page
Basic
32DatTT-DSE-SOICT-HUST
3.3. Quản lý Realm
33DatTT-DSE-SOICT-HUST
Quản lý Realm
Quản lý các thông tin danh tính của người
dùng
username, password, roles, ...
Dạng mã mật hoặc không
Phụ thuộc vào container và các môi trường
tính toán của nó (operational environment)
Tomcat
flat file based, RDBMS, LDAP
GlassFish App server
34DatTT-DSE-SOICT-HUST
Security Roles
Sử dụng các security roles để “điểu khiển truy cập”
(với cả loại declarative & programmatic)
Là các abstract roles, không liên quan đến usernames,
passwords, groups của hệ điều hành
Khi triển khai ứng dụng, các abstract security roles cần
được map với các usernames, passwords, groups của hệ
điều hành
Trên thực tế, CSDL security realm ngoài (vd: LDAP)
có thể được sử dụng cho cả ứng dụng Web và hệ
điều hành
35DatTT-DSE-SOICT-HUST
Ví dụ: Mặc định trong Tomcat
<install-dir>/config/tomcat-users.xml
Dạng không mã mật: không an toàn nhưng dễ cài
đặt và bảo trì
<?xml version='1.0'?>
<tomcat-users>
<role rolename="manager"/>
<role rolename="employee"/>
<role rolename="admin"/>
<user username="sang" password="sangPassword"
roles="manager,employee"/>
</tomcat-users>
36DatTT-DSE-SOICT-HUST
7. 9/10/2011
7
Mặc định trong Tomcat
Flat file based realm được lưu trong
<install-dir>/config/tomcat-users.xml
Có thể thay đổi theo 2 cách
Bằng tay - mannually
Sử dụng công cụ admin - admintool
37DatTT-DSE-SOICT-HUST
Ví dụ-công cụ admin của Tomcat
38DatTT-DSE-SOICT-HUST
GlassFish Admin Console
39DatTT-DSE-SOICT-HUST
3.4. Bảo mật Passwords trên đường
truyền cho kỹ thuật Basic & Form-
based Authentications
40DatTT-DSE-SOICT-HUST
Bảo mật Passwords
Với loại Basic & Form-based authentication, trừ khi
được chỉ định rõ ràng, password sẽ được truyền ở
dạng không được mã mật (Base64)
Khai báo bảo mật cho pasword như các loại dữ liệu
khác:
Nếu chọn giá trị CONFIDENTIAL hoặc INTEGRAL trong
<transport-guarantee> (con của <user-data-constraint>),
ràng buộc này sẽ được áp dụng cho tất cả các requests
khớp với các URL patterns định nghĩa trong <web-
resource-collection> (không chỉ trong login)
Đã sử dụng SSL
41DatTT-DSE-SOICT-HUST
Chế độ bảo mật SSL áp dụng cho tất cả
dữ liệu truyền dẫn, bao gồm cả password
<web-app>
...
<security-constraint>
<web-resource-collection>
<web-resource-name>WRCollection</web-resource-name>
<url-pattern>/loadpricelist</url-pattern>
<http-method>GET</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method> <realm-name></realm-name>
</login-config>
...
</web-app>
42DatTT-DSE-SOICT-HUST
8. 9/10/2011
8
3.5. Hướng dẫn cài đặt
Security cho tầng Web
43DatTT-DSE-SOICT-HUST
Chuyển đối giữa SSL và non-SSL cho các
tài nguyên Web (Web resources)
Khi đã chuyển sang chế độ SSL, không chấp
nhận các request non-SSL trong session đó
Vì session ID không ở dạng mã mật, kẻ giả mạo
có thể thực hiện các transaction liên quan đến
dữ liệu nhạy cảm (vd: số thẻ tín dụng)
Sử dụng Servlet filter để từ chối (reject) mọi
non-SSL requests
44DatTT-DSE-SOICT-HUST
SSL có chi phí cao
Chỉ sử dụng SSL cho những tài nguyên Web
cần đến security
45DatTT-DSE-SOICT-HUST
Ví dụ demo:
Download mã nguồn từ:
http://archive.moreservlets.com/Chapter7.html
2 ví dụ, sử dụng Basic Auth và Form-based Auth
hotdotcom-internal.war
hotdotcom.war
Thêm usernames, roles (được sử dụng trong
code) thích hợp vào trong môi trường
Tomcat (tomcat-users.xml)
Khởi động lại Tomcat
46DatTT-DSE-SOICT-HUST
Basic Authentication Demo
hotdotcom-internal.war
Financial plan page: cho tất cả các employees
Business plan page: cho tất cả các executives
Employee compensation plan: available to all employees
Thử truy cập trang được “điều khiển truy cập”
Thử nhập các username & password giả
Thử nhập đúng username & password nhưng của
người không có quyền truy cập (không có role phù
hợp)
47DatTT-DSE-SOICT-HUST
Basic Authentication Demo
48DatTT-DSE-SOICT-HUST
9. 9/10/2011
9
Truy cập trang được “điều khiển truy cập”
với username giả
49DatTT-DSE-SOICT-HUST
Truy cập các trang “access controlled” với
tài khoản đúng
50DatTT-DSE-SOICT-HUST
Form-based Authentication
51DatTT-DSE-SOICT-HUST
Custom login page
52DatTT-DSE-SOICT-HUST
Custom error page
53DatTT-DSE-SOICT-HUST
3.6. Xác thực Client sử dụng kỹ
thuật xác thực dựa trên
Certificate
54DatTT-DSE-SOICT-HUST
10. 9/10/2011
10
Tại sao cần xác thực dựa trên certificate?
Xác thực Username/password không thể sử
dụng để xác thực giữa chương trình với
chương trình
Chứng nhận (Certificates) có thể được dùng để
danh tính (identify) người dùng cuối, tổ chức
thương mai, server, hoặc các software entities
Cặp Username/password không đem lại đủ
tin cậy
Certificate có thể chứa nhiều hơn chỉ username
và password
55DatTT-DSE-SOICT-HUST
Xác thực dựa trên certificate
Xác thực Client
Server xác thực (verify) danh tính của client
(client's identity)
Xác thực Server
client xác thực danh tính của server
Thực hiện một cách “trong suốt” trong giao tiếp
SSL giữa trình duyệt và web server
Xác thực lẫn nhau (Mutual authentication)
Cả server và client xác thực danh tính của nhau
56DatTT-DSE-SOICT-HUST
Định dạng Certificate
Định dạng chuẩn của Certificate là X.509
X.509 chỉ đặc tả định dạng của certificate
nhưng không chỉ định rõ cách thức certificate
được trao đổi
SSL chỉ định rõ cách thức trao đổi các
certificates
57DatTT-DSE-SOICT-HUST
Xác thực Client sử dụng kỹ thuật xác thực
dựa trên certificate
Client được xác thực bằng cách gửi Client
certificate đến Web server
Khi server cũng xác thực nó với client, ta gọi là
xác thực lẫn nhau (mutual authentication)
Tất cả Client (trình duyệt) phải có certificate
của mình
Vì vậy, không phổ biến như kỹ thuật xác thực
Basic & Form-based authentication
Sử dụng SSL cho HTTP (HTTPS)
58DatTT-DSE-SOICT-HUST
Chỉ dẫn web container sử dụng kỹ thuật
Client-Cert authentication
Trong file web.xml của ứng dụng Web
<web-app>
...
<security-constraint>...</security-constraint>
<login-config>
<auth-method>CLIENT-CERT</auth-method>
<realm-name>realm name</realm-name>
</login-config>
...
</web-app>
59DatTT-DSE-SOICT-HUST
3.7. Digest Authentication
60DatTT-DSE-SOICT-HUST
11. 9/10/2011
11
Digest Authentication
User, password được chuyển sang dạng “digested
form” trước khi được gửi cho server
Người dùng không thể lấy được password gốc từ
password đã được biến đổi
Chỉ thay đổi 1 bit ở password gốc cũng dẫn đến thay đổi
giá trị của password biến đổi
user, password không bị lộ trên đường truyền, ngay
cả khi không sử dụng kết nối SSL
Server so sánh giá trị biến đổi nhận được với giá trị
nó có, nếu trùng, việc xác thực là thành công
61DatTT-DSE-SOICT-HUST
Chỉ dẫn web container sử dụng kỹ thuật
xác thực “Digest authentication”
Trong file web.xml của ứng dụng Web
<web-app>
...
<security-constraint>...</security-constraint>
<login-config>
<auth-method>DIGEST</auth-method>
<realm-name>realm name</realm-name>
</login-config>
...
</web-app>
62DatTT-DSE-SOICT-HUST
3.8. Xác thực theo kiểu
Programmatic trong tầng Web
63DatTT-DSE-SOICT-HUST
Xác thực theo kiểu Programmatic trong
tầng Web
Ứng dụng Web có thể tự thực hiện xác thực
Có nhiều tùy biến hơn (nhưng thường ít mang lại
lợi ích)
Ít được sử dụng trong thực tế
64DatTT-DSE-SOICT-HUST
Các bước thực hiện
Kiểm tra xem có authorization header không
Decode username & password (đã được
encode Base64)
Kiểm tra cặp username/password
Nếu đúng, thực hiện điều khiển truy cập tiếp
Nếu có quyền truy cập, trả về trang mong muốn
Nếu không, trả về trang thông báo phù hợp
Nếu không, (xác thực chưa thành công), yêu cầu
gửi lại username & password
65DatTT-DSE-SOICT-HUST
Kiểm tra có authentication Header không
public void doGet(…)… {
// Check if authentication header is present in
// HttpServletRequest. If not, ask for it.
String authorization =
request.getHeader("Authorization");
if (authorization == null) {
askForPassword(response);
} else {
...
66DatTT-DSE-SOICT-HUST
12. 9/10/2011
12
Decode Username và Password
if (authorization == null) {
askForPassword(response);
} else {
String userInfo =
authorization.substring(6).trim();
BASE64Decoder decoder = new BASE64Decoder();
String nameAndPassword =
new String(decoder.decodeBuffer(userInfo));
int index = nameAndPassword.indexOf(":");
String user =
nameAndPassword.substring(0, index);
String password =
nameAndPassword.substring(index+1);
...
67DatTT-DSE-SOICT-HUST
Nếu thành công, trả về trang mong muốn, nếu
không, yêu cầu username & password mới
if (authorization == null) {
askForPassword(response);
} else {
...
// If authentication succeeds, return page.
// Otherwise, ask for correct username & password
if (areEqualReversed(user, password)) {
showStock(request, response);
} else {
askForPassword(response);
}
}
}
68DatTT-DSE-SOICT-HUST
4. Authorization
(Điều khiển truy cập-Access Control)
69DatTT-DSE-SOICT-HUST
4 loại Authorization (điều khiển truy cập)
trên J2EE
Tầng Web & tầng EJB
Có thể được sử dụng cùng nhau
Declarative & Programmatic
4 loại:
Điều khiển truy cập Declarative ở tầng Web
Điều khiển truy cập Programmatic ở tầng Web
Điều khiển truy cập Declarative ở tầng EJB
Điều khiển truy cập Programmatic ở tầng EJB
70DatTT-DSE-SOICT-HUST
EJB-tier
Web-tier vs. EJB-tier
• (D) Access control
to Web resources
• (D) Declared in
web.xml
• (D) Enforced by
web container
• (P) Coded in servlet
or JSP
• (D) Access control to
bean methods
• (D) Declared in EJB
deployment descriptor
• (D) Enforced by EJB
container
• (P) Coded in EJB
bean
Web-tier
(D): Declarative (P): Programmatic access control
71DatTT-DSE-SOICT-HUST
Programmatic
Declarative vs. Programmatic
• Access control is
declared in
deployment
descriptor
• Container handles
access control
• Does not handle
fine-grained access
control, it is all or
nothing deal
• Access control is
coded in your
program
• Your code handles
access control
• Can handle fine-
grained access
control, i.e. instance-
based or business
logic based access
control
Declarative
72DatTT-DSE-SOICT-HUST
13. 9/10/2011
13
4.1. Điều khiển truy cập
Declarative ở tầng Web
73DatTT-DSE-SOICT-HUST
Các bước điều khiển truy cập Declarative
ở tầng Web
Người triển khai (Deployer) thực hiện map định
danh người dùng thật với các security roles (vd:
<install-dir>/config/tomcat-users.xml)
Deployer khai báo các security roles trong file
web.xml
Deployer khai báo các URL permissions trong
file web.xml cho mỗi security role
(Đã trình bày trong phần trước! )
74DatTT-DSE-SOICT-HUST
4.2. Điều khiển truy cập
Programmatic ở tầng Web
75DatTT-DSE-SOICT-HUST
Điều khiển truy cập declarative &
Programmatic
Thường được sử dụng cùng nhau
Declarative: điều khiển truy cập dựa trên role
Programmatic: điều khiển truy cập dựa trên từng
thực thể user & dựa trên logic nghiệp vụ
User instance
Thời gian trong ngày
Các Parameters trong request
Các trạng thái bên trong của các web component
76DatTT-DSE-SOICT-HUST
Các bước thực hiện điều khiển truy cập
Programmatic cho tầng Web
Thiết lập username, passwords, và roles
(realms)
LTV viết các đoạn code Servlet xử lý logic
điều khiển truy cập, sử dụng các abstract
security roles
Trong file web.xml, deployer thực hiện map
các abstract security roles với role trong thực
tế (VD, Tomcat có flat file based, RDBMS,
LDAP)
77DatTT-DSE-SOICT-HUST
Bước 2: LTV viết code Servlet xử lý điều
khiển truy cập
public interface javax.servlet.http.HTTPServletRequest{
...
// Find out who is accessing your web resource
public java.security.Principal getUserPrincipal();
public String getRemoteUser();
// Is the caller in a particular role?
public boolean isUserInRole(String role);
...
}
78DatTT-DSE-SOICT-HUST
14. 9/10/2011
14
Ví dụ: “Employees” chỉ truy cập được
thông tin về lương của chính họ
public double getSalary(String employeeId) {
java.security.Principal userPrincipal =
request.getUserPrincipal();
String callerId = userPrincipal.getName();
// “manager” role can read employee salary information
// employee can read only his/her own salary information
if ( (request.isUserInRole(“manager”)) ||
((request.isUserInRole(“employee”)) &&
(callerId == employeeId)) ) {
// return Salary information for the employee
getSalaryInformationSomehow(employId);
} else {
throw new SecurityException(“access denied”);
}
}
79DatTT-DSE-SOICT-HUST
Bước 3: Deployer thực hiện map các
abstract security roles với các roles thực tế
<web-app>
...
<servlet>
<servlet-name>...</servlet-name>
<servlet-class>...</servlet-class>
<!-- Servlet programmer declared abstract security roles -->
<security-role-ref>
<role-name>manager</role-name> <!-- preexisting -->
<role-link>managerOfAcme</role-link> <!-- alias -->
<security-role-ref>
</servlet>
...
</web-app>
80DatTT-DSE-SOICT-HUST