<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sytzevk</id>
		<title>OWASP - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sytzevk"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Sytzevk"/>
		<updated>2026-06-03T02:00:19Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Blue_Teaming&amp;diff=249708</id>
		<title>Blue Teaming</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Blue_Teaming&amp;diff=249708"/>
				<updated>2019-04-04T20:49:10Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;&amp;lt; page in progress &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blue Teaming for Developers is a practise for defenders in security to increase their security posture against a (simulated) team of attackers (often called the Red Team). T&lt;br /&gt;
his page discusses the case for Blue Teaming as a practise for Dev teams. In contrast to fixing the application because of incident response in relative low pressure, Blue Teaming is a real time battle game against a (simulated) attacker. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Playbook --&lt;br /&gt;
&lt;br /&gt;
Dev team sees their appication is attacked, and tries as fast as possible to defend it. This can entail tuning logging, fixing configuration errors, fixing vulns in source code or 3rd party lib,  &lt;br /&gt;
&lt;br /&gt;
- priorities&lt;br /&gt;
&lt;br /&gt;
- monitoring&lt;br /&gt;
  - is monitoring available ? do we log the right data ? do we have enough context ?&lt;br /&gt;
&lt;br /&gt;
- CI/CD solution&lt;br /&gt;
   - is the automated build solution working and how quickly can it be deployed ?&lt;br /&gt;
&lt;br /&gt;
- admin console&lt;br /&gt;
  - is there an admin console ? can it be used to protect the application/data ? Or be used by the attacker to shut us out ? &lt;br /&gt;
&lt;br /&gt;
- backups&lt;br /&gt;
   - are backups available ? how do we make a snapshot of the data ?&lt;br /&gt;
&lt;br /&gt;
- containment &lt;br /&gt;
    - how can we contain possible attacks ? &lt;br /&gt;
&lt;br /&gt;
- procuedures&lt;br /&gt;
  - do we know how to escalate problems ? how to restore backed-up data ? how to get Ops to help out ?&lt;br /&gt;
&lt;br /&gt;
- suggestions for Ops wrt hardening, config, monitoring, WAF, ....&lt;br /&gt;
&lt;br /&gt;
- ATT&amp;amp;CK framework support for simulated attacks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- tools&lt;br /&gt;
   - burpsuite,ZAP&lt;br /&gt;
   - quick method for risk calculation. is it worth fixing ?&lt;br /&gt;
   -&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Blue_Teaming&amp;diff=249690</id>
		<title>Blue Teaming</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Blue_Teaming&amp;diff=249690"/>
				<updated>2019-04-04T17:01:01Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;&amp;lt; page in progress &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Blue Teaming for Developers is a practise for defenders in security to increase their security posture against a (simulated) team of attackers (often called the Red Team). T&lt;br /&gt;
his page discusses the case for Blue Teaming as a practise for Dev teams. In contrast to fixing the application because of incident response in relative low pressure, Blue Teaming is a real time battle game against a (simulated) attacker. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Playbook --&lt;br /&gt;
&lt;br /&gt;
Dev team sees their appication is attacked, and tries as fast as possible to defend it. This can entail tuning logging, fixing configuration errors, fixing vulns in source code or 3rd party lib,  &lt;br /&gt;
&lt;br /&gt;
- priorities&lt;br /&gt;
&lt;br /&gt;
- monitoring&lt;br /&gt;
  - is monitoring available ? do we log the right data ? do we have enough context ?&lt;br /&gt;
&lt;br /&gt;
- CI/CD solution&lt;br /&gt;
   - is the automated build solution working and how quickly can it be deployed ?&lt;br /&gt;
&lt;br /&gt;
- admin console&lt;br /&gt;
  - is there an admin console ? can it be used to protect the application/data ? Or be used by the attacker to shut us out ? &lt;br /&gt;
&lt;br /&gt;
- backups&lt;br /&gt;
   - are backups available ? how do we make a snapshot of the data ?&lt;br /&gt;
&lt;br /&gt;
- containment &lt;br /&gt;
    - how can we contain possible attacks ? &lt;br /&gt;
&lt;br /&gt;
- procuedures&lt;br /&gt;
  - do we know how to escalate problems ? how to restore backed-up data ? how to get Ops to help out ?&lt;br /&gt;
&lt;br /&gt;
- tools&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Blue_Teaming&amp;diff=249682</id>
		<title>Blue Teaming</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Blue_Teaming&amp;diff=249682"/>
				<updated>2019-04-04T14:48:46Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;&amp;lt; page in progress &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BLue Teaming is a practise for defenders in security to increase their security posture against a team of attackers (usually called the Red Team). This page discusses the case for Blue Teaming as a practise for Dev teams.&lt;br /&gt;
In contract to fixing the application beacuse of incident response, Blue Teaming is a real time battle against an attacker. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Playbook --&lt;br /&gt;
&lt;br /&gt;
Dev team sees their appication is attacked, and tries as fast as possible to defend it. This can entail tuning logging, fixing configuration errors, fixing vulns in source code or 3rd party lib,  &lt;br /&gt;
&lt;br /&gt;
- priorities&lt;br /&gt;
&lt;br /&gt;
- monitoring&lt;br /&gt;
  - is monitoring available ? do we log the right data ? do we have enough context ?&lt;br /&gt;
&lt;br /&gt;
- CI/CD solution&lt;br /&gt;
   - is the automated build solution working and how quickly can it be deployed ?&lt;br /&gt;
&lt;br /&gt;
- admin console&lt;br /&gt;
  - is there an admin console ? can it be used to protect the application/data ? Or be used by the attacker to shut us out ? &lt;br /&gt;
&lt;br /&gt;
- backups&lt;br /&gt;
   - are backups available ? how do we make a snapshot of the data ?&lt;br /&gt;
&lt;br /&gt;
- procuedures&lt;br /&gt;
  - do we know how to escalate problems ? how to restore backed-up data ? how to get Ops to help out ?&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Blue_Teaming&amp;diff=249681</id>
		<title>Blue Teaming</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Blue_Teaming&amp;diff=249681"/>
				<updated>2019-04-04T14:37:13Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: Created page with &amp;quot;&amp;lt;&amp;lt; page in progress &amp;gt;&amp;gt;  BLue Teaming is a practise for defenders in security to increase their security posture against a team of attackers (usually called the Red Team). This...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;&amp;lt; page in progress &amp;gt;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
BLue Teaming is a practise for defenders in security to increase their security posture against a team of attackers (usually called the Red Team). This page discusses the case for Blue Teaming as a practise for Dev teams.&lt;br /&gt;
&lt;br /&gt;
-- Playbook --&lt;br /&gt;
&lt;br /&gt;
Dev team sees their appication is attacked, and tries as fast as possible to defend it. This can entail tuning logging, fixing configuration errors, fixing vulns in source code or 3rd party lib,  &lt;br /&gt;
&lt;br /&gt;
- priorities&lt;br /&gt;
&lt;br /&gt;
- monitoring&lt;br /&gt;
  - is monitoring available ? do we log the right data ? do we have enough context ?&lt;br /&gt;
&lt;br /&gt;
- CI/CD solution&lt;br /&gt;
   - is the automated build solution working and how quickly can it be deployed ?&lt;br /&gt;
&lt;br /&gt;
- admin console&lt;br /&gt;
  - is there an admin console ? can it be used to protect the application/data ? Or be used by the attacker to shut us out ? &lt;br /&gt;
&lt;br /&gt;
- backups&lt;br /&gt;
   - are backups available ? how do we make a snapshot of the data ?&lt;br /&gt;
&lt;br /&gt;
- procuedures&lt;br /&gt;
  - do we know how to escalate problems ? how to restore backed-up data ? how to get Ops to help out ?&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Category:Vulnerability_Scanning_Tools&amp;diff=241229</id>
		<title>Category:Vulnerability Scanning Tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Category:Vulnerability_Scanning_Tools&amp;diff=241229"/>
				<updated>2018-06-09T12:19:09Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: added Nessus&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description  ==&lt;br /&gt;
&lt;br /&gt;
Web Application Vulnerability Scanners are automated tools that scan web applications, normally from the outside, to look for security vulnerabilities such as [[Cross-site scripting]], [[SQL Injection]], [[Command Injection]], [[Path Traversal]] and insecure server configuration. This category of tools is frequently referred to as [https://www.techopedia.com/definition/30958/dynamic-application-security-testing-dast Dynamic Application Security Testing] (DAST) Tools. A large number of both commercial and open source tools of this type are available and all of these tools have their own strengths and weaknesses.  If you are interested in the effectiveness of DAST tools, check out the OWASP [[Benchmark]] project, which is scientifically measuring the effectiveness of all types of vulnerability detection tools, including DAST.&lt;br /&gt;
&lt;br /&gt;
Here we provide a list of vulnerability scanning tools currently available in the market.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt; '''Disclaimer:''' The tools listing in the table below are presented in an alphabetical order. &amp;lt;b&amp;gt;OWASP does not endorse any of the Vendors or Scanning Tools by listing them in the table below. We have made every effort to provide this information as accurately as possible. If you are the vendor of a tool below and think this information is incomplete or incorrect, please send an e-mail to our [mailto:owasp_ha_vulnerability_scanner_project@lists.owasp.org mailing list] and we will make every effort to correct this information.&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tools Listing  ==&lt;br /&gt;
&lt;br /&gt;
{{:Template:OWASP Tool Headings}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.acunetix.com/ Acunetix WVS] || tool_owner = Acunetix || tool_licence = Commercial / Free (Limited Capability) || tool_platforms = Windows}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://www.edgescan.com/ edgescan] || tool_owner = edgescan|| tool_licence = Commercial || tool_platforms = SaaS}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www-03.ibm.com/software/products/en/appscan-standard AppScan] || tool_owner = IBM || tool_licence = Commercial || tool_platforms = Windows}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://www.trustwave.com/Products/Application-Security/App-Scanner-Family/App-Scanner-Enterprise/ App Scanner] || tool_owner = Trustwave || tool_licence = Commercial || tool_platforms = Windows }}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.rapid7.com/products/appspider/ AppSpider] || tool_owner = Rapid7 || tool_licence = Commercial || tool_platforms = Windows}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://apptrana.indusface.com/basic/ AppTrana Basic] || tool_owner = AppTrana || tool_licence = Free (Limited Capability) || tool_platforms = SaaS}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://www.scanmyserver.com/ AVDS] || tool_owner = Beyond Security || tool_licence = Commercial / Free (Limited Capability)|| tool_platforms = SaaS }}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://www.blueclosure.com BlueClosure BC Detect] || tool_owner = BlueClosure || tool_licence = Commercial, 2 weeks trial || tool_platforms = Most platforms supported}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.portswigger.net/ Burp Suite] || tool_owner = PortSwiger || tool_licence = Commercial / Free (Limited Capability)|| tool_platforms = Most platforms supported }}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://contrastsecurity.com Contrast] || tool_owner = Contrast Security || tool_licence = Commercial / Free (Limited Capability) || tool_platforms = SaaS or On-Premises }}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://detectify.com/ Detectify] || tool_owner = Detectify || tool_licence = Commercial || tool_platforms = SaaS }}&lt;br /&gt;
&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.digifort.se/en/scanner Digifort- Inspect] || tool_owner = Digifort|| tool_licence = Commercial || tool_platforms = SaaS }}&lt;br /&gt;
&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.gamasec.com/Gamascan.aspx GamaScan] || tool_owner = GamaSec || tool_licence = Commercial || tool_platforms = Windows }}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://rgaucher.info/beta/grabber/ Grabber] || tool_owner = Romain Gaucher || tool_licence = Open Source || tool_platforms = Python 2.4, BeautifulSoup and PyXML}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://gravityscan.com/ Gravityscan] || tool_owner = Defiant, Inc. || tool_licence = Commercial / Free (Limited Capability) || tool_platforms = SaaS}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://sourceforge.net/p/grendel/code/ci/c59780bfd41bdf34cc13b27bc3ce694fd3cb7456/tree/ Grendel-Scan] || tool_owner = David Byrne || tool_licence = Open Source || tool_platforms = Windows, Linux and Macintosh}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.golismero.com GoLismero] || tool_owner = GoLismero Team || tool_licence = GPLv2.0 || tool_platforms = Windows, Linux and Macintosh}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.ikare-monitoring.com/ IKare] || tool_owner = ITrust || tool_licence = Commercial || tool_platforms = N/A }}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://www.indusface.com/index.php/products/web-application-scanning Indusface Web Application Scanning] || tool_owner = Indusface || tool_licence = Commercial || tool_platforms = SaaS}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.nstalker.com/ N-Stealth] || tool_owner = N-Stalker || tool_licence = Commercial || tool_platforms = Windows}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://www.tenable.com/products/tenable-io/web-application-scanning/ Nessus] || tool_owner = Tenable || tool_licence = Commercial || tool_platforms = Windows}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.mavitunasecurity.com/ Netsparker] || tool_owner = MavitunaSecurity || tool_licence = Commercial || tool_platforms = Windows}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.rapid7.com/products/nexpose-community-edition.jsp Nexpose] || tool_owner = Rapid7 || tool_licence = Commercial / Free (Limited Capability)|| tool_platforms = Windows/Linux}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.cirt.net/nikto2 Nikto] || tool_owner = CIRT || tool_licence = Open Source|| tool_platforms = Unix/Linux}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.milescan.com/ ParosPro] || tool_owner = MileSCAN || tool_licence = Commercial || tool_platforms = Windows}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://probely.com Probe.ly] || tool_owner = Probe.ly || tool_licence = Commercial || tool_platforms = SaaS}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.websecurify.com/desktop/proxy.html Proxy.app] || tool_owner = Websecurify || tool_licence = Commercial || tool_platforms = Macintosh}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.qualys.com/products/qg_suite/was/ QualysGuard] || tool_owner = Qualys || tool_licence = Commercial || tool_platforms = N/A}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.beyondtrust.com/Products/RetinaNetworkSecurityScanner/ Retina] || tool_owner = BeyondTrust || tool_licence = Commercial || tool_platforms = Windows}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.orvant.com Securus] || tool_owner = Orvant, Inc || tool_licence = Commercial || tool_platforms = N/A}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.whitehatsec.com/home/services/services.html Sentinel] || tool_owner = WhiteHat Security || tool_licence = Commercial || tool_platforms = N/A}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.parasoft.com/products/article.jsp?articleId=3169&amp;amp;redname=webtesting&amp;amp;referred=webtesting SOATest] || tool_owner = Parasoft || tool_licence = Commercial || tool_platforms = Windows / Linux / Solaris}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://www.tinfoilsecurity.com Tinfoil Security] || tool_owner = Tinfoil Security, Inc. || tool_licence = Commercial / Free (Limited Capability) || tool_platforms = SaaS or On-Premises}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://www.trustwave.com/external-vulnerability-scanning.php Trustkeeper Scanner] || tool_owner = Trustwave SpiderLabs || tool_licence = Commercial || tool_platforms = SaaS}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://subgraph.com/vega/ Vega] || tool_owner = Subgraph || tool_licence = Open Source || tool_platforms = Windows, Linux and Macintosh}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://wapiti.sourceforge.net/ Wapiti] || tool_owner = Informática Gesfor || tool_licence = Open Source || tool_platforms = Windows, Unix/Linux and Macintosh}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.tripwire.com/it-security-software/enterprise-vulnerability-management/web-application-vulnerability-scanning/ WebApp360] || tool_owner = TripWire || tool_licence = Commercial || tool_platforms = Windows}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://webcookies.org WebCookies] || tool_owner = WebCookies || tool_licence = Free|| tool_platforms = SaaS}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www8.hp.com/us/en/software-solutions/software.html?compURI=1341991#.Uuf0KBAo4iw WebInspect] || tool_owner = HP || tool_licence = Commercial || tool_platforms = Windows}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.websecurify.com/desktop/webreaver.html WebReaver] || tool_owner = Websecurify || tool_licence = Commercial || tool_platforms = Macintosh}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.german-websecurity.com/en/products/webscanservice/product-details/overview/ WebScanService] || tool_owner = German Web Security || tool_licence = Commercial || tool_platforms = N/A}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://suite.websecurify.com/ Websecurify Suite] || tool_owner = Websecurify || tool_licence = Commercial / Free (Limited Capability) || tool_platforms = Windows, Linux, Macintosh}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.sensepost.com/research/wikto/ Wikto] || tool_owner = Sensepost || tool_licence = Open Source || tool_platforms = Windows}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [http://www.w3af.org/ w3af] || tool_owner = w3af.org || tool_licence = GPLv2.0 || tool_platforms = Linux and Mac}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://www.owasp.org/index.php/OWASP_Xenotix_XSS_Exploit_Framework Xenotix XSS Exploit Framework] || tool_owner = OWASP || tool_licence = Open Source || tool_platforms = Windows}}&lt;br /&gt;
{{OWASP Tool Info || tool_name = [https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project Zed Attack Proxy] || tool_owner = OWASP || tool_licence = Open Source || tool_platforms = Windows, Unix/Linux and Macintosh}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References  ==&lt;br /&gt;
&lt;br /&gt;
*[[Source_Code_Analysis_Tools | SAST Tools]] - Similar Information on Static Application Security Testing (SAST) Tools&lt;br /&gt;
*http://projects.webappsec.org/Web-Application-Security-Scanner-Evaluation-Criteria&lt;br /&gt;
*http://www.slideshare.net/lbsuto/accuracy-and-timecostsofwebappscanners&lt;br /&gt;
*http://samate.nist.gov/index.php/Web_Application_Vulnerability_Scanners.html&lt;br /&gt;
*http://www.tssci-security.com/archives/2007/11/24/2007-security-testing-tools-in-review/&lt;br /&gt;
*http://www.softwareqatest.com/qatweb1.html#SECURITY&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP_Tools_Project]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Security_Logging_Project&amp;diff=237750</id>
		<title>OWASP Security Logging Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Security_Logging_Project&amp;diff=237750"/>
				<updated>2018-02-16T14:28:56Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: new release&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Main=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:OWASP_Project_Header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
==OWASP Security Logging Project==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The OWASP Security Logging project provides developers and ops personnel with APIs for logging security-related events. The aim is to let developers use the same set of logging APIs they are already familiar with from over a decade of experience with Log4J and its successors, while also adding powerful security features.&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Logging is often neglected by developers when thinking of security considerations. However, proper logging practice can provide the crucial forensics needed to investigate after a breach, and perhaps more importantly, a change to detect security issues as they happen. Most developers are already familiar with using logging for debugging and diagnostic purposes, so it should be easy for them to grasp the concept of security logging as well. The OWASP Security Logging project aims to give developers an easy way to get started with logging security events, tracking extra forensic information like the who (username), what (event type), and where (IP address, server name) needed for forensics. It also provides a means for classifying the information in log messages and applying masking if necessary.  &lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
This library is free software: you can redistribute it and/or modify it under the terms of the Apache License, Version 2.0. You can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
Overview of benefits and what you need to get started quickly.&lt;br /&gt;
&lt;br /&gt;
[http://www.securitycurmudgeon.com/2016/03/owasp-security-logging-project-explored.html OWASP Security Logging Project Explored]&lt;br /&gt;
&lt;br /&gt;
== Project Resources ==&lt;br /&gt;
[https://github.com/javabeanz/owasp-security-logging Source Code]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/javabeanz/owasp-security-logging/wiki Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/javabeanz/owasp-security-logging/issues Issue Tracker]&lt;br /&gt;
&lt;br /&gt;
== Related Projects ==&lt;br /&gt;
* [[Logging_Cheat_Sheet|Logging Cheat Sheet]]&lt;br /&gt;
&lt;br /&gt;
==Classifications==&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_CODE.jpg|link=]]&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot; rowspan=&amp;quot;2&amp;quot;| [[File:Owasp-incubator-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Incubator_Projects|Incubator Project]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-builders-small.png|link=Builders]]  &lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=Defenders]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [http://www.apache.org/licenses/LICENSE-2.0.html ASLv2]&lt;br /&gt;
   |}&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== Project Leaders ==&lt;br /&gt;
[mailto:sytze.vonkoningsveld@owasp.org Sytze van Koningsveld]&lt;br /&gt;
&lt;br /&gt;
[mailto:august.detlefsen@owasp.org August Detlefsen] &lt;br /&gt;
&lt;br /&gt;
[mailto:milton.smith@owasp.org Milton Smith]&lt;br /&gt;
&lt;br /&gt;
== News and Events ==&lt;br /&gt;
&lt;br /&gt;
18 Jan 2018, [https://github.com/javabeanz/owasp-security-logging/releases/tag/v1.1.4 Version 1.1.4 released]&lt;br /&gt;
&lt;br /&gt;
1 Jul 2016, [http://www.slideshare.net/MiltonSmith6/how-to-use-owasp-security-logging How to Use OWASP Security Logging, AppSecEU 2016 Lightning Talk]&lt;br /&gt;
&lt;br /&gt;
5 Mar 2015, Version 1.0.0 deployed to Maven Central&lt;br /&gt;
&lt;br /&gt;
23 Dec 2014, Project Created and source code now available!&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paypal&amp;gt;OWASP Security Logging Project&amp;lt;/paypal&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FAQs=&lt;br /&gt;
&lt;br /&gt;
The following provides answers to frequently asked questions.&lt;br /&gt;
&lt;br /&gt;
==How can I participate in your project?==&lt;br /&gt;
All you have to do is make the Project Leader's aware of your available time to contribute to the project. It is also important to let the Leader's know how you would like to contribute and pitch in to help the project meet it's goals and milestones. There are many different ways you can contribute to an OWASP Project, but communication with the leads is key. &lt;br /&gt;
&lt;br /&gt;
==If I am not a programmer can I participate in your project?==&lt;br /&gt;
Yes, you can certainly participate in the project if you are not a programmer or technical. The project needs different skills and expertise and different times during its development. Currently, we are looking for researchers, writers, graphic designers, and a project administrator.&lt;br /&gt;
&lt;br /&gt;
= Acknowledgements =&lt;br /&gt;
==Volunteers==&lt;br /&gt;
&lt;br /&gt;
Only project leads for the moment.  Email projects leads if you would like to participate.&lt;br /&gt;
&lt;br /&gt;
=Roadmap &amp;amp; Getting Involved=&lt;br /&gt;
&lt;br /&gt;
Today many logging technologies are available providing powerful application logging capabilities.  But while powerful, these technologies are not designed for specific use-cases like security and auditing.  The generalized approach to logging platforms makes these platforms more useful to the widest possible audience but it also places more responsibility on designers.  In short, we don't consider our desire for additional improvement for security and audit logs is no oversight on the part of logging platform designers.&lt;br /&gt;
&lt;br /&gt;
It's the OWASP Security Logging Project desire to leverage existing technologies and apply them to improve security, audit, in addition to diagnostic logging.  We understand logging is mostly an afterthought on many project schedules, if it's included at all.   We believe a logging solution embracing this project will help the community produce better logs, a better understanding of our information systems, and higher quality software.&lt;br /&gt;
&lt;br /&gt;
==Getting involved==&lt;br /&gt;
Are you passionate about logging?  Are you motivated share your time and knowledge with the community?  Send the project leads an email, listed on project home page, and explain your ideas and how you can help.  Don't be discouraged if we don't immediately respond.  We occasionally get distracted with life but rest assured we will respond.&lt;br /&gt;
&lt;br /&gt;
==What is the OWASP Security Logging Project?==&lt;br /&gt;
OWASP Security Logging Project purpose is to deliver a suitable logging solution for general-purpose security, audit, and diagnostics log messaging.  Beyond code and technology, the project provides architectural and implementation considerations you may find useful in your own projects, or technologies you may not have previously considered.&lt;br /&gt;
&lt;br /&gt;
==Project goals==&lt;br /&gt;
* Develop a set of logging requirements for key domains like security, auditing, and diagnostics&lt;br /&gt;
* Develop interface specifications that support the projects requirements&lt;br /&gt;
* Develop a base implementation supporting project interface specifications&lt;br /&gt;
* Develop documentation artifacts (described later)&lt;br /&gt;
&lt;br /&gt;
==Considerations and restraints==&lt;br /&gt;
* Ease of use&lt;br /&gt;
* Compelling value on initial deployment (without any refactoring).  Increased value for refactoring&lt;br /&gt;
* Compatibility with existing industry standard logging technologies (e.g., log4*, logback, FluentD, etc) &lt;br /&gt;
* Typical scenarios considered, 1) stand-alone applications on mobile or desktop, 2) enterprise applications, and 3) cloud-based applications.&lt;br /&gt;
&lt;br /&gt;
==Anticipated support==&lt;br /&gt;
* Java 1.7 and Java 1.8&lt;br /&gt;
* .NET (tbd)&lt;br /&gt;
''We have considered other platforms for the future but everything depends upon community interest and support.''&lt;br /&gt;
&lt;br /&gt;
==Proposed features==&lt;br /&gt;
Following is a list of numbered features.  &lt;br /&gt;
&lt;br /&gt;
:1. MDC metadata improvements&lt;br /&gt;
:: a. process id (TBD)&lt;br /&gt;
:: b. application id and application instance id&lt;br /&gt;
:: c. server time\date in UTC &lt;br /&gt;
:: d. client time\date in UTC &lt;br /&gt;
:: e. client IP address &lt;br /&gt;
:: f. username or ID &lt;br /&gt;
:: g. global client session ID&lt;br /&gt;
:: h. security policy identifier&lt;br /&gt;
:: i. transaction id&lt;br /&gt;
:2. Log system properties on startup&lt;br /&gt;
:3. Log command line options on startup&lt;br /&gt;
:4. Log application server properties on startup&lt;br /&gt;
:5. Log HTTP request parameters &lt;br /&gt;
:6. Log HTTP session attributes&lt;br /&gt;
:7. Internationalization considerations&lt;br /&gt;
:8. Redirect system streams like system.out and system.err security logging framework&lt;br /&gt;
:9. Asynchronous message logging, store and forward&lt;br /&gt;
:10. Message correlation&lt;br /&gt;
:11. Performance options for transport compression&lt;br /&gt;
:12. Authenticated client logging&lt;br /&gt;
:13. Secure log message transport&lt;br /&gt;
:14. Signed log messages&lt;br /&gt;
:15. Guaranteed log message delivery&lt;br /&gt;
&lt;br /&gt;
==Delivery phases==&lt;br /&gt;
'''Alpha 1''', some features code complete.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Alpha 2''', more features code complete.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Beta''', release code complete.  Public encouraged to test and respond with comments.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Early Availability(EA)''', includes improvements to beta based upon public and team recommendations.&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Use-case applicability &amp;amp; delivery schedule==&lt;br /&gt;
The following table shows a proposed applicability of each feature to the projects areas of concern, diagnostics, security, and audit logging along with a suggested delivery phase.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;color:#555555; background-color:#ffffcc;&amp;quot; cellpadding=&amp;quot;10&amp;quot;&lt;br /&gt;
!&amp;amp;nbsp;&lt;br /&gt;
!Diagnostics&lt;br /&gt;
!Security&lt;br /&gt;
!Audit&lt;br /&gt;
!Delivery&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1a, process id&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1b, application id and application instance id&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1c, server time\date in UTC&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1d, client time\date in UTC&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1e, client IP address&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1f, username or ID&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1g, global client session ID&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1h, security policy identifier&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''M'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1i, transaction id&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 2, Log system properties on startup&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 3, Log command line properties on startup&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 4, Log application server properties on startup&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 5, Log HTTP request parameters&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 6, Log HTTP session attributes&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''?'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 7, Internationalization considerations&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 8, Redirect system streams like System.out and System.err to logging framework&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 9, Asynchronous message logging, store and forward&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 10, Message correlation&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 11, Performance options for transport compression&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 12, Authenticated client logging&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 13, Secure log message transport&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 14, Signed log messages&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 15, Guaranteed log message delivery&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|}&lt;br /&gt;
'''''Legend, X=applicable use-case, M=maybe useful, ?=tbd'''''&lt;br /&gt;
&lt;br /&gt;
==Project delivery artifacts==&lt;br /&gt;
:'''Logging primer''', architectural considerations for security, audit, and diagnostics for community projects.  Provide information how logging project can be leverage to address concerns provided by each use case, general logging best practices, template for using message levels (e.g., INFO, WARN, etc).&lt;br /&gt;
:'''Logging design''', specific technical details to apply project logging to community logging projects.&lt;br /&gt;
:'''Code''', software program code that implements project feature goals.&lt;br /&gt;
&lt;br /&gt;
==Code areas==&lt;br /&gt;
:'''Logging layouts''', at the moment this is Common Event Format(CEF) and Common Log File System(CLFS).&lt;br /&gt;
:'''MDC filter''', include system information handy for most deployments into logbacks Mapped Diagnostics Context(MDC).&lt;br /&gt;
:'''MDC marker''',&lt;br /&gt;
:'''Unit testing''', various software code we use (and you can also use) to test project code.&lt;br /&gt;
&lt;br /&gt;
==Detailed use-case descriptions==&lt;br /&gt;
Following are detailed use-case descriptions for each feature.  The purpose of this section is to help readers to understand more about each feature and it's potential benefits.&lt;br /&gt;
&lt;br /&gt;
==Feature 1, MDC metadata improvements==&lt;br /&gt;
This feature adds certain metadata useful for security purposes to logback’s Mapped Diagnostics Content.  The following metadata will be mapped where available.&lt;br /&gt;
&lt;br /&gt;
===process id (feature 1a)===&lt;br /&gt;
This is the process id of the application as assigned by the operating system at execution.  On *nix and Windows environments this the PID.  Depending upon the language platform process id may not be readily available.  As an alternative, server hostname or IP may be used.&lt;br /&gt;
&lt;br /&gt;
===application id and application instance id (feature 1b)===&lt;br /&gt;
This an identifier set by the application designer to identify a unique application instance.  This identifier is useful to identify applications uniquely where many instances of the same program (e.g., web application) are hosted on 1 or more physical servers.  The application id is useful visual indicator of the type of application component.  The instance id is useful to identify the application instance.  The instance is particularly useful where the same process may host 2 or more application instances.  An instance id may be a generated hash (e.g., VMID) or unique index where size is a concern.  Once the id is used it should persist between process restarts.  A suggested format:  {APP ID}:{APP INSTANCE ID}.  An sample POS:ace22c02aa858f670e3c227fbab141e2d8d6bea6 or POS:14563.&lt;br /&gt;
&lt;br /&gt;
===server time\date in UTC (feature 1c)===&lt;br /&gt;
Time, date, and day, on the server with timezone offset at the time the message was logged.  A suggested format[1], {yyyy-MM-dd'T'HH:mm:ss.SSSZ}.  An example, 2001-07-04T12:08:56.235-0700&lt;br /&gt;
&lt;br /&gt;
===client time\date in UTC (feature 1d)===&lt;br /&gt;
Time, date, and day, on the client with timezone offset at the time the message was logged.  A suggested format[1], {yyyy-MM-dd'T'HH:mm:ss.SSSZ}.  An example, 2001-07-04T12:08:56.235-0700&lt;br /&gt;
&lt;br /&gt;
===client ip address (feature 1e)===&lt;br /&gt;
MDC property for the IP address of the client host where the log message originated.  An example, 192.168.1.30&lt;br /&gt;
&lt;br /&gt;
===user name or ID (feature 1f)===&lt;br /&gt;
This MDC property to property is an application account name associated with a human (if available) this is associated with this log message.  This property may not be available if the log message is not specifically related to an individual's activity.  An example, milton.smith&lt;br /&gt;
&lt;br /&gt;
===global client session id (feature 1g)===&lt;br /&gt;
This MDC property is a session id assigned by an application designer that is shared across multiple application instances.  Usually this is a secure hash to avoid reverse engineering.  An example, ace22c02aa858f670e3c227fbab141e2d8d6bea6&lt;br /&gt;
&lt;br /&gt;
===security policy identifier (feature 1h)===&lt;br /&gt;
MDC property that identifies activities associated with a sites security policy.  The value is site defined and can be useful when producing information for audits.  An example, Violation:SEC.5.2a&lt;br /&gt;
&lt;br /&gt;
===transaction id (feature 1i)===&lt;br /&gt;
MDC property to identify activities associated with a single user action.  For example, execution of a single application user feature may require many activities from the main application program along with components like LDAP servers and databases.  The transaction id is useful to correlate all the related system activities that support a specific user request.  Each subsequent user request receives a new transaction id.  An example, TRX:1005862&lt;br /&gt;
&lt;br /&gt;
==Feature 2, Log system properties on startup==&lt;br /&gt;
The requirement is to log all system properties on application startup.  Often it’s difficult to perform an investigation without understanding the initial state of the system.  An example how properties may appear in logs (without MDC information).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 *******************************************&lt;br /&gt;
 JAVA PROPERTY SETTINGS&lt;br /&gt;
 *******************************************&lt;br /&gt;
Setting, java.runtime.name=Java(TM) SE Runtime Environment&lt;br /&gt;
Setting, sun.boot.library.path=C:\Program Files\Java\jre6\bin&lt;br /&gt;
Setting, java.vm.version=14.0-b16&lt;br /&gt;
Setting, java.vm.vendor=Sun Microsystems Inc.&lt;br /&gt;
Setting, java.vendor.url=http://java.sun.com/&lt;br /&gt;
Setting, path.separator=;&lt;br /&gt;
Setting, java.vm.name=Java HotSpot(TM) Client VM&lt;br /&gt;
Setting, file.encoding.pkg=sun.io&lt;br /&gt;
Setting, sun.java.launcher=SUN_STANDARD&lt;br /&gt;
 Setting, user.country=US&lt;br /&gt;
Setting, sun.os.patch.level=&lt;br /&gt;
Setting, java.vm.specification.name=Java Virtual Machine Specification&lt;br /&gt;
Setting, user.dir=C:\Users\Milton\workspace\MyProject&lt;br /&gt;
Setting, java.runtime.version=1.6.0_14-b08&lt;br /&gt;
Setting, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment&lt;br /&gt;
Setting, java.endorsed.dirs=C:\Program Files\Java\jre6\lib\endorsed&lt;br /&gt;
Setting, os.arch=x86&lt;br /&gt;
Setting, java.io.tmpdir=C:\Users\Milton\AppData\Local\Temp\&lt;br /&gt;
Setting, line.separator=&lt;br /&gt;
    &lt;br /&gt;
Setting, java.vm.specification.vendor=Sun Microsystems Inc.&lt;br /&gt;
Setting, user.variant=&lt;br /&gt;
Setting, os.name=Windows 7&lt;br /&gt;
Setting, sun.jnu.encoding=Cp1252&lt;br /&gt;
Setting, java.library.path=C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\Program Files\JavaFX\javafx-sdk1.2\bin;C:\Program Files\JavaFX\javafx-sdk1.2\emulator\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\usershellcommands;C:\Program Files\QuickTime\QTSystem\&lt;br /&gt;
 Setting, java.specification.name=Java Platform API Specification&lt;br /&gt;
Setting, java.class.version=50.0&lt;br /&gt;
Setting, sun.management.compiler=HotSpot Client Compiler&lt;br /&gt;
Setting, os.version=6.1&lt;br /&gt;
Setting, user.home=C:\Users\Milton&lt;br /&gt;
Setting, user.timezone=&lt;br /&gt;
Setting, java.awt.printerjob=sun.awt.windows.WPrinterJob&lt;br /&gt;
Setting, file.encoding=Cp1252&lt;br /&gt;
Setting, java.specification.version=1.6&lt;br /&gt;
Setting, java.class.path=C:\Users\Milton\workspace\SDA\bin;C:\Java-Libs\jmx-1_2_1-bin\lib\jmxri.jar;C:\Java-Libs\apache-log4j-1.2.15\log4j-1.2.15.jar&lt;br /&gt;
Setting, user.name=Milton&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Feature 3, Log command line options on startup==&lt;br /&gt;
The requirement is to log all command line arguments on application startup.  All command line arguments must be logged.  In Java, the entire arg array passed into the main(String args[]) method should be logged.  Any whitespace or special characters should be filtered before logged.  For example a small program that echos the input to the command line may produce an output that looks like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 *******************************************&lt;br /&gt;
    COMMAND LINE ARGS&lt;br /&gt;
 *******************************************&lt;br /&gt;
java testapp “Hello World!”&lt;br /&gt;
Hello World! &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Feature 4, Log application server properties on startup==&lt;br /&gt;
The requirement is to log all key\value pairs that influence application behavior upon execution.  In Java, there parameters are defined by HttpServlet.getInitParameterNames()  An example of logged J2EE properties may look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 *******************************************&lt;br /&gt;
    J2EE PROPERTIES&lt;br /&gt;
 *******************************************&lt;br /&gt;
Setting, thread.pool.size=1000&lt;br /&gt;
Setting, request.ttlms=30000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Feature 5, Log HTTP request parameters==&lt;br /&gt;
The requirement is to log all key\value pairs associated with all application HTTP requests.  Raw HTTP requests parameters across the cloud may generate significantly increase log volume.  The goal is to define a request log that overwrites itself (e.g., a ring buffer) at a small designer specified interval or a default of 15 mins.  This allows highly granular diagnostic messages over a short duration.&lt;br /&gt;
&lt;br /&gt;
An ancillary requirement is that sensitive key\value pairs will be masked.  A default set of masking rules will be included with the project with an option for designers to assign their own masking rules specific for their applications.&lt;br /&gt;
 &lt;br /&gt;
(TODOMS: need to insert some raw http requests from zap in a suitable log format)&lt;br /&gt;
&lt;br /&gt;
==Feature 6, Log HTTP session attributes==&lt;br /&gt;
&lt;br /&gt;
The requirement is to log all key\value pairs associated with a users HttpSession instance.  These properties should be logged once upon user session initialization.  In Java, key\value pairs from HttpSession.getAttributeName() should be logged when the HttpSession is created.&lt;br /&gt;
&lt;br /&gt;
(TODOMS: need to insert some sample HTTP session attributes)&lt;br /&gt;
&lt;br /&gt;
==Feature 7, Internationalization considerations==&lt;br /&gt;
The action is to use string resources so that logs are compatible across languages.  The project will initially define US English.  Designers are encouraged to translate resources to different languages.  If the translations are made available to us we may include them.&lt;br /&gt;
&lt;br /&gt;
==Feature 8, Redirect system streams like System.out and System.err to security logging framework==&lt;br /&gt;
This requirement captures any legacy messaging from older code without refactoring.  The approach redirects any messages to system defined streams into the logging framework.  Log messages will not be a content rich since since the caller, old code in this case, does not calling the Security API directly.  The advantage is instant out of the box compatibility with no refactoring.  In Java, the action is to capture calls like System.out.println(“My wife loves security.”) and System.err() reroute them to the logging framework without modification to legacy programs.&lt;br /&gt;
&lt;br /&gt;
An ancillary requirement is that sensitive key\value pairs will be masked.  A default set of masking rules will be included with the project with an option for designers to assign their own masking rules specific for their applications.&lt;br /&gt;
&lt;br /&gt;
==Feature 9, Asynchronous message logging, store and forward==&lt;br /&gt;
The requirement for this feature one of performance.  Log messages sent to a remote location (e.g., central log server) can take some time to send over networks.  It may be desirable in some deployments for the caller not to block when logging these messages.  The goal is to log the message locally, freeing the caller, then send the message in a background thread to the remote server.   See Feature 15 also.&lt;br /&gt;
&lt;br /&gt;
==Feature 10, Message correlation==&lt;br /&gt;
A problem with logs today is that it’s often difficult to reconstruct a series of activities leading to an event of interest.  System logs are often out of order with messages originating from different threads and hosts.  The goal of message correlation is to provide identifier(s) so that all log messages can be sequenced into a narrative of system activities leading to an event of interest.  For example, with correlation it will be possible to separate log entries to see the activities involved in a single administrative user operation like Add User.  Log entries to add a user may begin with HTTP posts from the clients browser, system permission checks, next a log message describing the insert of the new user into the user table, a log message of positive confirmation a SMTP message was sent to indicate the users new account is ready for initial signon.&lt;br /&gt;
&lt;br /&gt;
==Feature 11, Performance options for transport compression==&lt;br /&gt;
Where log message will transit networks facilities will be provided to compress traffic to remote hosts.&lt;br /&gt;
&lt;br /&gt;
==Feature 12, Authenticated client logging==&lt;br /&gt;
This feature is useful to ensure each message logged is attributable to a known source and trusted source.  Messages from anonymous sources may still be allowed, depending upon system preferences, but authenticated messages will clearly indicate the identity of the source.&lt;br /&gt;
&lt;br /&gt;
==Feature 13, Secure transport==&lt;br /&gt;
To facilitate secure transport a TLS 1.2 compliant connection be negotiated.  Options must be provided to allow designers to control ciphersuite negotiation.  Negotiation options must include provision for, a) the name of each ciphersuite permitted, b) order of negotiation which is ideally strongest suites first as a default but can be changed by the designer.  The trust roots will be those supplied by the supporting language platform (e.g., Java, .NET, etc).&lt;br /&gt;
&lt;br /&gt;
==Feature 14, Signed log messages==&lt;br /&gt;
To facilitate tamper resistant log messages log messages will be signed by the client.  Each field of the log message will be included in the signing process.  The signature will be included with the log message entry along with strongest fingerprint included within signing certificate.  The fingerprint of the signing certificate is an aid to identify the signing certificate and may be important for enterprise or cloud environments where many clients are logging.  Signed logs may or may not be encrypted.&lt;br /&gt;
&lt;br /&gt;
==Feature 15, Guaranteed log message delivery==&lt;br /&gt;
This feature builds upon the Feature 9, Asynchronous message logging, store and forward to include guaranteed delivery.  The goal is that no messages are lost.  Messages received from the caller will be queued for delivery.  Clients logging messages must block until their log message is committed to a queue.  For simplicity, the queue will exist on the client computer.  The function is somewhat analogous to a local print spooler.  If committing to a queue is not possible an instance of a RuntimeException must be thrown to the caller.  Once committed to a queue, worker threads will send the message in the background to the remote server.  On the client, worker threads will not remove the log message from the queue until the server has acknowledged receipt.&lt;br /&gt;
&lt;br /&gt;
From the server side, the server must maintain the client connection until the message is logged.  If the message cannot be logged an instance of an Exception must be thrown.  Using this system no message will ever be lost.  A message will exist in only 3 states, 1) with the blocked client, 2) within the client’s log queue, 3) logged on the server.  For a completely reliable solution, HA hardware and RAID media are required which is a consideration for system designers.&lt;br /&gt;
&lt;br /&gt;
==Feedback==&lt;br /&gt;
Please report any concerns, correction, or other feedback to any of the project leads listed on the main project page.&lt;br /&gt;
&lt;br /&gt;
=Minimum Viable Product=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
This page is where you should indicate what is the minimum set of functionality that is required to make this a useful product that addresses your core security concern.&lt;br /&gt;
Defining this information helps the project leader to think about what is the critical functionality that a user needs for this project to be useful, thereby helping determine what the priorities should be on the roadmap.  And it also helps reviewers who are evaluating the project to determine if the functionality sufficiently provides the critical functionality to determine if the project should be promoted to the next project category.  &lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Project About=&lt;br /&gt;
&amp;lt;!-- Instructions are in RED and should be removed from your document by deleting the text with the span tags.--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
	This page is where you need to place your legacy project template page if your project was created before October 2013. To edit this page you will need to edit your project information template. You can typically find this page by following this address and substituting your project name where it says &amp;quot;OWASP_Example_Project&amp;quot;. When in doubt, ask the OWASP Projects Manager. &lt;br /&gt;
Example template page: https://www.owasp.org/index.php/Projects/OWASP_Example_Project&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{:Projects/OWASP_Example_Project_About_Page}} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project]]  [[Category:OWASP_Builders]] [[Category:OWASP_Defenders]]  [[Category:OWASP_Code]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225678</id>
		<title>Privacy by Design</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225678"/>
				<updated>2017-01-29T11:59:32Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*UNDER CONSTRUCTION*&lt;br /&gt;
&lt;br /&gt;
Privacy by Design (PbD) is the practice of protecting privacy by means of processes, communication and technical measures as part of the software engineering design. This area is sitll young and there are several organisations and countried that have their own set of privacy principles. First, the most quotes set of principles:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
===7 Fundamental principles in Privacy by Design by professor Ann Cavoukian===&lt;br /&gt;
# Proactive not reactive; Preventative not remedial&lt;br /&gt;
# Privacy as the default setting&lt;br /&gt;
# Privacy embedded into design&lt;br /&gt;
# Full functionality – positive-sum, not zero-sum&lt;br /&gt;
# End-to-end security – full lifecycle protection&lt;br /&gt;
# Visibility and transparency – keep it open&lt;br /&gt;
# Respect for user privacy – keep it user-centric&lt;br /&gt;
&lt;br /&gt;
See also : [[https://www.iab.org/wp-content/IAB-uploads/2011/03/fred_carter.pdf|7 Principles of Privacy by Design]]&lt;br /&gt;
These are rather high level principles, academic and hard to interpret and apply. Here I have a list of concrete measures to match each of the 7 principles &lt;br /&gt;
&lt;br /&gt;
#  Anonymization of test data.&lt;br /&gt;
#  As a counter example : Windows 10 has privacy settings that consumers have to enable, the settings violate privacy by default.&lt;br /&gt;
#  (This seems a principle ad infinitum)&lt;br /&gt;
#  If you turn on an ad-blocker, you should have the same privacy as without.&lt;br /&gt;
#  Encrypted storage of consumer data &lt;br /&gt;
#  Proper information on what personal data is used and for what purpoeses&lt;br /&gt;
#  (another principle ad infinitum ?)&lt;br /&gt;
&lt;br /&gt;
Organisation for Economic Co-operation and Development (OECD) principles for privacy are more practical ;&lt;br /&gt;
&lt;br /&gt;
===[[http://oecdprivacy.org/ OECD Privacy Principles]]===&lt;br /&gt;
# Collection Limitation Principle There should be limits to the collection of personal data and any such data should be obtained by lawful and fair means and, where appropriate, with the knowledge or consent of the data subject.&lt;br /&gt;
# Data Quality Principle Personal data should be relevant to the purposes for which they are to be used, and, to the extent necessary for those purposes, should be accurate, complete and kept up-to-date.&lt;br /&gt;
# Purpose Specification Principle The purposes for which personal data are collected should be specified not later than at the time of data collection and the subsequent use limited to the fulfilment of those purposes or such others as are not incompatible with those purposes and as are specified on each occasion of change of purpose.&lt;br /&gt;
# Use Limitation Principle Personal data should not be disclosed, made available or otherwise used for purposes other than those specified. &lt;br /&gt;
# Security Safeguards Principle Personal data should be protected by reasonable security safeguards against such risks as loss or unauthorised access, destruction, use, modification or disclosure of data.&lt;br /&gt;
# Openness Principl There should be a general policy of openness about developments, practices and policies with respect to personal data. Means should be readily available of establishing the existence and nature of personal data, and the main purposes of their use, as well as the identity and usual residence of the data controller.&lt;br /&gt;
# Individual Participation Principle An individual should have the right: to obtain from a data controller, or otherwise, confirmation of whether or not the data controller has data relating to him; to have communicated to him, data relating to him&lt;br /&gt;
# Accountability Principle A data controller should be accountable for complying with measures which give effect to the principles stated above.&lt;br /&gt;
(text used from http://oecdprivacy.org/, with some omissions)&lt;br /&gt;
&lt;br /&gt;
===PETs or Privacy Enhancing Technologies===&lt;br /&gt;
[[https://www.enisa.europa.eu/topics/data-protection/privacy-enhancing-technologies PETs]&lt;br /&gt;
&lt;br /&gt;
PII = Personal Identifiable Information&lt;br /&gt;
&lt;br /&gt;
===Fair Information Practice Principles (FIPPs)===&lt;br /&gt;
As part of using digital personal data, good communication is important. The US Federal Trace Commission has some principles has the following rules :&lt;br /&gt;
# collection limitation&lt;br /&gt;
# data quality&lt;br /&gt;
## complete&lt;br /&gt;
## consistent&lt;br /&gt;
## conform&lt;br /&gt;
## accurate&lt;br /&gt;
## integer &lt;br /&gt;
## timely&lt;br /&gt;
# purpose specification&lt;br /&gt;
# use limitation&lt;br /&gt;
# security safeguards&lt;br /&gt;
## authentication uses at least a personal knowledge &lt;br /&gt;
## authentication uses at least a personal knowledge and something owned&lt;br /&gt;
## privacy sensitive data in-transit is sent encrypted, and stored encrypted on portable media&lt;br /&gt;
## services delivering privacy sensitive data is only accessible via authenticaiotn and authorization&lt;br /&gt;
## fysical access&lt;br /&gt;
## &lt;br /&gt;
# openness&lt;br /&gt;
# individal particpitation&lt;br /&gt;
# accountabulity&lt;br /&gt;
&lt;br /&gt;
===Typical Privacy Anti-patterns===&lt;br /&gt;
# Late aggregation : sub-optimal use of data by only using derived data&lt;br /&gt;
# Ask too much : using more data than is really used&lt;br /&gt;
# Keep too long : privacy sensitive data can only be held for the timespan the owner has given permission for. &lt;br /&gt;
# Scatter data : storing privacy sensitive data on several places makes it harder to keep data up to date, and clean when needed&lt;br /&gt;
# Trust all colleagues : inside a company, compartimentalization might also be needed to protect privacy.&lt;br /&gt;
&lt;br /&gt;
===External Links===&lt;br /&gt;
[[https://privacypatterns.org privacypatterns.org]]&lt;br /&gt;
[[https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=pbd-se OASIS privacy by design]]&lt;br /&gt;
[[http://oecdprivacy.org/ OECD Privacy Principles]]&lt;br /&gt;
[[https://www.enisa.europa.eu/topics/data-protection/privacy-by-design ENISA Privacy by Design]]&lt;br /&gt;
[[https://staysafeonline.org/download/document/546/the_privacy_engineers_manifesto.pdf NCSA Privacy Engineering Manifesto]]&lt;br /&gt;
[[http://shop.oreilly.com/product/0636920033714.do The Architecture of Privacy]]&lt;br /&gt;
[[http://www.privacysense.net/10-privacy-principles-of-pipeda/ FIPPS]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225677</id>
		<title>Privacy by Design</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225677"/>
				<updated>2017-01-29T11:58:23Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*UNDER CONSTRUCTION*&lt;br /&gt;
&lt;br /&gt;
Privacy by Design (PbD) is the practice of protecting privacy by means of processes, communication and technical measures as part of the software engineering design. This area is sitll young and there are several organisations and countried that have their own set of privacy principles. First, the most quotes set of principles:&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
===7 Fundamental principles in Privacy by Design by professor Ann Cavoukian===&lt;br /&gt;
# Proactive not reactive; Preventative not remedial&lt;br /&gt;
# Privacy as the default setting&lt;br /&gt;
# Privacy embedded into design&lt;br /&gt;
# Full functionality – positive-sum, not zero-sum&lt;br /&gt;
# End-to-end security – full lifecycle protection&lt;br /&gt;
# Visibility and transparency – keep it open&lt;br /&gt;
# Respect for user privacy – keep it user-centric&lt;br /&gt;
&lt;br /&gt;
See also : [[https://www.iab.org/wp-content/IAB-uploads/2011/03/fred_carter.pdf|7 Principles of Privacy by Design]]&lt;br /&gt;
These are rather high level principles, academic and hard to interpret and apply. Here I have a list of concrete measures to match each of the 7 principles &lt;br /&gt;
&lt;br /&gt;
#  Anonymization of test data.&lt;br /&gt;
#  As a counter example : Windows 10 has privacy settings that consumers have to enable, the settings violate privacy by default.&lt;br /&gt;
#  (This seems a principle ad infinitum)&lt;br /&gt;
#  If you turn on an ad-blocker, you should have the same privacy as without.&lt;br /&gt;
#  Encrypted storage of consumer data &lt;br /&gt;
#  Proper information on what personal data is used and for what purpoeses&lt;br /&gt;
#  (another principle ad infinitum ?)&lt;br /&gt;
&lt;br /&gt;
Organisation for Economic Co-operation and Development (OECD) principles for privacy are more practical ;&lt;br /&gt;
&lt;br /&gt;
===[[http://oecdprivacy.org/ OECD Privacy Principles]]===&lt;br /&gt;
# Collection Limitation Principle There should be limits to the collection of personal data and any such data should be obtained by lawful and fair means and, where appropriate, with the knowledge or consent of the data subject.&lt;br /&gt;
# Data Quality Principle Personal data should be relevant to the purposes for which they are to be used, and, to the extent necessary for those purposes, should be accurate, complete and kept up-to-date.&lt;br /&gt;
# Purpose Specification Principle The purposes for which personal data are collected should be specified not later than at the time of data collection and the subsequent use limited to the fulfilment of those purposes or such others as are not incompatible with those purposes and as are specified on each occasion of change of purpose.&lt;br /&gt;
# Use Limitation Principle Personal data should not be disclosed, made available or otherwise used for purposes other than those specified. &lt;br /&gt;
# Security Safeguards Principle Personal data should be protected by reasonable security safeguards against such risks as loss or unauthorised access, destruction, use, modification or disclosure of data.&lt;br /&gt;
# Openness Principl There should be a general policy of openness about developments, practices and policies with respect to personal data. Means should be readily available of establishing the existence and nature of personal data, and the main purposes of their use, as well as the identity and usual residence of the data controller.&lt;br /&gt;
# Individual Participation Principle An individual should have the right: to obtain from a data controller, or otherwise, confirmation of whether or not the data controller has data relating to him; to have communicated to him, data relating to him&lt;br /&gt;
# Accountability Principle A data controller should be accountable for complying with measures which give effect to the principles stated above.&lt;br /&gt;
(text used from http://oecdprivacy.org/, with some omissions)&lt;br /&gt;
&lt;br /&gt;
====PETs or Privacy Enhancing Technologies===&lt;br /&gt;
[[https://www.enisa.europa.eu/topics/data-protection/privacy-enhancing-technologies PETs]&lt;br /&gt;
&lt;br /&gt;
PII = Personal Identifiable Information&lt;br /&gt;
&lt;br /&gt;
===Fair Information Practice Principles (FIPPs)===&lt;br /&gt;
As part of using digital personal data, good communication is important. The US Federal Trace Commission has some principles has the following rules :&lt;br /&gt;
# collection limitation&lt;br /&gt;
# data quality&lt;br /&gt;
## complete&lt;br /&gt;
## consistent&lt;br /&gt;
## conform&lt;br /&gt;
## accurate&lt;br /&gt;
## integer &lt;br /&gt;
## timely&lt;br /&gt;
# purpose specification&lt;br /&gt;
# use limitation&lt;br /&gt;
# security safeguards&lt;br /&gt;
## authentication uses at least a personal knowledge &lt;br /&gt;
## authentication uses at least a personal knowledge and something owned&lt;br /&gt;
## privacy sensitive data in-transit is sent encrypted, and stored encrypted on portable media&lt;br /&gt;
## services delivering privacy sensitive data is only accessible via authenticaiotn and authorization&lt;br /&gt;
## fysical access&lt;br /&gt;
## &lt;br /&gt;
# openness&lt;br /&gt;
# individal particpitation&lt;br /&gt;
# accountabulity&lt;br /&gt;
&lt;br /&gt;
===Typical Privacy Anti-patterns===&lt;br /&gt;
# Late aggregation : sub-optimal use of data by only using derived data&lt;br /&gt;
# Ask too much : using more data than is really used&lt;br /&gt;
# Keep too long : privacy sensitive data can only be held for the timespan the owner has given permission for. &lt;br /&gt;
# Scatter data : storing privacy sensitive data on several places makes it harder to keep data up to date, and clean when needed&lt;br /&gt;
# Trust all colleagues : inside a company, compartimentalization might also be needed to protect privacy.&lt;br /&gt;
&lt;br /&gt;
===External Links===&lt;br /&gt;
[[https://privacypatterns.org privacypatterns.org]]&lt;br /&gt;
[[https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=pbd-se OASIS privacy by design]]&lt;br /&gt;
[[http://oecdprivacy.org/ OECD Privacy Principles]]&lt;br /&gt;
[[https://www.enisa.europa.eu/topics/data-protection/privacy-by-design ENISA Privacy by Design]]&lt;br /&gt;
[[https://staysafeonline.org/download/document/546/the_privacy_engineers_manifesto.pdf NCSA Privacy Engineering Manifesto]]&lt;br /&gt;
[[http://shop.oreilly.com/product/0636920033714.do The Architecture of Privacy]]&lt;br /&gt;
[[http://www.privacysense.net/10-privacy-principles-of-pipeda/ FIPPS]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Anonymization&amp;diff=225076</id>
		<title>Anonymization</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Anonymization&amp;diff=225076"/>
				<updated>2017-01-15T16:22:08Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: Created page with &amp;quot;&amp;gt;&amp;gt; page in progress &amp;lt;&amp;lt;  ===Definition=== Anonyimization consists of techniques for data processing and procedures for handling the data, algorythms, keys, and lifecycle of the...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;gt;&amp;gt; page in progress &amp;lt;&amp;lt;&lt;br /&gt;
&lt;br /&gt;
===Definition===&lt;br /&gt;
Anonyimization consists of techniques for data processing and procedures for handling the data, algorythms, keys, and lifecycle of the data.&lt;br /&gt;
For privacy reasons, personal identifiable information (PII) often needs to be anonymized for testing and analysis. There are several techniques to do this :&lt;br /&gt;
&lt;br /&gt;
    Replacement - substitute identifying numbers&lt;br /&gt;
    Suppression - omit from the released data, partially or fully&lt;br /&gt;
    Generalization - for example, replace birth date with something less specific, like year of birth&lt;br /&gt;
    Perturbation - make random changes to the data&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
&lt;br /&gt;
 - masked data should be irreversible&lt;br /&gt;
 - (schema) type compliant&lt;br /&gt;
 - preservation of semantics &lt;br /&gt;
 - references in data should be kept intact&lt;br /&gt;
 - masking should be repeatable&lt;br /&gt;
 - non-sensitive data should be also anonymized if it could lead to identification &lt;br /&gt;
 - distribution preservation&lt;br /&gt;
&lt;br /&gt;
Also :&lt;br /&gt;
 - Reusable for other data sets&lt;br /&gt;
 - Transparent, so that auditors can verify that indeed the data is masked appropriately&lt;br /&gt;
&lt;br /&gt;
 ---- Referential Integrity -----&lt;br /&gt;
 ---- Semantical Integrity -------&lt;br /&gt;
 ----- Separation of Duties -----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Differential Privacy===&lt;br /&gt;
&lt;br /&gt;
==== Masking Methods ====&lt;br /&gt;
 - [https://en.wikipedia.org/wiki/Format-preserving_encryption Form Preserving Encryption (FPE)]&lt;br /&gt;
 - shuffling&lt;br /&gt;
 - encryption&lt;br /&gt;
 - substitution : replacing values by values from another source&lt;br /&gt;
&lt;br /&gt;
    Non-deterministic randomization: &lt;br /&gt;
    Blurring: &lt;br /&gt;
    Redaction: &lt;br /&gt;
    Shuffling: &lt;br /&gt;
    Averaging:&lt;br /&gt;
    Repeatable masking: &lt;br /&gt;
    Substitution: &lt;br /&gt;
    Specialized rules: These rules are for particular fields such as Social Security/tax id numbers, credit card numbers, street addresses and telephone numbers that are structurally correct and used for workflow and checksum validation. As an example, substituting 100 Wall St., New York, N.Y. for 50 Maple Lane, Newark, N.J. where each random value -- house number, street, city and state -- make up a valid address and can be found using applications like Google maps or MapQuest.&lt;br /&gt;
    Tokenization: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These techniques can be applied to :&lt;br /&gt;
 - data at rest&lt;br /&gt;
 - visible data (logs, data exports, web pages)&lt;br /&gt;
&lt;br /&gt;
== Reasons for anonymization ==&lt;br /&gt;
- &lt;br /&gt;
&lt;br /&gt;
== Open Source Tools ==&lt;br /&gt;
[http://arx.deidentifier.org/ Arx]&lt;br /&gt;
[http://jailer.sourceforge.net/ Jailer]&lt;br /&gt;
[https://mat.boum.org/ Metadata Anonymization Toolkit]&lt;br /&gt;
[https://www.talend.com/resource/data-management.html Talend Data Studio]&lt;br /&gt;
&lt;br /&gt;
== Related terms ==&lt;br /&gt;
Pseudonymization&lt;br /&gt;
De-Identification&lt;br /&gt;
Scrubbing&lt;br /&gt;
Data Sanitization&lt;br /&gt;
Data scrambling&lt;br /&gt;
Data masking&lt;br /&gt;
Form preserving encryption (FPE)&lt;br /&gt;
De-anonymization&lt;br /&gt;
&lt;br /&gt;
[http://www.datamasker.com/DataMasking_WhatYouNeedToKnow.pdf Data Masking: What you need to know]&lt;br /&gt;
[https://en.wikipedia.org/wiki/K-anonymity k-anonymity k-anonymity]&lt;br /&gt;
SDC&lt;br /&gt;
l-diversity&lt;br /&gt;
&lt;br /&gt;
[http://www.odbms.org/2014/03/complete-book-data-anonymization-planning-implementation/ The Complete Book of Data Anonymization]&lt;br /&gt;
[http://www.crcnetbase.com/action/doSearch?displaySummary=true&amp;amp;access=&amp;amp;join_AllField=AND&amp;amp;AllField=&amp;amp;join_Title=AND&amp;amp;Title=anonymization&amp;amp;join_Contrib=AND&amp;amp;Contrib=&amp;amp;join_PubIdSpan=AND&amp;amp;PubIdSpan=&amp;amp;AfterYear=&amp;amp;BeforeYear= The Complete Book of Data Anonymization (pdf download per chapter]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225065</id>
		<title>Privacy by Design</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225065"/>
				<updated>2017-01-15T14:54:54Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*UNDER CONSTRUCTION*&lt;br /&gt;
&lt;br /&gt;
Privacy by Design (PbD) is the practice of protecting privacy by means of processes, communication and technical measures as part of the software engineering design. This area is sitll young and there are several organisations that have their own set of privacy prinsiples.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
===7 Fundamental principles in Privacy by Design by Ann Cavoukian===&lt;br /&gt;
# Proactive not reactive; Preventative not remedial&lt;br /&gt;
# Privacy as the default setting&lt;br /&gt;
# Privacy embedded into design&lt;br /&gt;
# Full functionality – positive-sum, not zero-sum&lt;br /&gt;
# End-to-end security – full lifecycle protection&lt;br /&gt;
# Visibility and transparency – keep it open&lt;br /&gt;
# Respect for user privacy – keep it user-centric&lt;br /&gt;
&lt;br /&gt;
See also : [[https://www.iab.org/wp-content/IAB-uploads/2011/03/fred_carter.pdf|7 Principles of Privacy by Design]]&lt;br /&gt;
These are rather high level, principles. Let's try to make them concrete :&lt;br /&gt;
&lt;br /&gt;
#  Proactive not reactive; Preventative not remedial. For instance, anonymization of test data&lt;br /&gt;
#  Privacy as the default setting. People using processes and frameworks protect privacy by default, no additional actions should be needed. As a counter example : Windows 10 has privacy settings that consumers have to enable, the settings violate privacy by default.&lt;br /&gt;
#  Privacy embedded into design. TBD&lt;br /&gt;
#  Full functionality – positive-sum, not zero-sum. TBD&lt;br /&gt;
#  End-to-end security – full lifecycle protection. TBD&lt;br /&gt;
#  Visibility and transparency – keep it open. TBD&lt;br /&gt;
#  Respect for user privacy – keep it user-centric. TBD&lt;br /&gt;
&lt;br /&gt;
===OECD Privacy Principles===&lt;br /&gt;
#Collection Limitation Principle&lt;br /&gt;
  There should be limits to the collection of personal data and any such data should be obtained by lawful and fair means and, where appropriate, with the knowledge or consent of the data subject.&lt;br /&gt;
&lt;br /&gt;
# Data Quality Principle&lt;br /&gt;
    Personal data should be relevant to the purposes for which they are to be used, and, to the extent necessary for those purposes, should be accurate, complete and kept up-to-date.&lt;br /&gt;
&lt;br /&gt;
# Purpose Specification Principle&lt;br /&gt;
    The purposes for which personal data are collected should be specified not later than at the time of data collection and the subsequent use limited to the fulfilment of those purposes or such others as are not incompatible with those purposes and as are specified on each occasion of change of purpose.&lt;br /&gt;
&lt;br /&gt;
# Use Limitation Principle&lt;br /&gt;
    Personal data should not be disclosed, made available or otherwise used for purposes other than those specified. &lt;br /&gt;
&lt;br /&gt;
# Security Safeguards Principle&lt;br /&gt;
    Personal data should be protected by reasonable security safeguards against such risks as loss or unauthorised access, destruction, use, modification or disclosure of data.&lt;br /&gt;
&lt;br /&gt;
# Openness Principle&lt;br /&gt;
    There should be a general policy of openness about developments, practices and policies with respect to personal data. Means should be readily available of establishing the existence and nature of personal data, and the main purposes of their use, as well as the identity and usual residence of the data controller.&lt;br /&gt;
&lt;br /&gt;
# Individual Participation Principle&lt;br /&gt;
    An individual should have the right: to obtain from a data controller, or otherwise, confirmation of whether or not the data controller has data relating to him; to have communicated to him, data relating to him&lt;br /&gt;
&lt;br /&gt;
# Accountability Principle&lt;br /&gt;
    A data controller should be accountable for complying with measures which give effect to the principles stated above.&lt;br /&gt;
&lt;br /&gt;
PET = Privacy Enhancing Technologies&lt;br /&gt;
&lt;br /&gt;
PIA = Privacy Impact Assessment &lt;br /&gt;
&lt;br /&gt;
PII = Personal Identifiable Information&lt;br /&gt;
&lt;br /&gt;
FIPPS = Fair Information Practice Principles&lt;br /&gt;
# collection limitation&lt;br /&gt;
# data quality&lt;br /&gt;
## complete&lt;br /&gt;
## consistent&lt;br /&gt;
## conform&lt;br /&gt;
## accurate&lt;br /&gt;
## integer &lt;br /&gt;
## timely&lt;br /&gt;
# purpose specification&lt;br /&gt;
# use limitation&lt;br /&gt;
# security safeguards&lt;br /&gt;
## authentication uses at least a personal knowledge &lt;br /&gt;
## authentication uses at least a personal knowledge and something owned&lt;br /&gt;
## privacy sensitive data in-transit is sent encrypted, and stored encrypted on portable media&lt;br /&gt;
## services delivering privacy sensitive data is only accessible via authenticaiotn and authorization&lt;br /&gt;
## fysical access&lt;br /&gt;
## &lt;br /&gt;
# openness&lt;br /&gt;
# individal particpitation&lt;br /&gt;
# accountabulity&lt;br /&gt;
&lt;br /&gt;
===Typical Privacy Anti-patterns===&lt;br /&gt;
# Late aggregation : sub-optimal use of data by only using derived data&lt;br /&gt;
# Ask too much : using more data than is really used&lt;br /&gt;
# Keep too long : privacy sensitive data can only be held for the timespan the owner has given permission for. &lt;br /&gt;
# Scatter data : storing privacy sensitive data on several places makes it harder to keep data up to date, and clean when needed&lt;br /&gt;
# Trust all colleagues : inside a company, compartimentalization might also be needed to protect privacy.&lt;br /&gt;
&lt;br /&gt;
===External Links===&lt;br /&gt;
[[https://privacypatterns.org privacypatterns.org]]&lt;br /&gt;
[[https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=pbd-se OASIS privacy by design]]&lt;br /&gt;
[[http://oecdprivacy.org/ OECD Privacy Principles]]&lt;br /&gt;
[[https://www.enisa.europa.eu/topics/data-protection/privacy-by-design ENISA Privacy by Design]]&lt;br /&gt;
[[https://staysafeonline.org/download/document/546/the_privacy_engineers_manifesto.pdf NCSA Privacy Engineering Manifesto]]&lt;br /&gt;
[[http://shop.oreilly.com/product/0636920033714.do The Architecture of Privacy]]&lt;br /&gt;
[[http://www.privacysense.net/10-privacy-principles-of-pipeda/ FIPPS]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225064</id>
		<title>Privacy by Design</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225064"/>
				<updated>2017-01-15T12:19:38Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*UNDER CONSTRUCTION*&lt;br /&gt;
&lt;br /&gt;
Privacy by Design (PbD) is the practice of protecting privacy by means of processes, communication and technical measures as part of the software engineering design. This area is sitll young and there are several organisations that have their own set of privacy prinsiples.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
===7 Fundamental principles in Privacy by Design by Ann Cavoukian===&lt;br /&gt;
# Proactive not reactive; Preventative not remedial&lt;br /&gt;
# Privacy as the default setting&lt;br /&gt;
# Privacy embedded into design&lt;br /&gt;
# Full functionality – positive-sum, not zero-sum&lt;br /&gt;
# End-to-end security – full lifecycle protection&lt;br /&gt;
# Visibility and transparency – keep it open&lt;br /&gt;
# Respect for user privacy – keep it user-centric&lt;br /&gt;
&lt;br /&gt;
See also : [[https://www.iab.org/wp-content/IAB-uploads/2011/03/fred_carter.pdf|7 Principles of Privacy by Design]]&lt;br /&gt;
These are rather high level, principles. Let's try to make them concrete :&lt;br /&gt;
&lt;br /&gt;
#  Proactive not reactive; Preventative not remedial. For instance, anonymization of test data&lt;br /&gt;
#  Privacy as the default setting. People using processes and frameworks protect privacy by default, no additional actions should be needed. As a counter example : Windows 10 has privacy settings that consumers have to enable, the settings violate privacy by default.&lt;br /&gt;
#  Privacy embedded into design. TBD&lt;br /&gt;
#  Full functionality – positive-sum, not zero-sum. TBD&lt;br /&gt;
#  End-to-end security – full lifecycle protection. TBD&lt;br /&gt;
#  Visibility and transparency – keep it open. TBD&lt;br /&gt;
#  Respect for user privacy – keep it user-centric. TBD&lt;br /&gt;
&lt;br /&gt;
===OECD Privacy Principles===&lt;br /&gt;
#Collection Limitation Principle&lt;br /&gt;
  There should be limits to the collection of personal data and any such data should be obtained by lawful and fair means and, where appropriate, with the knowledge or consent of the data subject.&lt;br /&gt;
&lt;br /&gt;
# Data Quality Principle&lt;br /&gt;
    Personal data should be relevant to the purposes for which they are to be used, and, to the extent necessary for those purposes, should be accurate, complete and kept up-to-date.&lt;br /&gt;
&lt;br /&gt;
# Purpose Specification Principle&lt;br /&gt;
    The purposes for which personal data are collected should be specified not later than at the time of data collection and the subsequent use limited to the fulfilment of those purposes or such others as are not incompatible with those purposes and as are specified on each occasion of change of purpose.&lt;br /&gt;
&lt;br /&gt;
# Use Limitation Principle&lt;br /&gt;
    Personal data should not be disclosed, made available or otherwise used for purposes other than those specified. &lt;br /&gt;
&lt;br /&gt;
# Security Safeguards Principle&lt;br /&gt;
    Personal data should be protected by reasonable security safeguards against such risks as loss or unauthorised access, destruction, use, modification or disclosure of data.&lt;br /&gt;
&lt;br /&gt;
# Openness Principle&lt;br /&gt;
    There should be a general policy of openness about developments, practices and policies with respect to personal data. Means should be readily available of establishing the existence and nature of personal data, and the main purposes of their use, as well as the identity and usual residence of the data controller.&lt;br /&gt;
&lt;br /&gt;
# Individual Participation Principle&lt;br /&gt;
    An individual should have the right: to obtain from a data controller, or otherwise, confirmation of whether or not the data controller has data relating to him; to have communicated to him, data relating to him&lt;br /&gt;
&lt;br /&gt;
# Accountability Principle&lt;br /&gt;
    A data controller should be accountable for complying with measures which give effect to the principles stated above.&lt;br /&gt;
&lt;br /&gt;
PET = Privacy Enhancing Technologies&lt;br /&gt;
&lt;br /&gt;
PIA = Privacy Impact Assessment &lt;br /&gt;
&lt;br /&gt;
PII = Personal Identifiable Information&lt;br /&gt;
&lt;br /&gt;
FIPPS = Fair Information Practice Principles&lt;br /&gt;
# collection limitation&lt;br /&gt;
# data quality&lt;br /&gt;
# purpose specification&lt;br /&gt;
# use limitaion&lt;br /&gt;
# security&lt;br /&gt;
# openness&lt;br /&gt;
# individal particpitation&lt;br /&gt;
# accountabulity&lt;br /&gt;
&lt;br /&gt;
===Typical Privacy Anti-patterns===&lt;br /&gt;
# Late aggregation : sub-optimal use of data by only using derived data&lt;br /&gt;
# Ask too much : using more data than is really used&lt;br /&gt;
# Keep too long : privacy sensitive data can only be held for the timespan the owner has given permission for. &lt;br /&gt;
# Scatter data : storing privacy sensitive data on several places makes it harder to keep data up to date, and clean when needed&lt;br /&gt;
# Trust all colleagues : inside a company, compartimentalization might also be needed to protect privacy.&lt;br /&gt;
&lt;br /&gt;
===External Links===&lt;br /&gt;
[[https://privacypatterns.org privacypatterns.org]]&lt;br /&gt;
[[https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=pbd-se OASIS privacy by design]]&lt;br /&gt;
[[http://oecdprivacy.org/ OECD Privacy Principles]]&lt;br /&gt;
[[https://www.enisa.europa.eu/topics/data-protection/privacy-by-design ENISA Privacy by Design]]&lt;br /&gt;
[[https://staysafeonline.org/download/document/546/the_privacy_engineers_manifesto.pdf NCSA Privacy Engineering Manifesto]]&lt;br /&gt;
[[http://shop.oreilly.com/product/0636920033714.do The Architecture of Privacy]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225061</id>
		<title>Privacy by Design</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225061"/>
				<updated>2017-01-14T21:41:54Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*UNDER CONSTRUCTION*&lt;br /&gt;
&lt;br /&gt;
Privacy by Design (PbD) is the practice of protecting privacy by means of processes, communication and technical measures as part of the software engineering design. This area is sitll young and there are several organisations that have their own set of privacy prinsiples.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
===7 Fundamental principles in Privacy by Design by Ann Cavoukian===&lt;br /&gt;
# Proactive not reactive; Preventative not remedial&lt;br /&gt;
# Privacy as the default setting&lt;br /&gt;
# Privacy embedded into design&lt;br /&gt;
# Full functionality – positive-sum, not zero-sum&lt;br /&gt;
# End-to-end security – full lifecycle protection&lt;br /&gt;
# Visibility and transparency – keep it open&lt;br /&gt;
# Respect for user privacy – keep it user-centric&lt;br /&gt;
&lt;br /&gt;
See also : [[https://www.iab.org/wp-content/IAB-uploads/2011/03/fred_carter.pdf|7 Principles of Privacy by Design]]&lt;br /&gt;
These are rather high level, principles. Let's try to make them concrete :&lt;br /&gt;
&lt;br /&gt;
#  Proactive not reactive; Preventative not remedial. For instance, anonymization of test data&lt;br /&gt;
#  Privacy as the default setting. People using processes and frameworks protect privacy by default, no additional actions should be needed. As a counter example : Windows 10 has privacy settings that consumers have to enable, the settings violate privacy by default.&lt;br /&gt;
#  Privacy embedded into design. TBD&lt;br /&gt;
#  Full functionality – positive-sum, not zero-sum. TBD&lt;br /&gt;
#  End-to-end security – full lifecycle protection. TBD&lt;br /&gt;
#  Visibility and transparency – keep it open. TBD&lt;br /&gt;
#  Respect for user privacy – keep it user-centric. TBD&lt;br /&gt;
&lt;br /&gt;
===OECD Privacy Principles===&lt;br /&gt;
#Collection Limitation Principle&lt;br /&gt;
  There should be limits to the collection of personal data and any such data should be obtained by lawful and fair means and, where appropriate, with the knowledge or consent of the data subject.&lt;br /&gt;
&lt;br /&gt;
# Data Quality Principle&lt;br /&gt;
    Personal data should be relevant to the purposes for which they are to be used, and, to the extent necessary for those purposes, should be accurate, complete and kept up-to-date.&lt;br /&gt;
&lt;br /&gt;
# Purpose Specification Principle&lt;br /&gt;
    The purposes for which personal data are collected should be specified not later than at the time of data collection and the subsequent use limited to the fulfilment of those purposes or such others as are not incompatible with those purposes and as are specified on each occasion of change of purpose.&lt;br /&gt;
&lt;br /&gt;
# Use Limitation Principle&lt;br /&gt;
    Personal data should not be disclosed, made available or otherwise used for purposes other than those specified. &lt;br /&gt;
&lt;br /&gt;
# Security Safeguards Principle&lt;br /&gt;
    Personal data should be protected by reasonable security safeguards against such risks as loss or unauthorised access, destruction, use, modification or disclosure of data.&lt;br /&gt;
&lt;br /&gt;
# Openness Principle&lt;br /&gt;
    There should be a general policy of openness about developments, practices and policies with respect to personal data. Means should be readily available of establishing the existence and nature of personal data, and the main purposes of their use, as well as the identity and usual residence of the data controller.&lt;br /&gt;
&lt;br /&gt;
# Individual Participation Principle&lt;br /&gt;
    An individual should have the right: to obtain from a data controller, or otherwise, confirmation of whether or not the data controller has data relating to him; to have communicated to him, data relating to him&lt;br /&gt;
&lt;br /&gt;
# Accountability Principle&lt;br /&gt;
    A data controller should be accountable for complying with measures which give effect to the principles stated above.&lt;br /&gt;
&lt;br /&gt;
PET = Privacy Enhancing Technologies&lt;br /&gt;
&lt;br /&gt;
PIA = Privacy Impact Assessment &lt;br /&gt;
&lt;br /&gt;
PII = Personal Identifiable Information&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Typical Privacy Anti-patterns===&lt;br /&gt;
# Late aggregation : sub-optimal use of data by only using derived data&lt;br /&gt;
# Ask too much : using more data than is really used&lt;br /&gt;
# Keep too long : privacy sensitive data can only be held for the timespan the owner has given permission for. &lt;br /&gt;
# Scatter data : storing privacy sensitive data on several places makes it harder to keep data up to date, and clean when needed&lt;br /&gt;
# Trust all colleagues : inside a company, compartimentalization might also be needed to protect privacy.&lt;br /&gt;
&lt;br /&gt;
===External Links===&lt;br /&gt;
[[https://privacypatterns.org privacypatterns.org]]&lt;br /&gt;
[[https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=pbd-se OASIS privacy by design]]&lt;br /&gt;
[[http://oecdprivacy.org/ OECD Privacy Principles]]&lt;br /&gt;
[[https://www.enisa.europa.eu/topics/data-protection/privacy-by-design ENISA Privacy by Design]]&lt;br /&gt;
[[https://staysafeonline.org/download/document/546/the_privacy_engineers_manifesto.pdf NCSA Privacy Engineering Manifesto]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225060</id>
		<title>Privacy by Design</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225060"/>
				<updated>2017-01-14T20:30:30Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*UNDER CONSTRUCTION*&lt;br /&gt;
&lt;br /&gt;
Privacy by Design (PbD) is the practice of protecting privacy by means of processes, communication and technical measures as part of the software engineering design.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
===7 Fundamental principles in Privacy by Design by Ann Cavoukian===&lt;br /&gt;
# Proactive not reactive; Preventative not remedial&lt;br /&gt;
# Privacy as the default setting&lt;br /&gt;
# Privacy embedded into design&lt;br /&gt;
# Full functionality – positive-sum, not zero-sum&lt;br /&gt;
# End-to-end security – full lifecycle protection&lt;br /&gt;
# Visibility and transparency – keep it open&lt;br /&gt;
# Respect for user privacy – keep it user-centric&lt;br /&gt;
&lt;br /&gt;
See also : [[https://www.iab.org/wp-content/IAB-uploads/2011/03/fred_carter.pdf|7 Principles of Privacy by Design]]&lt;br /&gt;
These are rather high level, principles. Let's try to make them concrete :&lt;br /&gt;
&lt;br /&gt;
#  Proactive not reactive; Preventative not remedial. For instance, anonymization of test data&lt;br /&gt;
#  Privacy as the default setting. People using processes and frameworks protect privacy by default, no additional actions should be needed. As a counter example : Windows 10 has privacy settings that consumers have to enable, the settings violate privacy by default.&lt;br /&gt;
#  Privacy embedded into design. TBD&lt;br /&gt;
#  Full functionality – positive-sum, not zero-sum. TBD&lt;br /&gt;
#  End-to-end security – full lifecycle protection. TBD&lt;br /&gt;
#  Visibility and transparency – keep it open. TBD&lt;br /&gt;
#  Respect for user privacy – keep it user-centric. TBD&lt;br /&gt;
&lt;br /&gt;
===OECD Privacy Principles===&lt;br /&gt;
#Collection Limitation Principle&lt;br /&gt;
  There should be limits to the collection of personal data and any such data should be obtained by lawful and fair means and, where appropriate, with the knowledge or consent of the data subject.&lt;br /&gt;
&lt;br /&gt;
# Data Quality Principle&lt;br /&gt;
    Personal data should be relevant to the purposes for which they are to be used, and, to the extent necessary for those purposes, should be accurate, complete and kept up-to-date.&lt;br /&gt;
&lt;br /&gt;
# Purpose Specification Principle&lt;br /&gt;
    The purposes for which personal data are collected should be specified not later than at the time of data collection and the subsequent use limited to the fulfilment of those purposes or such others as are not incompatible with those purposes and as are specified on each occasion of change of purpose.&lt;br /&gt;
&lt;br /&gt;
# Use Limitation Principle&lt;br /&gt;
    Personal data should not be disclosed, made available or otherwise used for purposes other than those specified. &lt;br /&gt;
&lt;br /&gt;
# Security Safeguards Principle&lt;br /&gt;
    Personal data should be protected by reasonable security safeguards against such risks as loss or unauthorised access, destruction, use, modification or disclosure of data.&lt;br /&gt;
&lt;br /&gt;
# Openness Principle&lt;br /&gt;
    There should be a general policy of openness about developments, practices and policies with respect to personal data. Means should be readily available of establishing the existence and nature of personal data, and the main purposes of their use, as well as the identity and usual residence of the data controller.&lt;br /&gt;
&lt;br /&gt;
# Individual Participation Principle&lt;br /&gt;
    An individual should have the right: to obtain from a data controller, or otherwise, confirmation of whether or not the data controller has data relating to him; to have communicated to him, data relating to him&lt;br /&gt;
&lt;br /&gt;
# Accountability Principle&lt;br /&gt;
    A data controller should be accountable for complying with measures which give effect to the principles stated above.&lt;br /&gt;
&lt;br /&gt;
PET = Privacy Enhancing Technologies&lt;br /&gt;
&lt;br /&gt;
PIA = Privacy Impact Assessment &lt;br /&gt;
&lt;br /&gt;
PII = Personal Identifiable Information&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Typical Privacy Anti-patterns===&lt;br /&gt;
# Late aggregation : sub-optimal use of data by only using derived data&lt;br /&gt;
# Ask too much : using more data than is really used&lt;br /&gt;
# Keep too long : privacy sensitive data can only be held for the timespan the owner has given permission for. &lt;br /&gt;
# Scatter data : storing privacy sensitive data on several places makes it harder to keep data up to date, and clean when needed&lt;br /&gt;
# Trust all colleagues : inside a company, compartimentalization might also be needed to protect privacy.&lt;br /&gt;
&lt;br /&gt;
===External Links===&lt;br /&gt;
[[https://privacypatterns.org privacypatterns.org]]&lt;br /&gt;
[[https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=pbd-se OASIS privacy by design]]&lt;br /&gt;
[[http://oecdprivacy.org/ OECD Privacy Principles]]&lt;br /&gt;
[[https://www.enisa.europa.eu/topics/data-protection/privacy-by-design ENISA Privacy by Design]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225059</id>
		<title>Privacy by Design</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225059"/>
				<updated>2017-01-14T20:14:00Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*UNDER CONSTRUCTION*&lt;br /&gt;
&lt;br /&gt;
Privacy by Design (PbD) is the practice of protecting privacy by means of processes, communication and technical measures as part of the software engineering design.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
===7 Fundamental principles in Privacy by Design by Ann Cavoukian===&lt;br /&gt;
# Proactive not reactive; Preventative not remedial&lt;br /&gt;
# Privacy as the default setting&lt;br /&gt;
# Privacy embedded into design&lt;br /&gt;
# Full functionality – positive-sum, not zero-sum&lt;br /&gt;
# End-to-end security – full lifecycle protection&lt;br /&gt;
# Visibility and transparency – keep it open&lt;br /&gt;
# Respect for user privacy – keep it user-centric&lt;br /&gt;
&lt;br /&gt;
See also : [[https://www.iab.org/wp-content/IAB-uploads/2011/03/fred_carter.pdf|7 Principles of Privacy by Design]]&lt;br /&gt;
These are rather high level, principles. Let's try to make them concrete :&lt;br /&gt;
&lt;br /&gt;
#  Proactive not reactive; Preventative not remedial. For instance, anonymization of test data&lt;br /&gt;
#  Privacy as the default setting. People using processes and frameworks protect privacy by default, no additional actions should be needed. As a counter example : Windows 10 has privacy settings that consumers have to enable, the settings violate privacy by default.&lt;br /&gt;
#  Privacy embedded into design. TBD&lt;br /&gt;
#  Full functionality – positive-sum, not zero-sum. TBD&lt;br /&gt;
#  End-to-end security – full lifecycle protection. TBD&lt;br /&gt;
#  Visibility and transparency – keep it open. TBD&lt;br /&gt;
#  Respect for user privacy – keep it user-centric. TBD&lt;br /&gt;
&lt;br /&gt;
===OECD Privacy Principles===&lt;br /&gt;
#Collection Limitation Principle&lt;br /&gt;
  There should be limits to the collection of personal data and any such data should be obtained by lawful and fair means and, where appropriate, with the knowledge or consent of the data subject.&lt;br /&gt;
&lt;br /&gt;
# Data Quality Principle&lt;br /&gt;
    Personal data should be relevant to the purposes for which they are to be used, and, to the extent necessary for those purposes, should be accurate, complete and kept up-to-date.&lt;br /&gt;
&lt;br /&gt;
# Purpose Specification Principle&lt;br /&gt;
    The purposes for which personal data are collected should be specified not later than at the time of data collection and the subsequent use limited to the fulfilment of those purposes or such others as are not incompatible with those purposes and as are specified on each occasion of change of purpose.&lt;br /&gt;
&lt;br /&gt;
# Use Limitation Principle&lt;br /&gt;
    Personal data should not be disclosed, made available or otherwise used for purposes other than those specified. &lt;br /&gt;
&lt;br /&gt;
# Security Safeguards Principle&lt;br /&gt;
    Personal data should be protected by reasonable security safeguards against such risks as loss or unauthorised access, destruction, use, modification or disclosure of data.&lt;br /&gt;
&lt;br /&gt;
# Openness Principle&lt;br /&gt;
    There should be a general policy of openness about developments, practices and policies with respect to personal data. Means should be readily available of establishing the existence and nature of personal data, and the main purposes of their use, as well as the identity and usual residence of the data controller.&lt;br /&gt;
&lt;br /&gt;
# Individual Participation Principle&lt;br /&gt;
    An individual should have the right: to obtain from a data controller, or otherwise, confirmation of whether or not the data controller has data relating to him; to have communicated to him, data relating to him&lt;br /&gt;
&lt;br /&gt;
# Accountability Principle&lt;br /&gt;
    A data controller should be accountable for complying with measures which give effect to the principles stated above.&lt;br /&gt;
&lt;br /&gt;
PET = Privacy Enhancing Technologies&lt;br /&gt;
&lt;br /&gt;
PIA = Privacy Impact Assessment &lt;br /&gt;
&lt;br /&gt;
PII = Personal Identifiable Information&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Typical Privacy Anti-patterns===&lt;br /&gt;
# Late aggregation : sub-optimal use of data by only using derived data&lt;br /&gt;
# Ask too much : using more data than is really used&lt;br /&gt;
# Keep too long : privacy sensitive data can only be held for the timespan the owner has given permission for. &lt;br /&gt;
# Scatter data : storing privacy sensitive data on several places makes it harder to keep data up to date, and clean when needed&lt;br /&gt;
# Trust all colleagues : inside a company, compartimentalization might also be needed to protect privacy.&lt;br /&gt;
&lt;br /&gt;
===External Links===&lt;br /&gt;
[[https://privacypatterns.org privacypatterns.org]]&lt;br /&gt;
[[https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=pbd-se OASIS privacy by design]]&lt;br /&gt;
[[http://oecdprivacy.org/ OECD Privacy Principles]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225058</id>
		<title>Privacy by Design</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Privacy_by_Design&amp;diff=225058"/>
				<updated>2017-01-14T19:40:41Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: Created page with &amp;quot;*UNDER CONSTRUCTION*  Privacy by Design (PbD) is the practice of protecting privacy by means of processes, communication and technical measures as part of the software enginee...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*UNDER CONSTRUCTION*&lt;br /&gt;
&lt;br /&gt;
Privacy by Design (PbD) is the practice of protecting privacy by means of processes, communication and technical measures as part of the software engineering design.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===7 Fundamental principles in Privacy by Design===&lt;br /&gt;
# Proactive not reactive; Preventative not remedial&lt;br /&gt;
# Privacy as the default setting&lt;br /&gt;
# Privacy embedded into design&lt;br /&gt;
# Full functionality – positive-sum, not zero-sum&lt;br /&gt;
# End-to-end security – full lifecycle protection&lt;br /&gt;
# Visibility and transparency – keep it open&lt;br /&gt;
# Respect for user privacy – keep it user-centric&lt;br /&gt;
&lt;br /&gt;
See also : [[https://www.iab.org/wp-content/IAB-uploads/2011/03/fred_carter.pdf|7 Principles of Privacy by Design]]&lt;br /&gt;
These are rather high level, principles. Let's try to make them concrete :&lt;br /&gt;
&lt;br /&gt;
#  Proactive not reactive; Preventative not remedial. For instance, anonymization of test data&lt;br /&gt;
#  Privacy as the default setting. People using processes and frameworks protect privacy by default, no additional actions should be needed. As a counter example : Windows 10 has privacy settings that consumers have to enable, the settings violate privacy by default.&lt;br /&gt;
#  Privacy embedded into design. TBD&lt;br /&gt;
#  Full functionality – positive-sum, not zero-sum. TBD&lt;br /&gt;
#  End-to-end security – full lifecycle protection. TBD&lt;br /&gt;
#  Visibility and transparency – keep it open. TBD&lt;br /&gt;
#  Respect for user privacy – keep it user-centric. TBD&lt;br /&gt;
&lt;br /&gt;
PET = Privacy Enhancing Technologies&lt;br /&gt;
&lt;br /&gt;
PIA = Privacy Impact Assessment &lt;br /&gt;
&lt;br /&gt;
PII = Personal Identifiable Information&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Typical Privacy Anti-patterns===&lt;br /&gt;
# Late aggregation : sub-optimal use of data by only using derived data&lt;br /&gt;
# Ask too much : using more data than is really used&lt;br /&gt;
# Keep too long : privacy sensitive data can only be held for the timespan the owner has given permission for. &lt;br /&gt;
# Scatter data : storing privacy sensitive data on several places makes it harder to keep data up to date, and clean when needed&lt;br /&gt;
# Trust all colleagues : inside a company, compartimentalization might also be needed to protect privacy.&lt;br /&gt;
&lt;br /&gt;
===External Links===&lt;br /&gt;
[[privacypatterns.org|https://privacypatterns.org]]&lt;br /&gt;
[[oasis privacy by design|https://www.oasis-open.org/committees/tc_home.php?wg_abbrev=pbd-se]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Secure_Coding_Principles&amp;diff=220011</id>
		<title>Talk:Secure Coding Principles</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Secure_Coding_Principles&amp;diff=220011"/>
				<updated>2016-08-03T18:35:54Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: Sytzevk moved page Talk:Secure Coding Principles to Talk:Security by Design Principles: misnomer; this is about design, not about coding&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Talk:Security by Design Principles]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Secure_Coding_Principles&amp;diff=220009</id>
		<title>Secure Coding Principles</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Secure_Coding_Principles&amp;diff=220009"/>
				<updated>2016-08-03T18:35:54Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: Sytzevk moved page Secure Coding Principles to Security by Design Principles: misnomer; this is about design, not about coding&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Security by Design Principles]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Security_by_Design_Principles&amp;diff=220010</id>
		<title>Talk:Security by Design Principles</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Security_by_Design_Principles&amp;diff=220010"/>
				<updated>2016-08-03T18:35:54Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: Sytzevk moved page Talk:Secure Coding Principles to Talk:Security by Design Principles: misnomer; this is about design, not about coding&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I suggest we reference the articles in the [[:Category:Principle|Principles Category]] here. [[User:Jeff Williams|Jeff Williams]] 12:13, 14 June 2006 (EDT)&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Security_by_Design_Principles&amp;diff=220008</id>
		<title>Security by Design Principles</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Security_by_Design_Principles&amp;diff=220008"/>
				<updated>2016-08-03T18:35:54Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: Sytzevk moved page Secure Coding Principles to Security by Design Principles: misnomer; this is about design, not about coding&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Guide Table of Contents|Development Guide Table of Contents]]&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
Architects and solution providers need guidance to produce secure applications by design, and they can do this by not only implementing the basic controls documented in the main text, but also referring back to the underlying “Why?” in these principles. Security principles such as confidentiality, integrity, and availability – although important, broad, and vague – do not change. Your application will be the more robust the more you apply them.&lt;br /&gt;
&lt;br /&gt;
For example, it is a fine thing when implementing data validation to include a centralized validation routine for all form input. However, it is a far finer thing to see validation at each tier for all user input, coupled with appropriate error handling and robust access control. &lt;br /&gt;
&lt;br /&gt;
In the last year or so, there has been a significant push to standardize terminology and taxonomy. This version of the Development Guide has normalized its principles with those from major industry texts, while dropping a principle or two present in the first edition of the Development Guide. This is to prevent confusion and to increase compliance with a core set of principles. The principles that have been removed are adequately covered by controls within the text. &lt;br /&gt;
&lt;br /&gt;
==Asset classification ==&lt;br /&gt;
&lt;br /&gt;
Selection of controls is only possible after classifying the data to be protected. For example, controls applicable to low value systems such as blogs and forums are different to the level and number of controls suitable for accounting, high value banking, and electronic trading systems.&lt;br /&gt;
&lt;br /&gt;
==About attackers ==&lt;br /&gt;
&lt;br /&gt;
When designing controls to prevent misuse of your application, you must consider the most likely attackers (in order of likelihood and actualized loss from most to least):&lt;br /&gt;
&lt;br /&gt;
* Disgruntled staff or developers&lt;br /&gt;
&lt;br /&gt;
* “Drive by” attacks, such as side effects or direct consequences of a virus, worm, or Trojan attack&lt;br /&gt;
&lt;br /&gt;
* Motivated criminal attackers, such as organized crime &lt;br /&gt;
&lt;br /&gt;
* Criminal attackers without motive against your organization, such as defacers &lt;br /&gt;
&lt;br /&gt;
* Script kiddies&lt;br /&gt;
[[Category:FIXME|this link doesn't go to anything, we either need to remove the link or add the content this is to link to. I removed the brackets from Script kiddies]]&lt;br /&gt;
&lt;br /&gt;
Notice there is no entry for the term “hacker.” This is due to the emotive and incorrect use of the word “hacker” by the media. However, it is far too late to reclaim the incorrect use of the word “hacker” and try to return the word to its correct roots. The Development Guide consistently uses the word “attacker” when denoting something or someone who is actively attempting to exploit a particular feature.&lt;br /&gt;
&lt;br /&gt;
==Core pillars of information security ==&lt;br /&gt;
&lt;br /&gt;
Information security has relied upon the following pillars:&lt;br /&gt;
&lt;br /&gt;
* [[:Category:Confidentiality|Confidentiality]] – only allow access to data for which the user is permitted &lt;br /&gt;
* [[:Category:Integrity|Integrity]] – ensure data is not tampered or altered by unauthorized users&lt;br /&gt;
* [[:Category:Availability|Availability]] – ensure systems and data are available to authorized users when they need it&lt;br /&gt;
&lt;br /&gt;
The following principles are all related to these three pillars. Indeed, when considering how to construct a control, considering each pillar in turn will assist in producing a robust security control.&lt;br /&gt;
&lt;br /&gt;
==Security architecture ==&lt;br /&gt;
&lt;br /&gt;
Applications without security architecture are as bridges constructed without finite element analysis and wind tunnel testing. Sure, they look like bridges, but they will fall down at the first flutter of a butterfly’s wings. The need for application security in the form of security architecture is every bit as great as in building or bridge construction.&lt;br /&gt;
&lt;br /&gt;
Application architects are responsible for constructing their design to adequately cover risks from both typical usage, and from extreme attack. Bridge designers need to cope with a certain amount of cars and foot traffic but also cyclonic winds, earthquake, fire, traffic incidents, and flooding. Application designers must cope with extreme events, such as brute force or injection attacks, and fraud. The risks for application designers are well known. The days of “we didn’t know” are long gone. Security is now expected, not an expensive add-on or simply left out.&lt;br /&gt;
&lt;br /&gt;
Security architecture refers to the fundamental pillars: the application must provide controls to protect the confidentiality of information, integrity of data, and provide access to the data when it is required (availability) – and only to the right users. Security architecture is not “markitecture”, where a cornucopia of security products are tossed together and called a “solution”, but a carefully considered set of features, controls, safer processes, and default security posture. &lt;br /&gt;
&lt;br /&gt;
When starting a new application or re-factoring an existing application, you should consider each functional feature, and consider:&lt;br /&gt;
&lt;br /&gt;
* Is the process surrounding this feature as safe as possible? In other words, is this a flawed process?&lt;br /&gt;
* If I were evil, how would I abuse this feature?&lt;br /&gt;
* Is the feature required to be on by default? If so, are there limits or options that could help reduce the risk from this feature?&lt;br /&gt;
&lt;br /&gt;
Andrew van der Stock calls the above process “Thinking Evil™”, and recommends putting yourself in the shoes of the attacker and thinking through all the possible ways you can abuse each and every feature, by considering the three core pillars and using the STRIDE model in turn.&lt;br /&gt;
&lt;br /&gt;
By following this guide, and using the STRIDE / DREAD threat risk modeling discussed here and in Howard and LeBlanc’s book, you will be well on your way to formally adopting a security architecture for your applications. &lt;br /&gt;
&lt;br /&gt;
The best system architecture designs and detailed design documents contain security discussion in each and every feature, how the risks are going to be mitigated, and what was actually done during coding. &lt;br /&gt;
&lt;br /&gt;
Security architecture starts on the day the business requirements are modeled, and never finishes until the last copy of your application is decommissioned. Security is a life-long process, not a one shot accident.&lt;br /&gt;
&lt;br /&gt;
==Security principles ==&lt;br /&gt;
&lt;br /&gt;
These security principles have been taken from the previous edition of the OWASP Development Guide and normalized with the security principles outlined in Howard and LeBlanc’s excellent ''Writing Secure Code''. &lt;br /&gt;
&lt;br /&gt;
===''[[Minimize attack surface area]]''===&lt;br /&gt;
&lt;br /&gt;
Every feature that is added to an application adds a certain amount of risk to the overall application. The aim for secure development is to reduce the overall risk by reducing the attack surface area. &lt;br /&gt;
&lt;br /&gt;
For example, a web application implements online help with a search function. The search function may be vulnerable to SQL injection attacks. If the help feature was limited to authorized users, the attack likelihood is reduced. If the help feature’s search function was gated through centralized data validation routines, the ability to perform SQL injection is dramatically reduced. However, if the help feature was re-written to eliminate the search function (through better user interface, for example), this almost eliminates the attack surface area, even if the help feature was available to the Internet at large.&lt;br /&gt;
&lt;br /&gt;
===''[[Establish secure defaults]]''===&lt;br /&gt;
&lt;br /&gt;
There are many ways to deliver an “out of the box” experience for users. However, by default, the experience should be secure, and it should be up to the user to reduce their security – if they are allowed. &lt;br /&gt;
&lt;br /&gt;
For example, by default, password aging and complexity should be enabled. Users might be allowed to turn these two features off to simplify their use of the application and increase their risk. &lt;br /&gt;
&lt;br /&gt;
===''Principle of [[Least privilege]]''===&lt;br /&gt;
&lt;br /&gt;
The principle of least privilege recommends that accounts have the least amount of privilege required to perform their business processes. This encompasses user rights, resource permissions such as CPU limits, memory, network, and file system permissions.&lt;br /&gt;
&lt;br /&gt;
For example, if a middleware server only requires access to the network, read access to a database table, and the ability to write to a log, this describes all the permissions that should be granted. Under no circumstances should the middleware be granted administrative privileges.&lt;br /&gt;
&lt;br /&gt;
===''Principle of [[Defense in depth]]''===&lt;br /&gt;
&lt;br /&gt;
The principle of defense in depth suggests that where one control would be reasonable, more controls that approach risks in different fashions are better. Controls, when used in depth, can make severe vulnerabilities extraordinarily difficult to exploit and thus unlikely to occur.&lt;br /&gt;
&lt;br /&gt;
With secure coding, this may take the form of tier-based validation, centralized auditing controls, and requiring users to be logged on all pages. &lt;br /&gt;
&lt;br /&gt;
For example, a flawed administrative interface is unlikely to be vulnerable to anonymous attack if it correctly gates access to production management networks, checks for administrative user authorization, and logs all access. &lt;br /&gt;
&lt;br /&gt;
===''[[Fail securely]]''===&lt;br /&gt;
&lt;br /&gt;
Applications regularly fail to process transactions for many reasons. How they fail can determine if an application is secure or not. &lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 isAdmin = true;&lt;br /&gt;
 try {&lt;br /&gt;
   codeWhichMayFail();&lt;br /&gt;
   isAdmin = isUserInRole( “Administrator” );&lt;br /&gt;
 }&lt;br /&gt;
 catch (Exception ex) {&lt;br /&gt;
   log.write(ex.toString());&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
If either &amp;lt;code&amp;gt;codeWhichMayFail()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;isUserInRole&amp;lt;/code&amp;gt; fails or throws an exception, the user is an admin by default. This is obviously a security risk.&lt;br /&gt;
&lt;br /&gt;
===''[[Don’t trust services]]''===&lt;br /&gt;
&lt;br /&gt;
Many organizations utilize the processing capabilities of third party partners, who more than likely have differing security policies and posture than you. It is unlikely that you can influence or control any external third party, whether they are home users or major suppliers or partners. &lt;br /&gt;
&lt;br /&gt;
Therefore, implicit trust of externally run systems is not warranted. All external systems should be treated in a similar fashion. &lt;br /&gt;
&lt;br /&gt;
For example, a loyalty program provider provides data that is used by Internet Banking, providing the number of reward points and a small list of potential redemption items. However, the data should be checked to ensure that it is safe to display to end users, and that the reward points are a positive number, and not improbably large.&lt;br /&gt;
&lt;br /&gt;
===''[[Separation of duties]]''===&lt;br /&gt;
&lt;br /&gt;
A key fraud control is separation of duties. For example, someone who requests a computer cannot also sign for it, nor should they directly receive the computer. This prevents the user from requesting many computers, and claiming they never arrived. &lt;br /&gt;
&lt;br /&gt;
Certain roles have different levels of trust than normal users. In particular, administrators are different to normal users. In general, administrators should not be users of the application. &lt;br /&gt;
&lt;br /&gt;
For example, an administrator should be able to turn the system on or off, set password policy but shouldn’t be able to log on to the storefront as a super privileged user, such as being able to “buy” goods on behalf of other users.&lt;br /&gt;
&lt;br /&gt;
===''[[Avoid security by obscurity]]''===&lt;br /&gt;
&lt;br /&gt;
Security through obscurity is a weak security control, and nearly always fails when it is the only control. This is not to say that keeping secrets is a bad idea, it simply means that the security of key systems should not be reliant upon keeping details hidden.&lt;br /&gt;
&lt;br /&gt;
For example, the security of an application should not rely upon knowledge of the source code being kept secret. The security should rely upon many other factors, including reasonable password policies, defense in depth, business transaction limits, solid network architecture, and fraud and audit controls. &lt;br /&gt;
&lt;br /&gt;
A practical example is Linux. Linux’s source code is widely available, and yet when properly secured, Linux is a hardy, secure and robust operating system. &lt;br /&gt;
&lt;br /&gt;
===''[[Keep security simple]]''===&lt;br /&gt;
&lt;br /&gt;
Attack surface area and simplicity go hand in hand. Certain software engineering fads prefer overly complex approaches to what would otherwise be relatively straightforward and simple code. &lt;br /&gt;
&lt;br /&gt;
Developers should avoid the use of double negatives and complex architectures when a simpler approach would be faster and simpler. &lt;br /&gt;
&lt;br /&gt;
For example, although it might be fashionable to have a slew of singleton entity beans running on a separate middleware server, it is more secure and faster to simply use global variables with an appropriate mutex mechanism to protect against race conditions. &lt;br /&gt;
&lt;br /&gt;
===''[[Fix security issues correctly]]''===&lt;br /&gt;
&lt;br /&gt;
Once a security issue has been identified, it is important to develop a test for it, and to understand the root cause of the issue. When design patterns are used, it is likely that the security issue is widespread amongst all code bases, so developing the right fix without introducing regressions is essential. &lt;br /&gt;
&lt;br /&gt;
For example, a user has found that they can see another user’s balance by adjusting their cookie. The fix seems to be relatively straightforward, but as the cookie handling code is shared among all applications, a change to just one application will trickle through to all other applications. The fix must therefore be tested on all affected applications. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[Guide Table of Contents|Development Guide Table of Contents]]&lt;br /&gt;
[[Category:OWASP_Guide_Project]]&lt;br /&gt;
[[Category:Principle]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Security_Logging_Project&amp;diff=218839</id>
		<title>OWASP Security Logging Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Security_Logging_Project&amp;diff=218839"/>
				<updated>2016-07-12T11:23:59Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: Undo revision 218838 by Sytzevk (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Main=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:OWASP_Project_Header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
==OWASP Security Logging Project==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The OWASP Security Logging project provides developers and ops personnel with APIs for logging security-related events. The aim is to let developers use the same set of logging APIs they are already familiar with from over a decade of experience with Log4J and its successors, while also adding powerful security features.&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Logging is often neglected by developers when thinking of security considerations. However, proper logging practice can provide the crucial forensics needed to investigate after a breach, and perhaps more importantly, a change to detect security issues as they happen. Most developers are already familiar with using logging for debugging and diagnostic purposes, so it should be easy for them to grasp the concept of security logging as well. The OWASP Security Logging project aims to give developers an easy way to get started with logging security events, tracking extra forensic information like the who (username), what (event type), and where (IP address, server name) needed for forensics. It also provides a means for classifying the information in log messages and applying masking if necessary.  &lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
This library is free software: you can redistribute it and/or modify it under the terms of the Apache License, Version 2.0. You can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
Overview of benefits and what you need to get started quickly.&lt;br /&gt;
&lt;br /&gt;
[http://www.securitycurmudgeon.com/2016/03/owasp-security-logging-project-explored.html OWASP Security Logging Project Explored]&lt;br /&gt;
&lt;br /&gt;
== Project Resources ==&lt;br /&gt;
[https://github.com/javabeanz/owasp-security-logging Source Code]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/javabeanz/owasp-security-logging/wiki Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/javabeanz/owasp-security-logging/issues Issue Tracker]&lt;br /&gt;
&lt;br /&gt;
== Related Projects ==&lt;br /&gt;
* [[Logging_Cheat_Sheet|Logging Cheat Sheet]]&lt;br /&gt;
&lt;br /&gt;
==Classifications==&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_CODE.jpg|link=]]&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot; rowspan=&amp;quot;2&amp;quot;| [[File:Owasp-incubator-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Incubator_Projects|Incubator Project]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-builders-small.png|link=Builders]]  &lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=Defenders]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [http://www.apache.org/licenses/LICENSE-2.0.html ASLv2]&lt;br /&gt;
   |}&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== Project Leaders ==&lt;br /&gt;
[mailto:sytze.vonkoningsveld@owasp.org Sytze van Koningsveld]&lt;br /&gt;
&lt;br /&gt;
[mailto:august.detlefsen@owasp.org August Detlefsen] &lt;br /&gt;
&lt;br /&gt;
[mailto:milton.smith@owasp.org Milton Smith]&lt;br /&gt;
&lt;br /&gt;
== News and Events ==&lt;br /&gt;
&lt;br /&gt;
1 Jul 2016, [http://www.slideshare.net/MiltonSmith6/how-to-use-owasp-security-logging How to Use OWASP Security Logging, AppSecEU 2016 Lightning Talk]&lt;br /&gt;
&lt;br /&gt;
5 Mar 2015, Version 1.0.0 deployed to Maven Central&lt;br /&gt;
&lt;br /&gt;
23 Dec 2014, Project Created and source code now available!&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paypal&amp;gt;OWASP Security Logging Project&amp;lt;/paypal&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FAQs=&lt;br /&gt;
&lt;br /&gt;
The following provides answers to frequently asked questions.&lt;br /&gt;
&lt;br /&gt;
==How can I participate in your project?==&lt;br /&gt;
All you have to do is make the Project Leader's aware of your available time to contribute to the project. It is also important to let the Leader's know how you would like to contribute and pitch in to help the project meet it's goals and milestones. There are many different ways you can contribute to an OWASP Project, but communication with the leads is key. &lt;br /&gt;
&lt;br /&gt;
==If I am not a programmer can I participate in your project?==&lt;br /&gt;
Yes, you can certainly participate in the project if you are not a programmer or technical. The project needs different skills and expertise and different times during its development. Currently, we are looking for researchers, writers, graphic designers, and a project administrator.&lt;br /&gt;
&lt;br /&gt;
= Acknowledgements =&lt;br /&gt;
==Volunteers==&lt;br /&gt;
&lt;br /&gt;
Only project leads for the moment.  Email projects leads if you would like to participate.&lt;br /&gt;
&lt;br /&gt;
=Roadmap &amp;amp; Getting Involved=&lt;br /&gt;
&lt;br /&gt;
Today many logging technologies are available providing powerful application logging capabilities.  But while powerful, these technologies are not designed for specific use-cases like security and auditing.  The generalized approach to logging platforms makes these platforms more useful to the widest possible audience but it also places more responsibility on designers.  In short, we don't consider our desire for additional improvement for security and audit logs is no oversight on the part of logging platform designers.&lt;br /&gt;
&lt;br /&gt;
It's the OWASP Security Logging Project desire to leverage existing technologies and apply them to improve security, audit, in addition to diagnostic logging.  We understand logging is mostly an afterthought on many project schedules, if it's included at all.   We believe a logging solution embracing this project will help the community produce better logs, a better understanding of our information systems, and higher quality software.&lt;br /&gt;
&lt;br /&gt;
==Getting involved==&lt;br /&gt;
Are you passionate about logging?  Are you motivated share your time and knowledge with the community?  Send the project leads an email, listed on project home page, and explain your ideas and how you can help.  Don't be discouraged if we don't immediately respond.  We occasionally get distracted with life but rest assured we will respond.&lt;br /&gt;
&lt;br /&gt;
==What is the OWASP Security Logging Project?==&lt;br /&gt;
OWASP Security Logging Project purpose is to deliver a suitable logging solution for general-purpose security, audit, and diagnostics log messaging.  Beyond code and technology, the project provides architectural and implementation considerations you may find useful in your own projects, or technologies you may not have previously considered.&lt;br /&gt;
&lt;br /&gt;
==Project goals==&lt;br /&gt;
* Develop a set of logging requirements for key domains like security, auditing, and diagnostics&lt;br /&gt;
* Develop interface specifications that support the projects requirements&lt;br /&gt;
* Develop a base implementation supporting project interface specifications&lt;br /&gt;
* Develop documentation artifacts (described later)&lt;br /&gt;
&lt;br /&gt;
==Considerations and restraints==&lt;br /&gt;
* Ease of use&lt;br /&gt;
* Compelling value on initial deployment (without any refactoring).  Increased value for refactoring&lt;br /&gt;
* Compatibility with existing industry standard logging technologies (e.g., log4*, logback, FluentD, etc) &lt;br /&gt;
* Typical scenarios considered, 1) stand-alone applications on mobile or desktop, 2) enterprise applications, and 3) cloud-based applications.&lt;br /&gt;
&lt;br /&gt;
==Anticipated support==&lt;br /&gt;
* Java 1.7 and Java 1.8&lt;br /&gt;
* .NET (tbd)&lt;br /&gt;
''We have considered other platforms for the future but everything depends upon community interest and support.''&lt;br /&gt;
&lt;br /&gt;
==Proposed features==&lt;br /&gt;
Following is a list of numbered features.  &lt;br /&gt;
&lt;br /&gt;
:1. MDC metadata improvements&lt;br /&gt;
:: a. process id (TBD)&lt;br /&gt;
:: b. application id and application instance id&lt;br /&gt;
:: c. server time\date in UTC &lt;br /&gt;
:: d. client time\date in UTC &lt;br /&gt;
:: e. client IP address &lt;br /&gt;
:: f. username or ID &lt;br /&gt;
:: g. global client session ID&lt;br /&gt;
:: h. security policy identifier&lt;br /&gt;
:: i. transaction id&lt;br /&gt;
:2. Log system properties on startup&lt;br /&gt;
:3. Log command line options on startup&lt;br /&gt;
:4. Log application server properties on startup&lt;br /&gt;
:5. Log HTTP request parameters &lt;br /&gt;
:6. Log HTTP session attributes&lt;br /&gt;
:7. Internationalization considerations&lt;br /&gt;
:8. Redirect system streams like system.out and system.err security logging framework&lt;br /&gt;
:9. Asynchronous message logging, store and forward&lt;br /&gt;
:10. Message correlation&lt;br /&gt;
:11. Performance options for transport compression&lt;br /&gt;
:12. Authenticated client logging&lt;br /&gt;
:13. Secure log message transport&lt;br /&gt;
:14. Signed log messages&lt;br /&gt;
:15. Guaranteed log message delivery&lt;br /&gt;
&lt;br /&gt;
==Delivery phases==&lt;br /&gt;
'''Alpha 1''', some features code complete.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Alpha 2''', more features code complete.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Beta''', release code complete.  Public encouraged to test and respond with comments.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Early Availability(EA)''', includes improvements to beta based upon public and team recommendations.&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Use-case applicability &amp;amp; delivery schedule==&lt;br /&gt;
The following table shows a proposed applicability of each feature to the projects areas of concern, diagnostics, security, and audit logging along with a suggested delivery phase.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;color:#555555; background-color:#ffffcc;&amp;quot; cellpadding=&amp;quot;10&amp;quot;&lt;br /&gt;
!&amp;amp;nbsp;&lt;br /&gt;
!Diagnostics&lt;br /&gt;
!Security&lt;br /&gt;
!Audit&lt;br /&gt;
!Delivery&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1a, process id&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1b, application id and application instance id&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1c, server time\date in UTC&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1d, client time\date in UTC&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1e, client IP address&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1f, username or ID&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1g, global client session ID&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1h, security policy identifier&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''M'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1i, transaction id&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 2, Log system properties on startup&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 3, Log command line properties on startup&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 4, Log application server properties on startup&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 5, Log HTTP request parameters&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 6, Log HTTP session attributes&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''?'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 7, Internationalization considerations&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 8, Redirect system streams like System.out and System.err to logging framework&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 9, Asynchronous message logging, store and forward&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 10, Message correlation&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 11, Performance options for transport compression&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 12, Authenticated client logging&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 13, Secure log message transport&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 14, Signed log messages&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 15, Guaranteed log message delivery&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|}&lt;br /&gt;
'''''Legend, X=applicable use-case, M=maybe useful, ?=tbd'''''&lt;br /&gt;
&lt;br /&gt;
==Project delivery artifacts==&lt;br /&gt;
:'''Logging primer''', architectural considerations for security, audit, and diagnostics for community projects.  Provide information how logging project can be leverage to address concerns provided by each use case, general logging best practices, template for using message levels (e.g., INFO, WARN, etc).&lt;br /&gt;
:'''Logging design''', specific technical details to apply project logging to community logging projects.&lt;br /&gt;
:'''Code''', software program code that implements project feature goals.&lt;br /&gt;
&lt;br /&gt;
==Code areas==&lt;br /&gt;
:'''Logging layouts''', at the moment this is Common Event Format(CEF) and Common Log File System(CLFS).&lt;br /&gt;
:'''MDC filter''', include system information handy for most deployments into logbacks Mapped Diagnostics Context(MDC).&lt;br /&gt;
:'''MDC marker''',&lt;br /&gt;
:'''Unit testing''', various software code we use (and you can also use) to test project code.&lt;br /&gt;
&lt;br /&gt;
==Detailed use-case descriptions==&lt;br /&gt;
Following are detailed use-case descriptions for each feature.  The purpose of this section is to help readers to understand more about each feature and it's potential benefits.&lt;br /&gt;
&lt;br /&gt;
==Feature 1, MDC metadata improvements==&lt;br /&gt;
This feature adds certain metadata useful for security purposes to logback’s Mapped Diagnostics Content.  The following metadata will be mapped where available.&lt;br /&gt;
&lt;br /&gt;
===process id (feature 1a)===&lt;br /&gt;
This is the process id of the application as assigned by the operating system at execution.  On *nix and Windows environments this the PID.  Depending upon the language platform process id may not be readily available.  As an alternative, server hostname or IP may be used.&lt;br /&gt;
&lt;br /&gt;
===application id and application instance id (feature 1b)===&lt;br /&gt;
This an identifier set by the application designer to identify a unique application instance.  This identifier is useful to identify applications uniquely where many instances of the same program (e.g., web application) are hosted on 1 or more physical servers.  The application id is useful visual indicator of the type of application component.  The instance id is useful to identify the application instance.  The instance is particularly useful where the same process may host 2 or more application instances.  An instance id may be a generated hash (e.g., VMID) or unique index where size is a concern.  Once the id is used it should persist between process restarts.  A suggested format:  {APP ID}:{APP INSTANCE ID}.  An sample POS:ace22c02aa858f670e3c227fbab141e2d8d6bea6 or POS:14563.&lt;br /&gt;
&lt;br /&gt;
===server time\date in UTC (feature 1c)===&lt;br /&gt;
Time, date, and day, on the server with timezone offset at the time the message was logged.  A suggested format[1], {yyyy-MM-dd'T'HH:mm:ss.SSSZ}.  An example, 2001-07-04T12:08:56.235-0700&lt;br /&gt;
&lt;br /&gt;
===client time\date in UTC (feature 1d)===&lt;br /&gt;
Time, date, and day, on the client with timezone offset at the time the message was logged.  A suggested format[1], {yyyy-MM-dd'T'HH:mm:ss.SSSZ}.  An example, 2001-07-04T12:08:56.235-0700&lt;br /&gt;
&lt;br /&gt;
===client ip address (feature 1e)===&lt;br /&gt;
MDC property for the IP address of the client host where the log message originated.  An example, 192.168.1.30&lt;br /&gt;
&lt;br /&gt;
===user name or ID (feature 1f)===&lt;br /&gt;
This MDC property to property is an application account name associated with a human (if available) this is associated with this log message.  This property may not be available if the log message is not specifically related to an individual's activity.  An example, milton.smith&lt;br /&gt;
&lt;br /&gt;
===global client session id (feature 1g)===&lt;br /&gt;
This MDC property is a session id assigned by an application designer that is shared across multiple application instances.  Usually this is a secure hash to avoid reverse engineering.  An example, ace22c02aa858f670e3c227fbab141e2d8d6bea6&lt;br /&gt;
&lt;br /&gt;
===security policy identifier (feature 1h)===&lt;br /&gt;
MDC property that identifies activities associated with a sites security policy.  The value is site defined and can be useful when producing information for audits.  An example, Violation:SEC.5.2a&lt;br /&gt;
&lt;br /&gt;
===transaction id (feature 1i)===&lt;br /&gt;
MDC property to identify activities associated with a single user action.  For example, execution of a single application user feature may require many activities from the main application program along with components like LDAP servers and databases.  The transaction id is useful to correlate all the related system activities that support a specific user request.  Each subsequent user request receives a new transaction id.  An example, TRX:1005862&lt;br /&gt;
&lt;br /&gt;
==Feature 2, Log system properties on startup==&lt;br /&gt;
The requirement is to log all system properties on application startup.  Often it’s difficult to perform an investigation without understanding the initial state of the system.  An example how properties may appear in logs (without MDC information).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 *******************************************&lt;br /&gt;
 JAVA PROPERTY SETTINGS&lt;br /&gt;
 *******************************************&lt;br /&gt;
Setting, java.runtime.name=Java(TM) SE Runtime Environment&lt;br /&gt;
Setting, sun.boot.library.path=C:\Program Files\Java\jre6\bin&lt;br /&gt;
Setting, java.vm.version=14.0-b16&lt;br /&gt;
Setting, java.vm.vendor=Sun Microsystems Inc.&lt;br /&gt;
Setting, java.vendor.url=http://java.sun.com/&lt;br /&gt;
Setting, path.separator=;&lt;br /&gt;
Setting, java.vm.name=Java HotSpot(TM) Client VM&lt;br /&gt;
Setting, file.encoding.pkg=sun.io&lt;br /&gt;
Setting, sun.java.launcher=SUN_STANDARD&lt;br /&gt;
 Setting, user.country=US&lt;br /&gt;
Setting, sun.os.patch.level=&lt;br /&gt;
Setting, java.vm.specification.name=Java Virtual Machine Specification&lt;br /&gt;
Setting, user.dir=C:\Users\Milton\workspace\MyProject&lt;br /&gt;
Setting, java.runtime.version=1.6.0_14-b08&lt;br /&gt;
Setting, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment&lt;br /&gt;
Setting, java.endorsed.dirs=C:\Program Files\Java\jre6\lib\endorsed&lt;br /&gt;
Setting, os.arch=x86&lt;br /&gt;
Setting, java.io.tmpdir=C:\Users\Milton\AppData\Local\Temp\&lt;br /&gt;
Setting, line.separator=&lt;br /&gt;
    &lt;br /&gt;
Setting, java.vm.specification.vendor=Sun Microsystems Inc.&lt;br /&gt;
Setting, user.variant=&lt;br /&gt;
Setting, os.name=Windows 7&lt;br /&gt;
Setting, sun.jnu.encoding=Cp1252&lt;br /&gt;
Setting, java.library.path=C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\Program Files\JavaFX\javafx-sdk1.2\bin;C:\Program Files\JavaFX\javafx-sdk1.2\emulator\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\usershellcommands;C:\Program Files\QuickTime\QTSystem\&lt;br /&gt;
 Setting, java.specification.name=Java Platform API Specification&lt;br /&gt;
Setting, java.class.version=50.0&lt;br /&gt;
Setting, sun.management.compiler=HotSpot Client Compiler&lt;br /&gt;
Setting, os.version=6.1&lt;br /&gt;
Setting, user.home=C:\Users\Milton&lt;br /&gt;
Setting, user.timezone=&lt;br /&gt;
Setting, java.awt.printerjob=sun.awt.windows.WPrinterJob&lt;br /&gt;
Setting, file.encoding=Cp1252&lt;br /&gt;
Setting, java.specification.version=1.6&lt;br /&gt;
Setting, java.class.path=C:\Users\Milton\workspace\SDA\bin;C:\Java-Libs\jmx-1_2_1-bin\lib\jmxri.jar;C:\Java-Libs\apache-log4j-1.2.15\log4j-1.2.15.jar&lt;br /&gt;
Setting, user.name=Milton&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Feature 3, Log command line options on startup==&lt;br /&gt;
The requirement is to log all command line arguments on application startup.  All command line arguments must be logged.  In Java, the entire arg array passed into the main(String args[]) method should be logged.  Any whitespace or special characters should be filtered before logged.  For example a small program that echos the input to the command line may produce an output that looks like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 *******************************************&lt;br /&gt;
    COMMAND LINE ARGS&lt;br /&gt;
 *******************************************&lt;br /&gt;
java testapp “Hello World!”&lt;br /&gt;
Hello World! &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Feature 4, Log application server properties on startup==&lt;br /&gt;
The requirement is to log all key\value pairs that influence application behavior upon execution.  In Java, there parameters are defined by HttpServlet.getInitParameterNames()  An example of logged J2EE properties may look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 *******************************************&lt;br /&gt;
    J2EE PROPERTIES&lt;br /&gt;
 *******************************************&lt;br /&gt;
Setting, thread.pool.size=1000&lt;br /&gt;
Setting, request.ttlms=30000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Feature 5, Log HTTP request parameters==&lt;br /&gt;
The requirement is to log all key\value pairs associated with all application HTTP requests.  Raw HTTP requests parameters across the cloud may generate significantly increase log volume.  The goal is to define a request log that overwrites itself (e.g., a ring buffer) at a small designer specified interval or a default of 15 mins.  This allows highly granular diagnostic messages over a short duration.&lt;br /&gt;
&lt;br /&gt;
An ancillary requirement is that sensitive key\value pairs will be masked.  A default set of masking rules will be included with the project with an option for designers to assign their own masking rules specific for their applications.&lt;br /&gt;
 &lt;br /&gt;
(TODOMS: need to insert some raw http requests from zap in a suitable log format)&lt;br /&gt;
&lt;br /&gt;
==Feature 6, Log HTTP session attributes==&lt;br /&gt;
&lt;br /&gt;
The requirement is to log all key\value pairs associated with a users HttpSession instance.  These properties should be logged once upon user session initialization.  In Java, key\value pairs from HttpSession.getAttributeName() should be logged when the HttpSession is created.&lt;br /&gt;
&lt;br /&gt;
(TODOMS: need to insert some sample HTTP session attributes)&lt;br /&gt;
&lt;br /&gt;
==Feature 7, Internationalization considerations==&lt;br /&gt;
The action is to use string resources so that logs are compatible across languages.  The project will initially define US English.  Designers are encouraged to translate resources to different languages.  If the translations are made available to us we may include them.&lt;br /&gt;
&lt;br /&gt;
==Feature 8, Redirect system streams like System.out and System.err to security logging framework==&lt;br /&gt;
This requirement captures any legacy messaging from older code without refactoring.  The approach redirects any messages to system defined streams into the logging framework.  Log messages will not be a content rich since since the caller, old code in this case, does not calling the Security API directly.  The advantage is instant out of the box compatibility with no refactoring.  In Java, the action is to capture calls like System.out.println(“My wife loves security.”) and System.err() reroute them to the logging framework without modification to legacy programs.&lt;br /&gt;
&lt;br /&gt;
An ancillary requirement is that sensitive key\value pairs will be masked.  A default set of masking rules will be included with the project with an option for designers to assign their own masking rules specific for their applications.&lt;br /&gt;
&lt;br /&gt;
==Feature 9, Asynchronous message logging, store and forward==&lt;br /&gt;
The requirement for this feature one of performance.  Log messages sent to a remote location (e.g., central log server) can take some time to send over networks.  It may be desirable in some deployments for the caller not to block when logging these messages.  The goal is to log the message locally, freeing the caller, then send the message in a background thread to the remote server.   See Feature 15 also.&lt;br /&gt;
&lt;br /&gt;
==Feature 10, Message correlation==&lt;br /&gt;
A problem with logs today is that it’s often difficult to reconstruct a series of activities leading to an event of interest.  System logs are often out of order with messages originating from different threads and hosts.  The goal of message correlation is to provide identifier(s) so that all log messages can be sequenced into a narrative of system activities leading to an event of interest.  For example, with correlation it will be possible to separate log entries to see the activities involved in a single administrative user operation like Add User.  Log entries to add a user may begin with HTTP posts from the clients browser, system permission checks, next a log message describing the insert of the new user into the user table, a log message of positive confirmation a SMTP message was sent to indicate the users new account is ready for initial signon.&lt;br /&gt;
&lt;br /&gt;
==Feature 11, Performance options for transport compression==&lt;br /&gt;
Where log message will transit networks facilities will be provided to compress traffic to remote hosts.&lt;br /&gt;
&lt;br /&gt;
==Feature 12, Authenticated client logging==&lt;br /&gt;
This feature is useful to ensure each message logged is attributable to a known source and trusted source.  Messages from anonymous sources may still be allowed, depending upon system preferences, but authenticated messages will clearly indicate the identity of the source.&lt;br /&gt;
&lt;br /&gt;
==Feature 13, Secure transport==&lt;br /&gt;
To facilitate secure transport a TLS 1.2 compliant connection be negotiated.  Options must be provided to allow designers to control ciphersuite negotiation.  Negotiation options must include provision for, a) the name of each ciphersuite permitted, b) order of negotiation which is ideally strongest suites first as a default but can be changed by the designer.  The trust roots will be those supplied by the supporting language platform (e.g., Java, .NET, etc).&lt;br /&gt;
&lt;br /&gt;
==Feature 14, Signed log messages==&lt;br /&gt;
To facilitate tamper resistant log messages log messages will be signed by the client.  Each field of the log message will be included in the signing process.  The signature will be included with the log message entry along with strongest fingerprint included within signing certificate.  The fingerprint of the signing certificate is an aid to identify the signing certificate and may be important for enterprise or cloud environments where many clients are logging.  Signed logs may or may not be encrypted.&lt;br /&gt;
&lt;br /&gt;
==Feature 15, Guaranteed log message delivery==&lt;br /&gt;
This feature builds upon the Feature 9, Asynchronous message logging, store and forward to include guaranteed delivery.  The goal is that no messages are lost.  Messages received from the caller will be queued for delivery.  Clients logging messages must block until their log message is committed to a queue.  For simplicity, the queue will exist on the client computer.  The function is somewhat analogous to a local print spooler.  If committing to a queue is not possible an instance of a RuntimeException must be thrown to the caller.  Once committed to a queue, worker threads will send the message in the background to the remote server.  On the client, worker threads will not remove the log message from the queue until the server has acknowledged receipt.&lt;br /&gt;
&lt;br /&gt;
From the server side, the server must maintain the client connection until the message is logged.  If the message cannot be logged an instance of an Exception must be thrown.  Using this system no message will ever be lost.  A message will exist in only 3 states, 1) with the blocked client, 2) within the client’s log queue, 3) logged on the server.  For a completely reliable solution, HA hardware and RAID media are required which is a consideration for system designers.&lt;br /&gt;
&lt;br /&gt;
==Feedback==&lt;br /&gt;
Please report any concerns, correction, or other feedback to any of the project leads listed on the main project page.&lt;br /&gt;
&lt;br /&gt;
=Minimum Viable Product=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
This page is where you should indicate what is the minimum set of functionality that is required to make this a useful product that addresses your core security concern.&lt;br /&gt;
Defining this information helps the project leader to think about what is the critical functionality that a user needs for this project to be useful, thereby helping determine what the priorities should be on the roadmap.  And it also helps reviewers who are evaluating the project to determine if the functionality sufficiently provides the critical functionality to determine if the project should be promoted to the next project category.  &lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Project About=&lt;br /&gt;
&amp;lt;!-- Instructions are in RED and should be removed from your document by deleting the text with the span tags.--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
	This page is where you need to place your legacy project template page if your project was created before October 2013. To edit this page you will need to edit your project information template. You can typically find this page by following this address and substituting your project name where it says &amp;quot;OWASP_Example_Project&amp;quot;. When in doubt, ask the OWASP Projects Manager. &lt;br /&gt;
Example template page: https://www.owasp.org/index.php/Projects/OWASP_Example_Project&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{:Projects/OWASP_Example_Project_About_Page}} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project]]  [[Category:OWASP_Builders]] [[Category:OWASP_Defenders]]  [[Category:OWASP_Code]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Security_Logging_Project&amp;diff=218838</id>
		<title>OWASP Security Logging Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Security_Logging_Project&amp;diff=218838"/>
				<updated>2016-07-12T11:21:41Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: /* News and Events */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Main=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:OWASP_Project_Header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
==OWASP Security Logging Project==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The OWASP Security Logging project provides developers and ops personnel with APIs for logging security-related events. The aim is to let developers use the same set of logging APIs they are already familiar with from over a decade of experience with Log4J and its successors, while also adding powerful security features.&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Logging is often neglected by developers when thinking of security considerations. However, proper logging practice can provide the crucial forensics needed to investigate after a breach, and perhaps more importantly, a change to detect security issues as they happen. Most developers are already familiar with using logging for debugging and diagnostic purposes, so it should be easy for them to grasp the concept of security logging as well. The OWASP Security Logging project aims to give developers an easy way to get started with logging security events, tracking extra forensic information like the who (username), what (event type), and where (IP address, server name) needed for forensics. It also provides a means for classifying the information in log messages and applying masking if necessary.  &lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
This library is free software: you can redistribute it and/or modify it under the terms of the Apache License, Version 2.0. You can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
Overview of benefits and what you need to get started quickly.&lt;br /&gt;
&lt;br /&gt;
[http://www.securitycurmudgeon.com/2016/03/owasp-security-logging-project-explored.html OWASP Security Logging Project Explored]&lt;br /&gt;
&lt;br /&gt;
== Project Resources ==&lt;br /&gt;
[https://github.com/javabeanz/owasp-security-logging Source Code]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/javabeanz/owasp-security-logging/wiki Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/javabeanz/owasp-security-logging/issues Issue Tracker]&lt;br /&gt;
&lt;br /&gt;
== Related Projects ==&lt;br /&gt;
* [[Logging_Cheat_Sheet|Logging Cheat Sheet]]&lt;br /&gt;
&lt;br /&gt;
==Classifications==&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_CODE.jpg|link=]]&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot; rowspan=&amp;quot;2&amp;quot;| [[File:Owasp-incubator-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Incubator_Projects|Incubator Project]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-builders-small.png|link=Builders]]  &lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=Defenders]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [http://www.apache.org/licenses/LICENSE-2.0.html ASLv2]&lt;br /&gt;
   |}&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== Project Leaders ==&lt;br /&gt;
[mailto:sytze.vonkoningsveld@owasp.org Sytze van Koningsveld]&lt;br /&gt;
&lt;br /&gt;
[mailto:august.detlefsen@owasp.org August Detlefsen] &lt;br /&gt;
&lt;br /&gt;
[mailto:milton.smith@owasp.org Milton Smith]&lt;br /&gt;
&lt;br /&gt;
== News and Events ==&lt;br /&gt;
&lt;br /&gt;
1 Jul 2016, [http://www.slideshare.net/MiltonSmith6/how-to-use-owasp-security-logging How to Use OWASP Security Logging, AppSecEU 2016 Lightning Talk]&lt;br /&gt;
&lt;br /&gt;
June 2016, Version 1.1.2 deployed to Maven Central&lt;br /&gt;
&lt;br /&gt;
5 Mar 2015, Version 1.0.0 deployed to Maven Central&lt;br /&gt;
&lt;br /&gt;
23 Dec 2014, Project Created and source code now available!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paypal&amp;gt;OWASP Security Logging Project&amp;lt;/paypal&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FAQs=&lt;br /&gt;
&lt;br /&gt;
The following provides answers to frequently asked questions.&lt;br /&gt;
&lt;br /&gt;
==How can I participate in your project?==&lt;br /&gt;
All you have to do is make the Project Leader's aware of your available time to contribute to the project. It is also important to let the Leader's know how you would like to contribute and pitch in to help the project meet it's goals and milestones. There are many different ways you can contribute to an OWASP Project, but communication with the leads is key. &lt;br /&gt;
&lt;br /&gt;
==If I am not a programmer can I participate in your project?==&lt;br /&gt;
Yes, you can certainly participate in the project if you are not a programmer or technical. The project needs different skills and expertise and different times during its development. Currently, we are looking for researchers, writers, graphic designers, and a project administrator.&lt;br /&gt;
&lt;br /&gt;
= Acknowledgements =&lt;br /&gt;
==Volunteers==&lt;br /&gt;
&lt;br /&gt;
Only project leads for the moment.  Email projects leads if you would like to participate.&lt;br /&gt;
&lt;br /&gt;
=Roadmap &amp;amp; Getting Involved=&lt;br /&gt;
&lt;br /&gt;
Today many logging technologies are available providing powerful application logging capabilities.  But while powerful, these technologies are not designed for specific use-cases like security and auditing.  The generalized approach to logging platforms makes these platforms more useful to the widest possible audience but it also places more responsibility on designers.  In short, we don't consider our desire for additional improvement for security and audit logs is no oversight on the part of logging platform designers.&lt;br /&gt;
&lt;br /&gt;
It's the OWASP Security Logging Project desire to leverage existing technologies and apply them to improve security, audit, in addition to diagnostic logging.  We understand logging is mostly an afterthought on many project schedules, if it's included at all.   We believe a logging solution embracing this project will help the community produce better logs, a better understanding of our information systems, and higher quality software.&lt;br /&gt;
&lt;br /&gt;
==Getting involved==&lt;br /&gt;
Are you passionate about logging?  Are you motivated share your time and knowledge with the community?  Send the project leads an email, listed on project home page, and explain your ideas and how you can help.  Don't be discouraged if we don't immediately respond.  We occasionally get distracted with life but rest assured we will respond.&lt;br /&gt;
&lt;br /&gt;
==What is the OWASP Security Logging Project?==&lt;br /&gt;
OWASP Security Logging Project purpose is to deliver a suitable logging solution for general-purpose security, audit, and diagnostics log messaging.  Beyond code and technology, the project provides architectural and implementation considerations you may find useful in your own projects, or technologies you may not have previously considered.&lt;br /&gt;
&lt;br /&gt;
==Project goals==&lt;br /&gt;
* Develop a set of logging requirements for key domains like security, auditing, and diagnostics&lt;br /&gt;
* Develop interface specifications that support the projects requirements&lt;br /&gt;
* Develop a base implementation supporting project interface specifications&lt;br /&gt;
* Develop documentation artifacts (described later)&lt;br /&gt;
&lt;br /&gt;
==Considerations and restraints==&lt;br /&gt;
* Ease of use&lt;br /&gt;
* Compelling value on initial deployment (without any refactoring).  Increased value for refactoring&lt;br /&gt;
* Compatibility with existing industry standard logging technologies (e.g., log4*, logback, FluentD, etc) &lt;br /&gt;
* Typical scenarios considered, 1) stand-alone applications on mobile or desktop, 2) enterprise applications, and 3) cloud-based applications.&lt;br /&gt;
&lt;br /&gt;
==Anticipated support==&lt;br /&gt;
* Java 1.7 and Java 1.8&lt;br /&gt;
* .NET (tbd)&lt;br /&gt;
''We have considered other platforms for the future but everything depends upon community interest and support.''&lt;br /&gt;
&lt;br /&gt;
==Proposed features==&lt;br /&gt;
Following is a list of numbered features.  &lt;br /&gt;
&lt;br /&gt;
:1. MDC metadata improvements&lt;br /&gt;
:: a. process id (TBD)&lt;br /&gt;
:: b. application id and application instance id&lt;br /&gt;
:: c. server time\date in UTC &lt;br /&gt;
:: d. client time\date in UTC &lt;br /&gt;
:: e. client IP address &lt;br /&gt;
:: f. username or ID &lt;br /&gt;
:: g. global client session ID&lt;br /&gt;
:: h. security policy identifier&lt;br /&gt;
:: i. transaction id&lt;br /&gt;
:2. Log system properties on startup&lt;br /&gt;
:3. Log command line options on startup&lt;br /&gt;
:4. Log application server properties on startup&lt;br /&gt;
:5. Log HTTP request parameters &lt;br /&gt;
:6. Log HTTP session attributes&lt;br /&gt;
:7. Internationalization considerations&lt;br /&gt;
:8. Redirect system streams like system.out and system.err security logging framework&lt;br /&gt;
:9. Asynchronous message logging, store and forward&lt;br /&gt;
:10. Message correlation&lt;br /&gt;
:11. Performance options for transport compression&lt;br /&gt;
:12. Authenticated client logging&lt;br /&gt;
:13. Secure log message transport&lt;br /&gt;
:14. Signed log messages&lt;br /&gt;
:15. Guaranteed log message delivery&lt;br /&gt;
&lt;br /&gt;
==Delivery phases==&lt;br /&gt;
'''Alpha 1''', some features code complete.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Alpha 2''', more features code complete.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Beta''', release code complete.  Public encouraged to test and respond with comments.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Early Availability(EA)''', includes improvements to beta based upon public and team recommendations.&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Use-case applicability &amp;amp; delivery schedule==&lt;br /&gt;
The following table shows a proposed applicability of each feature to the projects areas of concern, diagnostics, security, and audit logging along with a suggested delivery phase.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;color:#555555; background-color:#ffffcc;&amp;quot; cellpadding=&amp;quot;10&amp;quot;&lt;br /&gt;
!&amp;amp;nbsp;&lt;br /&gt;
!Diagnostics&lt;br /&gt;
!Security&lt;br /&gt;
!Audit&lt;br /&gt;
!Delivery&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1a, process id&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1b, application id and application instance id&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1c, server time\date in UTC&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1d, client time\date in UTC&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1e, client IP address&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1f, username or ID&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1g, global client session ID&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1h, security policy identifier&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''M'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1i, transaction id&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 2, Log system properties on startup&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 3, Log command line properties on startup&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 4, Log application server properties on startup&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 5, Log HTTP request parameters&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 6, Log HTTP session attributes&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''?'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 7, Internationalization considerations&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 8, Redirect system streams like System.out and System.err to logging framework&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 9, Asynchronous message logging, store and forward&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 10, Message correlation&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 11, Performance options for transport compression&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 12, Authenticated client logging&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 13, Secure log message transport&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 14, Signed log messages&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 15, Guaranteed log message delivery&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|}&lt;br /&gt;
'''''Legend, X=applicable use-case, M=maybe useful, ?=tbd'''''&lt;br /&gt;
&lt;br /&gt;
==Project delivery artifacts==&lt;br /&gt;
:'''Logging primer''', architectural considerations for security, audit, and diagnostics for community projects.  Provide information how logging project can be leverage to address concerns provided by each use case, general logging best practices, template for using message levels (e.g., INFO, WARN, etc).&lt;br /&gt;
:'''Logging design''', specific technical details to apply project logging to community logging projects.&lt;br /&gt;
:'''Code''', software program code that implements project feature goals.&lt;br /&gt;
&lt;br /&gt;
==Code areas==&lt;br /&gt;
:'''Logging layouts''', at the moment this is Common Event Format(CEF) and Common Log File System(CLFS).&lt;br /&gt;
:'''MDC filter''', include system information handy for most deployments into logbacks Mapped Diagnostics Context(MDC).&lt;br /&gt;
:'''MDC marker''',&lt;br /&gt;
:'''Unit testing''', various software code we use (and you can also use) to test project code.&lt;br /&gt;
&lt;br /&gt;
==Detailed use-case descriptions==&lt;br /&gt;
Following are detailed use-case descriptions for each feature.  The purpose of this section is to help readers to understand more about each feature and it's potential benefits.&lt;br /&gt;
&lt;br /&gt;
==Feature 1, MDC metadata improvements==&lt;br /&gt;
This feature adds certain metadata useful for security purposes to logback’s Mapped Diagnostics Content.  The following metadata will be mapped where available.&lt;br /&gt;
&lt;br /&gt;
===process id (feature 1a)===&lt;br /&gt;
This is the process id of the application as assigned by the operating system at execution.  On *nix and Windows environments this the PID.  Depending upon the language platform process id may not be readily available.  As an alternative, server hostname or IP may be used.&lt;br /&gt;
&lt;br /&gt;
===application id and application instance id (feature 1b)===&lt;br /&gt;
This an identifier set by the application designer to identify a unique application instance.  This identifier is useful to identify applications uniquely where many instances of the same program (e.g., web application) are hosted on 1 or more physical servers.  The application id is useful visual indicator of the type of application component.  The instance id is useful to identify the application instance.  The instance is particularly useful where the same process may host 2 or more application instances.  An instance id may be a generated hash (e.g., VMID) or unique index where size is a concern.  Once the id is used it should persist between process restarts.  A suggested format:  {APP ID}:{APP INSTANCE ID}.  An sample POS:ace22c02aa858f670e3c227fbab141e2d8d6bea6 or POS:14563.&lt;br /&gt;
&lt;br /&gt;
===server time\date in UTC (feature 1c)===&lt;br /&gt;
Time, date, and day, on the server with timezone offset at the time the message was logged.  A suggested format[1], {yyyy-MM-dd'T'HH:mm:ss.SSSZ}.  An example, 2001-07-04T12:08:56.235-0700&lt;br /&gt;
&lt;br /&gt;
===client time\date in UTC (feature 1d)===&lt;br /&gt;
Time, date, and day, on the client with timezone offset at the time the message was logged.  A suggested format[1], {yyyy-MM-dd'T'HH:mm:ss.SSSZ}.  An example, 2001-07-04T12:08:56.235-0700&lt;br /&gt;
&lt;br /&gt;
===client ip address (feature 1e)===&lt;br /&gt;
MDC property for the IP address of the client host where the log message originated.  An example, 192.168.1.30&lt;br /&gt;
&lt;br /&gt;
===user name or ID (feature 1f)===&lt;br /&gt;
This MDC property to property is an application account name associated with a human (if available) this is associated with this log message.  This property may not be available if the log message is not specifically related to an individual's activity.  An example, milton.smith&lt;br /&gt;
&lt;br /&gt;
===global client session id (feature 1g)===&lt;br /&gt;
This MDC property is a session id assigned by an application designer that is shared across multiple application instances.  Usually this is a secure hash to avoid reverse engineering.  An example, ace22c02aa858f670e3c227fbab141e2d8d6bea6&lt;br /&gt;
&lt;br /&gt;
===security policy identifier (feature 1h)===&lt;br /&gt;
MDC property that identifies activities associated with a sites security policy.  The value is site defined and can be useful when producing information for audits.  An example, Violation:SEC.5.2a&lt;br /&gt;
&lt;br /&gt;
===transaction id (feature 1i)===&lt;br /&gt;
MDC property to identify activities associated with a single user action.  For example, execution of a single application user feature may require many activities from the main application program along with components like LDAP servers and databases.  The transaction id is useful to correlate all the related system activities that support a specific user request.  Each subsequent user request receives a new transaction id.  An example, TRX:1005862&lt;br /&gt;
&lt;br /&gt;
==Feature 2, Log system properties on startup==&lt;br /&gt;
The requirement is to log all system properties on application startup.  Often it’s difficult to perform an investigation without understanding the initial state of the system.  An example how properties may appear in logs (without MDC information).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 *******************************************&lt;br /&gt;
 JAVA PROPERTY SETTINGS&lt;br /&gt;
 *******************************************&lt;br /&gt;
Setting, java.runtime.name=Java(TM) SE Runtime Environment&lt;br /&gt;
Setting, sun.boot.library.path=C:\Program Files\Java\jre6\bin&lt;br /&gt;
Setting, java.vm.version=14.0-b16&lt;br /&gt;
Setting, java.vm.vendor=Sun Microsystems Inc.&lt;br /&gt;
Setting, java.vendor.url=http://java.sun.com/&lt;br /&gt;
Setting, path.separator=;&lt;br /&gt;
Setting, java.vm.name=Java HotSpot(TM) Client VM&lt;br /&gt;
Setting, file.encoding.pkg=sun.io&lt;br /&gt;
Setting, sun.java.launcher=SUN_STANDARD&lt;br /&gt;
 Setting, user.country=US&lt;br /&gt;
Setting, sun.os.patch.level=&lt;br /&gt;
Setting, java.vm.specification.name=Java Virtual Machine Specification&lt;br /&gt;
Setting, user.dir=C:\Users\Milton\workspace\MyProject&lt;br /&gt;
Setting, java.runtime.version=1.6.0_14-b08&lt;br /&gt;
Setting, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment&lt;br /&gt;
Setting, java.endorsed.dirs=C:\Program Files\Java\jre6\lib\endorsed&lt;br /&gt;
Setting, os.arch=x86&lt;br /&gt;
Setting, java.io.tmpdir=C:\Users\Milton\AppData\Local\Temp\&lt;br /&gt;
Setting, line.separator=&lt;br /&gt;
    &lt;br /&gt;
Setting, java.vm.specification.vendor=Sun Microsystems Inc.&lt;br /&gt;
Setting, user.variant=&lt;br /&gt;
Setting, os.name=Windows 7&lt;br /&gt;
Setting, sun.jnu.encoding=Cp1252&lt;br /&gt;
Setting, java.library.path=C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\Program Files\JavaFX\javafx-sdk1.2\bin;C:\Program Files\JavaFX\javafx-sdk1.2\emulator\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\usershellcommands;C:\Program Files\QuickTime\QTSystem\&lt;br /&gt;
 Setting, java.specification.name=Java Platform API Specification&lt;br /&gt;
Setting, java.class.version=50.0&lt;br /&gt;
Setting, sun.management.compiler=HotSpot Client Compiler&lt;br /&gt;
Setting, os.version=6.1&lt;br /&gt;
Setting, user.home=C:\Users\Milton&lt;br /&gt;
Setting, user.timezone=&lt;br /&gt;
Setting, java.awt.printerjob=sun.awt.windows.WPrinterJob&lt;br /&gt;
Setting, file.encoding=Cp1252&lt;br /&gt;
Setting, java.specification.version=1.6&lt;br /&gt;
Setting, java.class.path=C:\Users\Milton\workspace\SDA\bin;C:\Java-Libs\jmx-1_2_1-bin\lib\jmxri.jar;C:\Java-Libs\apache-log4j-1.2.15\log4j-1.2.15.jar&lt;br /&gt;
Setting, user.name=Milton&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Feature 3, Log command line options on startup==&lt;br /&gt;
The requirement is to log all command line arguments on application startup.  All command line arguments must be logged.  In Java, the entire arg array passed into the main(String args[]) method should be logged.  Any whitespace or special characters should be filtered before logged.  For example a small program that echos the input to the command line may produce an output that looks like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 *******************************************&lt;br /&gt;
    COMMAND LINE ARGS&lt;br /&gt;
 *******************************************&lt;br /&gt;
java testapp “Hello World!”&lt;br /&gt;
Hello World! &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Feature 4, Log application server properties on startup==&lt;br /&gt;
The requirement is to log all key\value pairs that influence application behavior upon execution.  In Java, there parameters are defined by HttpServlet.getInitParameterNames()  An example of logged J2EE properties may look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 *******************************************&lt;br /&gt;
    J2EE PROPERTIES&lt;br /&gt;
 *******************************************&lt;br /&gt;
Setting, thread.pool.size=1000&lt;br /&gt;
Setting, request.ttlms=30000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Feature 5, Log HTTP request parameters==&lt;br /&gt;
The requirement is to log all key\value pairs associated with all application HTTP requests.  Raw HTTP requests parameters across the cloud may generate significantly increase log volume.  The goal is to define a request log that overwrites itself (e.g., a ring buffer) at a small designer specified interval or a default of 15 mins.  This allows highly granular diagnostic messages over a short duration.&lt;br /&gt;
&lt;br /&gt;
An ancillary requirement is that sensitive key\value pairs will be masked.  A default set of masking rules will be included with the project with an option for designers to assign their own masking rules specific for their applications.&lt;br /&gt;
 &lt;br /&gt;
(TODOMS: need to insert some raw http requests from zap in a suitable log format)&lt;br /&gt;
&lt;br /&gt;
==Feature 6, Log HTTP session attributes==&lt;br /&gt;
&lt;br /&gt;
The requirement is to log all key\value pairs associated with a users HttpSession instance.  These properties should be logged once upon user session initialization.  In Java, key\value pairs from HttpSession.getAttributeName() should be logged when the HttpSession is created.&lt;br /&gt;
&lt;br /&gt;
(TODOMS: need to insert some sample HTTP session attributes)&lt;br /&gt;
&lt;br /&gt;
==Feature 7, Internationalization considerations==&lt;br /&gt;
The action is to use string resources so that logs are compatible across languages.  The project will initially define US English.  Designers are encouraged to translate resources to different languages.  If the translations are made available to us we may include them.&lt;br /&gt;
&lt;br /&gt;
==Feature 8, Redirect system streams like System.out and System.err to security logging framework==&lt;br /&gt;
This requirement captures any legacy messaging from older code without refactoring.  The approach redirects any messages to system defined streams into the logging framework.  Log messages will not be a content rich since since the caller, old code in this case, does not calling the Security API directly.  The advantage is instant out of the box compatibility with no refactoring.  In Java, the action is to capture calls like System.out.println(“My wife loves security.”) and System.err() reroute them to the logging framework without modification to legacy programs.&lt;br /&gt;
&lt;br /&gt;
An ancillary requirement is that sensitive key\value pairs will be masked.  A default set of masking rules will be included with the project with an option for designers to assign their own masking rules specific for their applications.&lt;br /&gt;
&lt;br /&gt;
==Feature 9, Asynchronous message logging, store and forward==&lt;br /&gt;
The requirement for this feature one of performance.  Log messages sent to a remote location (e.g., central log server) can take some time to send over networks.  It may be desirable in some deployments for the caller not to block when logging these messages.  The goal is to log the message locally, freeing the caller, then send the message in a background thread to the remote server.   See Feature 15 also.&lt;br /&gt;
&lt;br /&gt;
==Feature 10, Message correlation==&lt;br /&gt;
A problem with logs today is that it’s often difficult to reconstruct a series of activities leading to an event of interest.  System logs are often out of order with messages originating from different threads and hosts.  The goal of message correlation is to provide identifier(s) so that all log messages can be sequenced into a narrative of system activities leading to an event of interest.  For example, with correlation it will be possible to separate log entries to see the activities involved in a single administrative user operation like Add User.  Log entries to add a user may begin with HTTP posts from the clients browser, system permission checks, next a log message describing the insert of the new user into the user table, a log message of positive confirmation a SMTP message was sent to indicate the users new account is ready for initial signon.&lt;br /&gt;
&lt;br /&gt;
==Feature 11, Performance options for transport compression==&lt;br /&gt;
Where log message will transit networks facilities will be provided to compress traffic to remote hosts.&lt;br /&gt;
&lt;br /&gt;
==Feature 12, Authenticated client logging==&lt;br /&gt;
This feature is useful to ensure each message logged is attributable to a known source and trusted source.  Messages from anonymous sources may still be allowed, depending upon system preferences, but authenticated messages will clearly indicate the identity of the source.&lt;br /&gt;
&lt;br /&gt;
==Feature 13, Secure transport==&lt;br /&gt;
To facilitate secure transport a TLS 1.2 compliant connection be negotiated.  Options must be provided to allow designers to control ciphersuite negotiation.  Negotiation options must include provision for, a) the name of each ciphersuite permitted, b) order of negotiation which is ideally strongest suites first as a default but can be changed by the designer.  The trust roots will be those supplied by the supporting language platform (e.g., Java, .NET, etc).&lt;br /&gt;
&lt;br /&gt;
==Feature 14, Signed log messages==&lt;br /&gt;
To facilitate tamper resistant log messages log messages will be signed by the client.  Each field of the log message will be included in the signing process.  The signature will be included with the log message entry along with strongest fingerprint included within signing certificate.  The fingerprint of the signing certificate is an aid to identify the signing certificate and may be important for enterprise or cloud environments where many clients are logging.  Signed logs may or may not be encrypted.&lt;br /&gt;
&lt;br /&gt;
==Feature 15, Guaranteed log message delivery==&lt;br /&gt;
This feature builds upon the Feature 9, Asynchronous message logging, store and forward to include guaranteed delivery.  The goal is that no messages are lost.  Messages received from the caller will be queued for delivery.  Clients logging messages must block until their log message is committed to a queue.  For simplicity, the queue will exist on the client computer.  The function is somewhat analogous to a local print spooler.  If committing to a queue is not possible an instance of a RuntimeException must be thrown to the caller.  Once committed to a queue, worker threads will send the message in the background to the remote server.  On the client, worker threads will not remove the log message from the queue until the server has acknowledged receipt.&lt;br /&gt;
&lt;br /&gt;
From the server side, the server must maintain the client connection until the message is logged.  If the message cannot be logged an instance of an Exception must be thrown.  Using this system no message will ever be lost.  A message will exist in only 3 states, 1) with the blocked client, 2) within the client’s log queue, 3) logged on the server.  For a completely reliable solution, HA hardware and RAID media are required which is a consideration for system designers.&lt;br /&gt;
&lt;br /&gt;
==Feedback==&lt;br /&gt;
Please report any concerns, correction, or other feedback to any of the project leads listed on the main project page.&lt;br /&gt;
&lt;br /&gt;
=Minimum Viable Product=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
This page is where you should indicate what is the minimum set of functionality that is required to make this a useful product that addresses your core security concern.&lt;br /&gt;
Defining this information helps the project leader to think about what is the critical functionality that a user needs for this project to be useful, thereby helping determine what the priorities should be on the roadmap.  And it also helps reviewers who are evaluating the project to determine if the functionality sufficiently provides the critical functionality to determine if the project should be promoted to the next project category.  &lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Project About=&lt;br /&gt;
&amp;lt;!-- Instructions are in RED and should be removed from your document by deleting the text with the span tags.--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
	This page is where you need to place your legacy project template page if your project was created before October 2013. To edit this page you will need to edit your project information template. You can typically find this page by following this address and substituting your project name where it says &amp;quot;OWASP_Example_Project&amp;quot;. When in doubt, ask the OWASP Projects Manager. &lt;br /&gt;
Example template page: https://www.owasp.org/index.php/Projects/OWASP_Example_Project&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{:Projects/OWASP_Example_Project_About_Page}} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project]]  [[Category:OWASP_Builders]] [[Category:OWASP_Defenders]]  [[Category:OWASP_Code]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Security_Logging_Project&amp;diff=218837</id>
		<title>OWASP Security Logging Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Security_Logging_Project&amp;diff=218837"/>
				<updated>2016-07-12T08:24:42Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: /* Classifications */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Main=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:OWASP_Project_Header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
==OWASP Security Logging Project==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The OWASP Security Logging project provides developers and ops personnel with APIs for logging security-related events. The aim is to let developers use the same set of logging APIs they are already familiar with from over a decade of experience with Log4J and its successors, while also adding powerful security features.&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
Logging is often neglected by developers when thinking of security considerations. However, proper logging practice can provide the crucial forensics needed to investigate after a breach, and perhaps more importantly, a change to detect security issues as they happen. Most developers are already familiar with using logging for debugging and diagnostic purposes, so it should be easy for them to grasp the concept of security logging as well. The OWASP Security Logging project aims to give developers an easy way to get started with logging security events, tracking extra forensic information like the who (username), what (event type), and where (IP address, server name) needed for forensics. It also provides a means for classifying the information in log messages and applying masking if necessary.  &lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
This library is free software: you can redistribute it and/or modify it under the terms of the Apache License, Version 2.0. You can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== Quick Start ==&lt;br /&gt;
Overview of benefits and what you need to get started quickly.&lt;br /&gt;
&lt;br /&gt;
[http://www.securitycurmudgeon.com/2016/03/owasp-security-logging-project-explored.html OWASP Security Logging Project Explored]&lt;br /&gt;
&lt;br /&gt;
== Project Resources ==&lt;br /&gt;
[https://github.com/javabeanz/owasp-security-logging Source Code]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/javabeanz/owasp-security-logging/wiki Documentation]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/javabeanz/owasp-security-logging/issues Issue Tracker]&lt;br /&gt;
&lt;br /&gt;
== Related Projects ==&lt;br /&gt;
* [[Logging_Cheat_Sheet|Logging Cheat Sheet]]&lt;br /&gt;
&lt;br /&gt;
==Classifications==&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_CODE.jpg|link=]]&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot; rowspan=&amp;quot;2&amp;quot;| [[File:Owasp-incubator-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Incubator_Projects|Incubator Project]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-builders-small.png|link=Builders]]  &lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=Defenders]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [http://www.apache.org/licenses/LICENSE-2.0.html ASLv2]&lt;br /&gt;
   |}&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== Project Leaders ==&lt;br /&gt;
[mailto:sytze.vonkoningsveld@owasp.org Sytze van Koningsveld]&lt;br /&gt;
&lt;br /&gt;
[mailto:august.detlefsen@owasp.org August Detlefsen] &lt;br /&gt;
&lt;br /&gt;
[mailto:milton.smith@owasp.org Milton Smith]&lt;br /&gt;
&lt;br /&gt;
== News and Events ==&lt;br /&gt;
&lt;br /&gt;
1 Jul 2016, [http://www.slideshare.net/MiltonSmith6/how-to-use-owasp-security-logging How to Use OWASP Security Logging, AppSecEU 2016 Lightning Talk]&lt;br /&gt;
&lt;br /&gt;
5 Mar 2015, Version 1.0.0 deployed to Maven Central&lt;br /&gt;
&lt;br /&gt;
23 Dec 2014, Project Created and source code now available!&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;paypal&amp;gt;OWASP Security Logging Project&amp;lt;/paypal&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FAQs=&lt;br /&gt;
&lt;br /&gt;
The following provides answers to frequently asked questions.&lt;br /&gt;
&lt;br /&gt;
==How can I participate in your project?==&lt;br /&gt;
All you have to do is make the Project Leader's aware of your available time to contribute to the project. It is also important to let the Leader's know how you would like to contribute and pitch in to help the project meet it's goals and milestones. There are many different ways you can contribute to an OWASP Project, but communication with the leads is key. &lt;br /&gt;
&lt;br /&gt;
==If I am not a programmer can I participate in your project?==&lt;br /&gt;
Yes, you can certainly participate in the project if you are not a programmer or technical. The project needs different skills and expertise and different times during its development. Currently, we are looking for researchers, writers, graphic designers, and a project administrator.&lt;br /&gt;
&lt;br /&gt;
= Acknowledgements =&lt;br /&gt;
==Volunteers==&lt;br /&gt;
&lt;br /&gt;
Only project leads for the moment.  Email projects leads if you would like to participate.&lt;br /&gt;
&lt;br /&gt;
=Roadmap &amp;amp; Getting Involved=&lt;br /&gt;
&lt;br /&gt;
Today many logging technologies are available providing powerful application logging capabilities.  But while powerful, these technologies are not designed for specific use-cases like security and auditing.  The generalized approach to logging platforms makes these platforms more useful to the widest possible audience but it also places more responsibility on designers.  In short, we don't consider our desire for additional improvement for security and audit logs is no oversight on the part of logging platform designers.&lt;br /&gt;
&lt;br /&gt;
It's the OWASP Security Logging Project desire to leverage existing technologies and apply them to improve security, audit, in addition to diagnostic logging.  We understand logging is mostly an afterthought on many project schedules, if it's included at all.   We believe a logging solution embracing this project will help the community produce better logs, a better understanding of our information systems, and higher quality software.&lt;br /&gt;
&lt;br /&gt;
==Getting involved==&lt;br /&gt;
Are you passionate about logging?  Are you motivated share your time and knowledge with the community?  Send the project leads an email, listed on project home page, and explain your ideas and how you can help.  Don't be discouraged if we don't immediately respond.  We occasionally get distracted with life but rest assured we will respond.&lt;br /&gt;
&lt;br /&gt;
==What is the OWASP Security Logging Project?==&lt;br /&gt;
OWASP Security Logging Project purpose is to deliver a suitable logging solution for general-purpose security, audit, and diagnostics log messaging.  Beyond code and technology, the project provides architectural and implementation considerations you may find useful in your own projects, or technologies you may not have previously considered.&lt;br /&gt;
&lt;br /&gt;
==Project goals==&lt;br /&gt;
* Develop a set of logging requirements for key domains like security, auditing, and diagnostics&lt;br /&gt;
* Develop interface specifications that support the projects requirements&lt;br /&gt;
* Develop a base implementation supporting project interface specifications&lt;br /&gt;
* Develop documentation artifacts (described later)&lt;br /&gt;
&lt;br /&gt;
==Considerations and restraints==&lt;br /&gt;
* Ease of use&lt;br /&gt;
* Compelling value on initial deployment (without any refactoring).  Increased value for refactoring&lt;br /&gt;
* Compatibility with existing industry standard logging technologies (e.g., log4*, logback, FluentD, etc) &lt;br /&gt;
* Typical scenarios considered, 1) stand-alone applications on mobile or desktop, 2) enterprise applications, and 3) cloud-based applications.&lt;br /&gt;
&lt;br /&gt;
==Anticipated support==&lt;br /&gt;
* Java 1.7 and Java 1.8&lt;br /&gt;
* .NET (tbd)&lt;br /&gt;
''We have considered other platforms for the future but everything depends upon community interest and support.''&lt;br /&gt;
&lt;br /&gt;
==Proposed features==&lt;br /&gt;
Following is a list of numbered features.  &lt;br /&gt;
&lt;br /&gt;
:1. MDC metadata improvements&lt;br /&gt;
:: a. process id (TBD)&lt;br /&gt;
:: b. application id and application instance id&lt;br /&gt;
:: c. server time\date in UTC &lt;br /&gt;
:: d. client time\date in UTC &lt;br /&gt;
:: e. client IP address &lt;br /&gt;
:: f. username or ID &lt;br /&gt;
:: g. global client session ID&lt;br /&gt;
:: h. security policy identifier&lt;br /&gt;
:: i. transaction id&lt;br /&gt;
:2. Log system properties on startup&lt;br /&gt;
:3. Log command line options on startup&lt;br /&gt;
:4. Log application server properties on startup&lt;br /&gt;
:5. Log HTTP request parameters &lt;br /&gt;
:6. Log HTTP session attributes&lt;br /&gt;
:7. Internationalization considerations&lt;br /&gt;
:8. Redirect system streams like system.out and system.err security logging framework&lt;br /&gt;
:9. Asynchronous message logging, store and forward&lt;br /&gt;
:10. Message correlation&lt;br /&gt;
:11. Performance options for transport compression&lt;br /&gt;
:12. Authenticated client logging&lt;br /&gt;
:13. Secure log message transport&lt;br /&gt;
:14. Signed log messages&lt;br /&gt;
:15. Guaranteed log message delivery&lt;br /&gt;
&lt;br /&gt;
==Delivery phases==&lt;br /&gt;
'''Alpha 1''', some features code complete.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Alpha 2''', more features code complete.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Beta''', release code complete.  Public encouraged to test and respond with comments.&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Early Availability(EA)''', includes improvements to beta based upon public and team recommendations.&amp;lt;br/&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==Use-case applicability &amp;amp; delivery schedule==&lt;br /&gt;
The following table shows a proposed applicability of each feature to the projects areas of concern, diagnostics, security, and audit logging along with a suggested delivery phase.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;color:#555555; background-color:#ffffcc;&amp;quot; cellpadding=&amp;quot;10&amp;quot;&lt;br /&gt;
!&amp;amp;nbsp;&lt;br /&gt;
!Diagnostics&lt;br /&gt;
!Security&lt;br /&gt;
!Audit&lt;br /&gt;
!Delivery&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1a, process id&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1b, application id and application instance id&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1c, server time\date in UTC&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1d, client time\date in UTC&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1e, client IP address&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1f, username or ID&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1g, global client session ID&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1h, security policy identifier&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''M'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 1i, transaction id&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 2, Log system properties on startup&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 3, Log command line properties on startup&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 4, Log application server properties on startup&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 5, Log HTTP request parameters&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 6, Log HTTP session attributes&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''?'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 7, Internationalization considerations&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 8, Redirect system streams like System.out and System.err to logging framework&lt;br /&gt;
|'''X'''&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 9, Asynchronous message logging, store and forward&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 10, Message correlation&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 11, Performance options for transport compression&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 12, Authenticated client logging&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 13, Secure log message transport&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|-&lt;br /&gt;
|Feature 14, Signed log messages&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 1&lt;br /&gt;
|-&lt;br /&gt;
|Feature 15, Guaranteed log message delivery&lt;br /&gt;
|&amp;amp;nbsp;&lt;br /&gt;
|'''X'''&lt;br /&gt;
|'''X'''&lt;br /&gt;
|Alpha 2&lt;br /&gt;
|}&lt;br /&gt;
'''''Legend, X=applicable use-case, M=maybe useful, ?=tbd'''''&lt;br /&gt;
&lt;br /&gt;
==Project delivery artifacts==&lt;br /&gt;
:'''Logging primer''', architectural considerations for security, audit, and diagnostics for community projects.  Provide information how logging project can be leverage to address concerns provided by each use case, general logging best practices, template for using message levels (e.g., INFO, WARN, etc).&lt;br /&gt;
:'''Logging design''', specific technical details to apply project logging to community logging projects.&lt;br /&gt;
:'''Code''', software program code that implements project feature goals.&lt;br /&gt;
&lt;br /&gt;
==Code areas==&lt;br /&gt;
:'''Logging layouts''', at the moment this is Common Event Format(CEF) and Common Log File System(CLFS).&lt;br /&gt;
:'''MDC filter''', include system information handy for most deployments into logbacks Mapped Diagnostics Context(MDC).&lt;br /&gt;
:'''MDC marker''',&lt;br /&gt;
:'''Unit testing''', various software code we use (and you can also use) to test project code.&lt;br /&gt;
&lt;br /&gt;
==Detailed use-case descriptions==&lt;br /&gt;
Following are detailed use-case descriptions for each feature.  The purpose of this section is to help readers to understand more about each feature and it's potential benefits.&lt;br /&gt;
&lt;br /&gt;
==Feature 1, MDC metadata improvements==&lt;br /&gt;
This feature adds certain metadata useful for security purposes to logback’s Mapped Diagnostics Content.  The following metadata will be mapped where available.&lt;br /&gt;
&lt;br /&gt;
===process id (feature 1a)===&lt;br /&gt;
This is the process id of the application as assigned by the operating system at execution.  On *nix and Windows environments this the PID.  Depending upon the language platform process id may not be readily available.  As an alternative, server hostname or IP may be used.&lt;br /&gt;
&lt;br /&gt;
===application id and application instance id (feature 1b)===&lt;br /&gt;
This an identifier set by the application designer to identify a unique application instance.  This identifier is useful to identify applications uniquely where many instances of the same program (e.g., web application) are hosted on 1 or more physical servers.  The application id is useful visual indicator of the type of application component.  The instance id is useful to identify the application instance.  The instance is particularly useful where the same process may host 2 or more application instances.  An instance id may be a generated hash (e.g., VMID) or unique index where size is a concern.  Once the id is used it should persist between process restarts.  A suggested format:  {APP ID}:{APP INSTANCE ID}.  An sample POS:ace22c02aa858f670e3c227fbab141e2d8d6bea6 or POS:14563.&lt;br /&gt;
&lt;br /&gt;
===server time\date in UTC (feature 1c)===&lt;br /&gt;
Time, date, and day, on the server with timezone offset at the time the message was logged.  A suggested format[1], {yyyy-MM-dd'T'HH:mm:ss.SSSZ}.  An example, 2001-07-04T12:08:56.235-0700&lt;br /&gt;
&lt;br /&gt;
===client time\date in UTC (feature 1d)===&lt;br /&gt;
Time, date, and day, on the client with timezone offset at the time the message was logged.  A suggested format[1], {yyyy-MM-dd'T'HH:mm:ss.SSSZ}.  An example, 2001-07-04T12:08:56.235-0700&lt;br /&gt;
&lt;br /&gt;
===client ip address (feature 1e)===&lt;br /&gt;
MDC property for the IP address of the client host where the log message originated.  An example, 192.168.1.30&lt;br /&gt;
&lt;br /&gt;
===user name or ID (feature 1f)===&lt;br /&gt;
This MDC property to property is an application account name associated with a human (if available) this is associated with this log message.  This property may not be available if the log message is not specifically related to an individual's activity.  An example, milton.smith&lt;br /&gt;
&lt;br /&gt;
===global client session id (feature 1g)===&lt;br /&gt;
This MDC property is a session id assigned by an application designer that is shared across multiple application instances.  Usually this is a secure hash to avoid reverse engineering.  An example, ace22c02aa858f670e3c227fbab141e2d8d6bea6&lt;br /&gt;
&lt;br /&gt;
===security policy identifier (feature 1h)===&lt;br /&gt;
MDC property that identifies activities associated with a sites security policy.  The value is site defined and can be useful when producing information for audits.  An example, Violation:SEC.5.2a&lt;br /&gt;
&lt;br /&gt;
===transaction id (feature 1i)===&lt;br /&gt;
MDC property to identify activities associated with a single user action.  For example, execution of a single application user feature may require many activities from the main application program along with components like LDAP servers and databases.  The transaction id is useful to correlate all the related system activities that support a specific user request.  Each subsequent user request receives a new transaction id.  An example, TRX:1005862&lt;br /&gt;
&lt;br /&gt;
==Feature 2, Log system properties on startup==&lt;br /&gt;
The requirement is to log all system properties on application startup.  Often it’s difficult to perform an investigation without understanding the initial state of the system.  An example how properties may appear in logs (without MDC information).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 *******************************************&lt;br /&gt;
 JAVA PROPERTY SETTINGS&lt;br /&gt;
 *******************************************&lt;br /&gt;
Setting, java.runtime.name=Java(TM) SE Runtime Environment&lt;br /&gt;
Setting, sun.boot.library.path=C:\Program Files\Java\jre6\bin&lt;br /&gt;
Setting, java.vm.version=14.0-b16&lt;br /&gt;
Setting, java.vm.vendor=Sun Microsystems Inc.&lt;br /&gt;
Setting, java.vendor.url=http://java.sun.com/&lt;br /&gt;
Setting, path.separator=;&lt;br /&gt;
Setting, java.vm.name=Java HotSpot(TM) Client VM&lt;br /&gt;
Setting, file.encoding.pkg=sun.io&lt;br /&gt;
Setting, sun.java.launcher=SUN_STANDARD&lt;br /&gt;
 Setting, user.country=US&lt;br /&gt;
Setting, sun.os.patch.level=&lt;br /&gt;
Setting, java.vm.specification.name=Java Virtual Machine Specification&lt;br /&gt;
Setting, user.dir=C:\Users\Milton\workspace\MyProject&lt;br /&gt;
Setting, java.runtime.version=1.6.0_14-b08&lt;br /&gt;
Setting, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment&lt;br /&gt;
Setting, java.endorsed.dirs=C:\Program Files\Java\jre6\lib\endorsed&lt;br /&gt;
Setting, os.arch=x86&lt;br /&gt;
Setting, java.io.tmpdir=C:\Users\Milton\AppData\Local\Temp\&lt;br /&gt;
Setting, line.separator=&lt;br /&gt;
    &lt;br /&gt;
Setting, java.vm.specification.vendor=Sun Microsystems Inc.&lt;br /&gt;
Setting, user.variant=&lt;br /&gt;
Setting, os.name=Windows 7&lt;br /&gt;
Setting, sun.jnu.encoding=Cp1252&lt;br /&gt;
Setting, java.library.path=C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\Program Files\JavaFX\javafx-sdk1.2\bin;C:\Program Files\JavaFX\javafx-sdk1.2\emulator\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\usershellcommands;C:\Program Files\QuickTime\QTSystem\&lt;br /&gt;
 Setting, java.specification.name=Java Platform API Specification&lt;br /&gt;
Setting, java.class.version=50.0&lt;br /&gt;
Setting, sun.management.compiler=HotSpot Client Compiler&lt;br /&gt;
Setting, os.version=6.1&lt;br /&gt;
Setting, user.home=C:\Users\Milton&lt;br /&gt;
Setting, user.timezone=&lt;br /&gt;
Setting, java.awt.printerjob=sun.awt.windows.WPrinterJob&lt;br /&gt;
Setting, file.encoding=Cp1252&lt;br /&gt;
Setting, java.specification.version=1.6&lt;br /&gt;
Setting, java.class.path=C:\Users\Milton\workspace\SDA\bin;C:\Java-Libs\jmx-1_2_1-bin\lib\jmxri.jar;C:\Java-Libs\apache-log4j-1.2.15\log4j-1.2.15.jar&lt;br /&gt;
Setting, user.name=Milton&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Feature 3, Log command line options on startup==&lt;br /&gt;
The requirement is to log all command line arguments on application startup.  All command line arguments must be logged.  In Java, the entire arg array passed into the main(String args[]) method should be logged.  Any whitespace or special characters should be filtered before logged.  For example a small program that echos the input to the command line may produce an output that looks like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 *******************************************&lt;br /&gt;
    COMMAND LINE ARGS&lt;br /&gt;
 *******************************************&lt;br /&gt;
java testapp “Hello World!”&lt;br /&gt;
Hello World! &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Feature 4, Log application server properties on startup==&lt;br /&gt;
The requirement is to log all key\value pairs that influence application behavior upon execution.  In Java, there parameters are defined by HttpServlet.getInitParameterNames()  An example of logged J2EE properties may look like the following.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 *******************************************&lt;br /&gt;
    J2EE PROPERTIES&lt;br /&gt;
 *******************************************&lt;br /&gt;
Setting, thread.pool.size=1000&lt;br /&gt;
Setting, request.ttlms=30000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Feature 5, Log HTTP request parameters==&lt;br /&gt;
The requirement is to log all key\value pairs associated with all application HTTP requests.  Raw HTTP requests parameters across the cloud may generate significantly increase log volume.  The goal is to define a request log that overwrites itself (e.g., a ring buffer) at a small designer specified interval or a default of 15 mins.  This allows highly granular diagnostic messages over a short duration.&lt;br /&gt;
&lt;br /&gt;
An ancillary requirement is that sensitive key\value pairs will be masked.  A default set of masking rules will be included with the project with an option for designers to assign their own masking rules specific for their applications.&lt;br /&gt;
 &lt;br /&gt;
(TODOMS: need to insert some raw http requests from zap in a suitable log format)&lt;br /&gt;
&lt;br /&gt;
==Feature 6, Log HTTP session attributes==&lt;br /&gt;
&lt;br /&gt;
The requirement is to log all key\value pairs associated with a users HttpSession instance.  These properties should be logged once upon user session initialization.  In Java, key\value pairs from HttpSession.getAttributeName() should be logged when the HttpSession is created.&lt;br /&gt;
&lt;br /&gt;
(TODOMS: need to insert some sample HTTP session attributes)&lt;br /&gt;
&lt;br /&gt;
==Feature 7, Internationalization considerations==&lt;br /&gt;
The action is to use string resources so that logs are compatible across languages.  The project will initially define US English.  Designers are encouraged to translate resources to different languages.  If the translations are made available to us we may include them.&lt;br /&gt;
&lt;br /&gt;
==Feature 8, Redirect system streams like System.out and System.err to security logging framework==&lt;br /&gt;
This requirement captures any legacy messaging from older code without refactoring.  The approach redirects any messages to system defined streams into the logging framework.  Log messages will not be a content rich since since the caller, old code in this case, does not calling the Security API directly.  The advantage is instant out of the box compatibility with no refactoring.  In Java, the action is to capture calls like System.out.println(“My wife loves security.”) and System.err() reroute them to the logging framework without modification to legacy programs.&lt;br /&gt;
&lt;br /&gt;
An ancillary requirement is that sensitive key\value pairs will be masked.  A default set of masking rules will be included with the project with an option for designers to assign their own masking rules specific for their applications.&lt;br /&gt;
&lt;br /&gt;
==Feature 9, Asynchronous message logging, store and forward==&lt;br /&gt;
The requirement for this feature one of performance.  Log messages sent to a remote location (e.g., central log server) can take some time to send over networks.  It may be desirable in some deployments for the caller not to block when logging these messages.  The goal is to log the message locally, freeing the caller, then send the message in a background thread to the remote server.   See Feature 15 also.&lt;br /&gt;
&lt;br /&gt;
==Feature 10, Message correlation==&lt;br /&gt;
A problem with logs today is that it’s often difficult to reconstruct a series of activities leading to an event of interest.  System logs are often out of order with messages originating from different threads and hosts.  The goal of message correlation is to provide identifier(s) so that all log messages can be sequenced into a narrative of system activities leading to an event of interest.  For example, with correlation it will be possible to separate log entries to see the activities involved in a single administrative user operation like Add User.  Log entries to add a user may begin with HTTP posts from the clients browser, system permission checks, next a log message describing the insert of the new user into the user table, a log message of positive confirmation a SMTP message was sent to indicate the users new account is ready for initial signon.&lt;br /&gt;
&lt;br /&gt;
==Feature 11, Performance options for transport compression==&lt;br /&gt;
Where log message will transit networks facilities will be provided to compress traffic to remote hosts.&lt;br /&gt;
&lt;br /&gt;
==Feature 12, Authenticated client logging==&lt;br /&gt;
This feature is useful to ensure each message logged is attributable to a known source and trusted source.  Messages from anonymous sources may still be allowed, depending upon system preferences, but authenticated messages will clearly indicate the identity of the source.&lt;br /&gt;
&lt;br /&gt;
==Feature 13, Secure transport==&lt;br /&gt;
To facilitate secure transport a TLS 1.2 compliant connection be negotiated.  Options must be provided to allow designers to control ciphersuite negotiation.  Negotiation options must include provision for, a) the name of each ciphersuite permitted, b) order of negotiation which is ideally strongest suites first as a default but can be changed by the designer.  The trust roots will be those supplied by the supporting language platform (e.g., Java, .NET, etc).&lt;br /&gt;
&lt;br /&gt;
==Feature 14, Signed log messages==&lt;br /&gt;
To facilitate tamper resistant log messages log messages will be signed by the client.  Each field of the log message will be included in the signing process.  The signature will be included with the log message entry along with strongest fingerprint included within signing certificate.  The fingerprint of the signing certificate is an aid to identify the signing certificate and may be important for enterprise or cloud environments where many clients are logging.  Signed logs may or may not be encrypted.&lt;br /&gt;
&lt;br /&gt;
==Feature 15, Guaranteed log message delivery==&lt;br /&gt;
This feature builds upon the Feature 9, Asynchronous message logging, store and forward to include guaranteed delivery.  The goal is that no messages are lost.  Messages received from the caller will be queued for delivery.  Clients logging messages must block until their log message is committed to a queue.  For simplicity, the queue will exist on the client computer.  The function is somewhat analogous to a local print spooler.  If committing to a queue is not possible an instance of a RuntimeException must be thrown to the caller.  Once committed to a queue, worker threads will send the message in the background to the remote server.  On the client, worker threads will not remove the log message from the queue until the server has acknowledged receipt.&lt;br /&gt;
&lt;br /&gt;
From the server side, the server must maintain the client connection until the message is logged.  If the message cannot be logged an instance of an Exception must be thrown.  Using this system no message will ever be lost.  A message will exist in only 3 states, 1) with the blocked client, 2) within the client’s log queue, 3) logged on the server.  For a completely reliable solution, HA hardware and RAID media are required which is a consideration for system designers.&lt;br /&gt;
&lt;br /&gt;
==Feedback==&lt;br /&gt;
Please report any concerns, correction, or other feedback to any of the project leads listed on the main project page.&lt;br /&gt;
&lt;br /&gt;
=Minimum Viable Product=&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
This page is where you should indicate what is the minimum set of functionality that is required to make this a useful product that addresses your core security concern.&lt;br /&gt;
Defining this information helps the project leader to think about what is the critical functionality that a user needs for this project to be useful, thereby helping determine what the priorities should be on the roadmap.  And it also helps reviewers who are evaluating the project to determine if the functionality sufficiently provides the critical functionality to determine if the project should be promoted to the next project category.  &lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Project About=&lt;br /&gt;
&amp;lt;!-- Instructions are in RED and should be removed from your document by deleting the text with the span tags.--&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt;&lt;br /&gt;
	This page is where you need to place your legacy project template page if your project was created before October 2013. To edit this page you will need to edit your project information template. You can typically find this page by following this address and substituting your project name where it says &amp;quot;OWASP_Example_Project&amp;quot;. When in doubt, ask the OWASP Projects Manager. &lt;br /&gt;
Example template page: https://www.owasp.org/index.php/Projects/OWASP_Example_Project&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{:Projects/OWASP_Example_Project_About_Page}} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project]]  [[Category:OWASP_Builders]] [[Category:OWASP_Defenders]]  [[Category:OWASP_Code]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Bean_Validation_Cheat_Sheet&amp;diff=218826</id>
		<title>Bean Validation Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Bean_Validation_Cheat_Sheet&amp;diff=218826"/>
				<updated>2016-07-11T18:48:56Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: added cascading validation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
= Bean Validation Introduction =&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
&lt;br /&gt;
This article is focused on providing clear, simple, actionable guidance for providing Java Bean Validation security functionality in your applications. &lt;br /&gt;
&lt;br /&gt;
Bean validation (JSR303 aka [http://beanvalidation.org/1.0/spec/ Bean Validation 1.0] /JSR349 aka [http://beanvalidation.org/1.1/spec/ Bean Validation 1.1]) is one of the most common ways to perform [https://www.owasp.org/index.php/Input_Validation_Cheat_Sheet input validation] in Java. It is an application layer agnostic validation spec which provides the developer with the means to define a set of validation constraints on a domain model and then perform validation of those constraints through out the  various application tiers.&lt;br /&gt;
&lt;br /&gt;
One advantage of this approach is that the validation constraints and the corresponding validators are only written once, thus reducing duplication of effort and ensuring uniformity:&lt;br /&gt;
&lt;br /&gt;
== Typical Validation ==&lt;br /&gt;
&lt;br /&gt;
https://www.owasp.org/images/d/db/Bean_validation_typical.jpg&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== Bean Validation ==&lt;br /&gt;
&lt;br /&gt;
https://www.owasp.org/images/6/69/Bean_validation_jsr.jpg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
The examples in this guide use Hibernate Validator (the reference implementation for Bean Validation 1.1).&lt;br /&gt;
&lt;br /&gt;
Add Hibernate Validator to your pom.xml :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;dependency&amp;gt;&lt;br /&gt;
      &amp;lt;groupId&amp;gt;org.hibernate&amp;lt;/groupId&amp;gt;&lt;br /&gt;
      &amp;lt;artifactId&amp;gt;hibernate-validator&amp;lt;/artifactId&amp;gt;&lt;br /&gt;
      &amp;lt;version&amp;gt;5.2.4.Final&amp;lt;/version&amp;gt;&lt;br /&gt;
   &amp;lt;/dependency&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enable bean validation support in Spring's context.xml&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;beans:beans ...&lt;br /&gt;
   ...&lt;br /&gt;
   &amp;lt;mvc:annotation-driven /&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
   &amp;lt;/beans:beans&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more info, please see the [http://hibernate.org/validator/documentation/getting-started/ setup guide]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
In order to get started using Bean Validation, you must add validation constraints (&amp;lt;code&amp;gt;@Pattern, @Digits, @Min, @Max, @Size, @Past, @Future, @CreditCardNumber, @Email, @URL&amp;lt;/code&amp;gt;, etc.) to your model and then utilize the &amp;lt;code&amp;gt;@Valid&amp;lt;/code&amp;gt; annotation when passing your model around in various application layers.&lt;br /&gt;
&lt;br /&gt;
Constraints can be applied in several places:&lt;br /&gt;
* Fields&lt;br /&gt;
* Properties&lt;br /&gt;
* Classes&lt;br /&gt;
&lt;br /&gt;
For Bean Validation 1.1 also on:&lt;br /&gt;
* Parameters&lt;br /&gt;
* Return values&lt;br /&gt;
* Constructors&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity all the examples below feature field constraints and all validation is triggered by the controller. Refer to the Bean Validation documentation for a full list of examples.&lt;br /&gt;
&lt;br /&gt;
When it comes to error handling, the Hibernate Validator returns a &amp;lt;code&amp;gt;BindingResult&amp;lt;/code&amp;gt; object which contains a &amp;lt;code&amp;gt;List&amp;lt;ObjectError&amp;gt;&amp;lt;/code&amp;gt;. The examples below feature simplistic error handling, while a production ready application would have a more elaborate design that takes care of logging and error page redirection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Pre-defined Constraints =&lt;br /&gt;
&lt;br /&gt;
== @Pattern ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Pattern(regex=,flag=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': CharSequence&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks if the annotated string matches the regular expression regex considering the given flag match. Please visit [[OWASP Validation Regex Repository]] for other useful regex's.&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Pattern&lt;br /&gt;
   &lt;br /&gt;
   public class Article {&lt;br /&gt;
   &lt;br /&gt;
   	   //Constraint: Alpha Numeric article titles only using a regular expression&lt;br /&gt;
   	   @Pattern(regexp = &amp;quot;[a-zA-Z0-9 ]&amp;quot;)&lt;br /&gt;
   	   private String articleTitle;&lt;br /&gt;
      &lt;br /&gt;
   	   public String getArticleTitle() {&lt;br /&gt;
   	      	return articleTitle;&lt;br /&gt;
   	   }&lt;br /&gt;
   &lt;br /&gt;
   	   public void setArticleTitle(String articleTitle) {&lt;br /&gt;
   		   this.articleTitle = articleTitle;&lt;br /&gt;
   	   }	   &lt;br /&gt;
   	   &lt;br /&gt;
   	   ...&lt;br /&gt;
   	   &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
	  &lt;br /&gt;
'''Controller'''  &lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.Article;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class ArticleController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/postArticle&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
   	public @ResponseBody String postArticle(@Valid Article article, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== @Digits ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Digits(integer=,fraction=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': BigDecimal, BigInteger, CharSequence, byte, short, int, long and the respective wrappers of the primitive types; Additionally supported by HV: any sub-type of Number&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks whether the annotated value is a number having up to integer digits and fraction fractional digits&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Digits&lt;br /&gt;
   &lt;br /&gt;
   public class Customer {&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Age can only be 3 digits long or less&lt;br /&gt;
   	@Digits(integer=3, fraction=0)&lt;br /&gt;
   	private int age;&lt;br /&gt;
   &lt;br /&gt;
   	   public String getAge() {&lt;br /&gt;
   		   return age;&lt;br /&gt;
   	   }&lt;br /&gt;
   &lt;br /&gt;
   	   public void setAge(String age) {&lt;br /&gt;
   		   this.age = age;&lt;br /&gt;
   	   }&lt;br /&gt;
   	   &lt;br /&gt;
   	   ...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.Customer;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class CustomerController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/registerCustomer&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
   	   public @ResponseBody String registerCustomer(@Valid Customer customer, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== @Size ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Size(min=, max=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': CharSequence, Collection, Map and arrays&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks if the annotated element’s size is between min and max (inclusive)&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Size&lt;br /&gt;
   &lt;br /&gt;
   public class Message {&lt;br /&gt;
   	   &lt;br /&gt;
           //Constraint: Message must be at least 10 characters long, but less than 500&lt;br /&gt;
   	   @Size(min=10, max=500)&lt;br /&gt;
   	   private String message;&lt;br /&gt;
   &lt;br /&gt;
   	   public String getMessage() {&lt;br /&gt;
   		   return message;&lt;br /&gt;
   	   }&lt;br /&gt;
   &lt;br /&gt;
   	   public void setMessage(String message) {&lt;br /&gt;
   		   this.message = message;&lt;br /&gt;
   	   }&lt;br /&gt;
   	   &lt;br /&gt;
   	   ...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.Message;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class MessageController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/sendMessage&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
      	public @ResponseBody String sendMessage(@Valid Message message, BindingResult result, HttpServletResponse response){	&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== @Past / @Future ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Past, @Future&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': java.util.Date, java.util.Calendar, java.time.chrono.ChronoZonedDateTime, java.time.Instant, java.time.OffsetDateTime&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks whether the annotated date is in the past / future&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Past&lt;br /&gt;
   import org.hibernate.validator.constraints.Future&lt;br /&gt;
   &lt;br /&gt;
   public class DoctorVisit {&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Birthdate must be in the past&lt;br /&gt;
      	@Past&lt;br /&gt;
      	private Date birthDate;&lt;br /&gt;
   &lt;br /&gt;
      	public Date getBirthDate() {&lt;br /&gt;
      		return birthDate;&lt;br /&gt;
      	}&lt;br /&gt;
      &lt;br /&gt;
      	public void setBirthDate(Date birthDate) {&lt;br /&gt;
      		this.birthDate = birthDate;&lt;br /&gt;
      	}&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Schedule visit date must be in the future&lt;br /&gt;
      	@Future&lt;br /&gt;
      	private String scheduledVisitDate;&lt;br /&gt;
   &lt;br /&gt;
      	public String getScheduledVisitDate() {&lt;br /&gt;
      		return scheduledVisitDate;&lt;br /&gt;
      	}&lt;br /&gt;
   &lt;br /&gt;
      	public void setScheduledVisitDate(String scheduledVisitDate) {&lt;br /&gt;
      		this.scheduledVisitDate = scheduledVisitDate;&lt;br /&gt;
      	}&lt;br /&gt;
      	&lt;br /&gt;
   	...&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.DoctorVisit;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class DoctorVisitController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/scheduleVisit&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
      	public @ResponseBody String scheduleVisit(@Valid DoctorVisit doctorvisit, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== Combining Constraints ==&lt;br /&gt;
Validation annotations can be combined in any suitable way. For instance, to specify a valid reviewRating value between 1 and 5, specify the validation like this :&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Min(value=), @Max(value=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': BigDecimal, BigInteger, byte, short, int, long and the respective wrappers of the primitive types; Additionally supported by HV: any sub-type of CharSequence (the numeric value represented by the character sequence is evaluated), any sub-type of Number&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks whether the annotated value is higher/lower than or equal to the specified minimum&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Min&lt;br /&gt;
   import org.hibernate.validator.constraints.Max&lt;br /&gt;
   &lt;br /&gt;
   public class Review {&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Review rating must be between 1 and 5&lt;br /&gt;
      	@Min(1)&lt;br /&gt;
      	@Max(5)&lt;br /&gt;
      	private int reviewRating;&lt;br /&gt;
   &lt;br /&gt;
      	public int getReviewRating() {&lt;br /&gt;
      		return reviewRating;&lt;br /&gt;
      	}&lt;br /&gt;
   &lt;br /&gt;
      	public void setReviewRating(int reviewRating) {&lt;br /&gt;
      		this.reviewRating = reviewRating;&lt;br /&gt;
   	   }&lt;br /&gt;
   	&lt;br /&gt;
   	...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.ReviewRating;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class ReviewController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/postReview&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
      	public @ResponseBody String postReview(@Valid Review review, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Cascading Constraints ==&lt;br /&gt;
&lt;br /&gt;
Validating one bean is a good start, but often, beans are nested or in a complete graph of beans. To validate that graph in one go, apply casding valiation with @Valid [http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch03.html#_cascaded_validation]&lt;br /&gt;
&lt;br /&gt;
== Additional Constraints == &lt;br /&gt;
&lt;br /&gt;
In addition to providing the complete set of JSR303 constraints, Hibernate Validator also defines some additional constraints for convenience:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;@CreditCardNumber&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@EAN&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@Email&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@Length&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@Range&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@SafeHtml&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@ScriptAssert&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@URL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#table-custom-constraints&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Custom Constraints =&lt;br /&gt;
&lt;br /&gt;
One of the most powerful features of bean validation is the ability to define your own constraints that go beyond the simple validation offered by built in constraints.&lt;br /&gt;
&lt;br /&gt;
Creating custom constraints is beyond the scope of this guide. Please see http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch06.html&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Error Messages =&lt;br /&gt;
It is possible to specify a meesage ID with the validation annotation, so that error messages are customized :&lt;br /&gt;
&lt;br /&gt;
            @Pattern(regexp = &amp;quot;[a-zA-Z0-9 ]&amp;quot;, message=&amp;quot;article.title.error&amp;quot;)&lt;br /&gt;
   	   private String articleTitle;&lt;br /&gt;
&lt;br /&gt;
Spring MVC will then look up a message with id &amp;quot;article.title.error&amp;quot; in a defined MessageSource. More on this [http://www.silverbaytech.com/2013/04/16/custom-messages-in-spring-validation/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
Anton Abashkin - abashkin.anton [at] gmail.com&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Bean_Validation_Cheat_Sheet&amp;diff=218823</id>
		<title>Bean Validation Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Bean_Validation_Cheat_Sheet&amp;diff=218823"/>
				<updated>2016-07-11T17:53:29Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: Move Min Max to new paragraph&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
= Bean Validation Introduction =&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
&lt;br /&gt;
This article is focused on providing clear, simple, actionable guidance for providing Java Bean Validation security functionality in your applications. &lt;br /&gt;
&lt;br /&gt;
Bean validation (JSR303 aka [http://beanvalidation.org/1.0/spec/ Bean Validation 1.0] /JSR349 aka [http://beanvalidation.org/1.1/spec/ Bean Validation 1.1]) is one of the most common ways to perform [https://www.owasp.org/index.php/Input_Validation_Cheat_Sheet input validation] in Java. It is an application layer agnostic validation spec which provides the developer with the means to define a set of validation constraints on a domain model and then perform validation of those constraints through out the  various application tiers.&lt;br /&gt;
&lt;br /&gt;
One advantage of this approach is that the validation constraints and the corresponding validators are only written once, thus reducing duplication of effort and ensuring uniformity:&lt;br /&gt;
&lt;br /&gt;
== Typical Validation ==&lt;br /&gt;
&lt;br /&gt;
https://www.owasp.org/images/d/db/Bean_validation_typical.jpg&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== Bean Validation ==&lt;br /&gt;
&lt;br /&gt;
https://www.owasp.org/images/6/69/Bean_validation_jsr.jpg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
The examples in this guide use Hibernate Validator (the reference implementation for Bean Validation 1.1).&lt;br /&gt;
&lt;br /&gt;
Add Hibernate Validator to your pom.xml :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;dependency&amp;gt;&lt;br /&gt;
      &amp;lt;groupId&amp;gt;org.hibernate&amp;lt;/groupId&amp;gt;&lt;br /&gt;
      &amp;lt;artifactId&amp;gt;hibernate-validator&amp;lt;/artifactId&amp;gt;&lt;br /&gt;
      &amp;lt;version&amp;gt;5.2.4.Final&amp;lt;/version&amp;gt;&lt;br /&gt;
   &amp;lt;/dependency&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enable bean validation support in Spring's context.xml&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;beans:beans ...&lt;br /&gt;
   ...&lt;br /&gt;
   &amp;lt;mvc:annotation-driven /&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
   &amp;lt;/beans:beans&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more info, please see the [http://hibernate.org/validator/documentation/getting-started/ setup guide]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
In order to get started using Bean Validation, you must add validation constraints (&amp;lt;code&amp;gt;@Pattern, @Digits, @Min, @Max, @Size, @Past, @Future, @CreditCardNumber, @Email, @URL&amp;lt;/code&amp;gt;, etc.) to your model and then utilize the &amp;lt;code&amp;gt;@Valid&amp;lt;/code&amp;gt; annotation when passing your model around in various application layers.&lt;br /&gt;
&lt;br /&gt;
Constraints can be applied in several places:&lt;br /&gt;
* Fields&lt;br /&gt;
* Properties&lt;br /&gt;
* Classes&lt;br /&gt;
&lt;br /&gt;
For Bean Validation 1.1 also on:&lt;br /&gt;
* Parameters&lt;br /&gt;
* Return values&lt;br /&gt;
* Constructors&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity all the examples below feature field constraints and all validation is triggered by the controller. Refer to the Bean Validation documentation for a full list of examples.&lt;br /&gt;
&lt;br /&gt;
When it comes to error handling, the Hibernate Validator returns a &amp;lt;code&amp;gt;BindingResult&amp;lt;/code&amp;gt; object which contains a &amp;lt;code&amp;gt;List&amp;lt;ObjectError&amp;gt;&amp;lt;/code&amp;gt;. The examples below feature simplistic error handling, while a production ready application would have a more elaborate design that takes care of logging and error page redirection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Pre-defined Constraints =&lt;br /&gt;
&lt;br /&gt;
== @Pattern ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Pattern(regex=,flag=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': CharSequence&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks if the annotated string matches the regular expression regex considering the given flag match. Please visit [[OWASP Validation Regex Repository]] for other useful regex's.&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Pattern&lt;br /&gt;
   &lt;br /&gt;
   public class Article {&lt;br /&gt;
   &lt;br /&gt;
   	   //Constraint: Alpha Numeric article titles only using a regular expression&lt;br /&gt;
   	   @Pattern(regexp = &amp;quot;[a-zA-Z0-9 ]&amp;quot;)&lt;br /&gt;
   	   private String articleTitle;&lt;br /&gt;
      &lt;br /&gt;
   	   public String getArticleTitle() {&lt;br /&gt;
   	      	return articleTitle;&lt;br /&gt;
   	   }&lt;br /&gt;
   &lt;br /&gt;
   	   public void setArticleTitle(String articleTitle) {&lt;br /&gt;
   		   this.articleTitle = articleTitle;&lt;br /&gt;
   	   }	   &lt;br /&gt;
   	   &lt;br /&gt;
   	   ...&lt;br /&gt;
   	   &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
	  &lt;br /&gt;
'''Controller'''  &lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.Article;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class ArticleController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/postArticle&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
   	public @ResponseBody String postArticle(@Valid Article article, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== @Digits ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Digits(integer=,fraction=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': BigDecimal, BigInteger, CharSequence, byte, short, int, long and the respective wrappers of the primitive types; Additionally supported by HV: any sub-type of Number&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks whether the annotated value is a number having up to integer digits and fraction fractional digits&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Digits&lt;br /&gt;
   &lt;br /&gt;
   public class Customer {&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Age can only be 3 digits long or less&lt;br /&gt;
   	@Digits(integer=3, fraction=0)&lt;br /&gt;
   	private int age;&lt;br /&gt;
   &lt;br /&gt;
   	   public String getAge() {&lt;br /&gt;
   		   return age;&lt;br /&gt;
   	   }&lt;br /&gt;
   &lt;br /&gt;
   	   public void setAge(String age) {&lt;br /&gt;
   		   this.age = age;&lt;br /&gt;
   	   }&lt;br /&gt;
   	   &lt;br /&gt;
   	   ...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.Customer;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class CustomerController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/registerCustomer&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
   	   public @ResponseBody String registerCustomer(@Valid Customer customer, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== @Size ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Size(min=, max=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': CharSequence, Collection, Map and arrays&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks if the annotated element’s size is between min and max (inclusive)&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Size&lt;br /&gt;
   &lt;br /&gt;
   public class Message {&lt;br /&gt;
   	   &lt;br /&gt;
           //Constraint: Message must be at least 10 characters long, but less than 500&lt;br /&gt;
   	   @Size(min=10, max=500)&lt;br /&gt;
   	   private String message;&lt;br /&gt;
   &lt;br /&gt;
   	   public String getMessage() {&lt;br /&gt;
   		   return message;&lt;br /&gt;
   	   }&lt;br /&gt;
   &lt;br /&gt;
   	   public void setMessage(String message) {&lt;br /&gt;
   		   this.message = message;&lt;br /&gt;
   	   }&lt;br /&gt;
   	   &lt;br /&gt;
   	   ...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.Message;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class MessageController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/sendMessage&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
      	public @ResponseBody String sendMessage(@Valid Message message, BindingResult result, HttpServletResponse response){	&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== @Past / @Future ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Past, @Future&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': java.util.Date, java.util.Calendar, java.time.chrono.ChronoZonedDateTime, java.time.Instant, java.time.OffsetDateTime&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks whether the annotated date is in the past / future&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Past&lt;br /&gt;
   import org.hibernate.validator.constraints.Future&lt;br /&gt;
   &lt;br /&gt;
   public class DoctorVisit {&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Birthdate must be in the past&lt;br /&gt;
      	@Past&lt;br /&gt;
      	private Date birthDate;&lt;br /&gt;
   &lt;br /&gt;
      	public Date getBirthDate() {&lt;br /&gt;
      		return birthDate;&lt;br /&gt;
      	}&lt;br /&gt;
      &lt;br /&gt;
      	public void setBirthDate(Date birthDate) {&lt;br /&gt;
      		this.birthDate = birthDate;&lt;br /&gt;
      	}&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Schedule visit date must be in the future&lt;br /&gt;
      	@Future&lt;br /&gt;
      	private String scheduledVisitDate;&lt;br /&gt;
   &lt;br /&gt;
      	public String getScheduledVisitDate() {&lt;br /&gt;
      		return scheduledVisitDate;&lt;br /&gt;
      	}&lt;br /&gt;
   &lt;br /&gt;
      	public void setScheduledVisitDate(String scheduledVisitDate) {&lt;br /&gt;
      		this.scheduledVisitDate = scheduledVisitDate;&lt;br /&gt;
      	}&lt;br /&gt;
      	&lt;br /&gt;
   	...&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.DoctorVisit;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class DoctorVisitController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/scheduleVisit&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
      	public @ResponseBody String scheduleVisit(@Valid DoctorVisit doctorvisit, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== Combining Constraints ==&lt;br /&gt;
Validation annotations can be combined in any suitable way. For instance, to specify a valid reviewRating value between 1 and 5, specify the validation like this :&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Min(value=), @Max(value=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': BigDecimal, BigInteger, byte, short, int, long and the respective wrappers of the primitive types; Additionally supported by HV: any sub-type of CharSequence (the numeric value represented by the character sequence is evaluated), any sub-type of Number&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks whether the annotated value is higher/lower than or equal to the specified minimum&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Min&lt;br /&gt;
   import org.hibernate.validator.constraints.Max&lt;br /&gt;
   &lt;br /&gt;
   public class Review {&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Review rating must be between 1 and 5&lt;br /&gt;
      	@Min(1)&lt;br /&gt;
      	@Max(5)&lt;br /&gt;
      	private int reviewRating;&lt;br /&gt;
   &lt;br /&gt;
      	public int getReviewRating() {&lt;br /&gt;
      		return reviewRating;&lt;br /&gt;
      	}&lt;br /&gt;
   &lt;br /&gt;
      	public void setReviewRating(int reviewRating) {&lt;br /&gt;
      		this.reviewRating = reviewRating;&lt;br /&gt;
   	   }&lt;br /&gt;
   	&lt;br /&gt;
   	...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.ReviewRating;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class ReviewController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/postReview&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
      	public @ResponseBody String postReview(@Valid Review review, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Additional Constraints == &lt;br /&gt;
&lt;br /&gt;
In addition to providing the complete set of JSR303 constraints, Hibernate Validator also defines some additional constraints for convenience:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;@CreditCardNumber&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@EAN&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@Email&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@Length&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@Range&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@SafeHtml&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@ScriptAssert&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@URL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#table-custom-constraints&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Custom Constraints =&lt;br /&gt;
&lt;br /&gt;
One of the most powerful features of bean validation is the ability to define your own constraints that go beyond the simple validation offered by built in constraints.&lt;br /&gt;
&lt;br /&gt;
Creating custom constraints is beyond the scope of this guide. Please see http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch06.html&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Error Messages =&lt;br /&gt;
It is possible to specify a meesage ID with the validation annotation, so that error messages are customized :&lt;br /&gt;
&lt;br /&gt;
            @Pattern(regexp = &amp;quot;[a-zA-Z0-9 ]&amp;quot;, message=&amp;quot;article.title.error&amp;quot;)&lt;br /&gt;
   	   private String articleTitle;&lt;br /&gt;
&lt;br /&gt;
Spring MVC will then look up a message with id &amp;quot;article.title.error&amp;quot; in a defined MessageSource. More on this [http://www.silverbaytech.com/2013/04/16/custom-messages-in-spring-validation/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
Anton Abashkin - abashkin.anton [at] gmail.com&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Bean_Validation_Cheat_Sheet&amp;diff=218817</id>
		<title>Bean Validation Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Bean_Validation_Cheat_Sheet&amp;diff=218817"/>
				<updated>2016-07-11T16:06:54Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: added section on error messages&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
= Bean Validation Introduction =&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
&lt;br /&gt;
This article is focused on providing clear, simple, actionable guidance for providing Java Bean Validation security functionality in your applications. &lt;br /&gt;
&lt;br /&gt;
Bean validation (JSR303 aka [http://beanvalidation.org/1.0/spec/ Bean Validation 1.0] /JSR349 aka [http://beanvalidation.org/1.1/spec/ Bean Validation 1.1]) is one of the most common ways to perform [https://www.owasp.org/index.php/Input_Validation_Cheat_Sheet input validation] in Java. It is an application layer agnostic validation spec which provides the developer with the means to define a set of validation constraints on a domain model and then perform validation of those constraints through out the  various application tiers.&lt;br /&gt;
&lt;br /&gt;
One advantage of this approach is that the validation constraints and the corresponding validators are only written once, thus reducing duplication of effort and ensuring uniformity:&lt;br /&gt;
&lt;br /&gt;
== Typical Validation ==&lt;br /&gt;
&lt;br /&gt;
https://www.owasp.org/images/d/db/Bean_validation_typical.jpg&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== Bean Validation ==&lt;br /&gt;
&lt;br /&gt;
https://www.owasp.org/images/6/69/Bean_validation_jsr.jpg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
The examples in this guide use Hibernate Validator (the reference implementation for Bean Validation 1.1).&lt;br /&gt;
&lt;br /&gt;
Add Hibernate Validator to your pom.xml :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;dependency&amp;gt;&lt;br /&gt;
      &amp;lt;groupId&amp;gt;org.hibernate&amp;lt;/groupId&amp;gt;&lt;br /&gt;
      &amp;lt;artifactId&amp;gt;hibernate-validator&amp;lt;/artifactId&amp;gt;&lt;br /&gt;
      &amp;lt;version&amp;gt;5.2.4.Final&amp;lt;/version&amp;gt;&lt;br /&gt;
   &amp;lt;/dependency&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enable bean validation support in Spring's context.xml&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;beans:beans ...&lt;br /&gt;
   ...&lt;br /&gt;
   &amp;lt;mvc:annotation-driven /&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
   &amp;lt;/beans:beans&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more info, please see the [http://hibernate.org/validator/documentation/getting-started/ setup guide]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
In order to get started using Bean Validation, you must add validation constraints (&amp;lt;code&amp;gt;@Pattern, @Digits, @Min, @Max, @Size, @Past, @Future, @CreditCardNumber, @Email, @URL&amp;lt;/code&amp;gt;, etc.) to your model and then utilize the &amp;lt;code&amp;gt;@Valid&amp;lt;/code&amp;gt; annotation when passing your model around in various application layers.&lt;br /&gt;
&lt;br /&gt;
Constraints can be applied in several places:&lt;br /&gt;
* Fields&lt;br /&gt;
* Properties&lt;br /&gt;
* Classes&lt;br /&gt;
&lt;br /&gt;
For Bean Validation 1.1 also on:&lt;br /&gt;
* Parameters&lt;br /&gt;
* Return values&lt;br /&gt;
* Constructors&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity all the examples below feature field constraints and all validation is triggered by the controller. Refer to the Bean Validation documentation for a full list of examples.&lt;br /&gt;
&lt;br /&gt;
When it comes to error handling, the Hibernate Validator returns a &amp;lt;code&amp;gt;BindingResult&amp;lt;/code&amp;gt; object which contains a &amp;lt;code&amp;gt;List&amp;lt;ObjectError&amp;gt;&amp;lt;/code&amp;gt;. The examples below feature simplistic error handling, while a production ready application would have a more elaborate design that takes care of logging and error page redirection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Pre-defined Constraints =&lt;br /&gt;
&lt;br /&gt;
== @Pattern ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Pattern(regex=,flag=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': CharSequence&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks if the annotated string matches the regular expression regex considering the given flag match. Please visit [[OWASP Validation Regex Repository]] for other useful regex's.&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Pattern&lt;br /&gt;
   &lt;br /&gt;
   public class Article {&lt;br /&gt;
   &lt;br /&gt;
   	   //Constraint: Alpha Numeric article titles only using a regular expression&lt;br /&gt;
   	   @Pattern(regexp = &amp;quot;[a-zA-Z0-9 ]&amp;quot;)&lt;br /&gt;
   	   private String articleTitle;&lt;br /&gt;
      &lt;br /&gt;
   	   public String getArticleTitle() {&lt;br /&gt;
   	      	return articleTitle;&lt;br /&gt;
   	   }&lt;br /&gt;
   &lt;br /&gt;
   	   public void setArticleTitle(String articleTitle) {&lt;br /&gt;
   		   this.articleTitle = articleTitle;&lt;br /&gt;
   	   }	   &lt;br /&gt;
   	   &lt;br /&gt;
   	   ...&lt;br /&gt;
   	   &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
	  &lt;br /&gt;
'''Controller'''  &lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.Article;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class ArticleController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/postArticle&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
   	public @ResponseBody String postArticle(@Valid Article article, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== @Digits ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Digits(integer=,fraction=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': BigDecimal, BigInteger, CharSequence, byte, short, int, long and the respective wrappers of the primitive types; Additionally supported by HV: any sub-type of Number&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks whether the annotated value is a number having up to integer digits and fraction fractional digits&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Digits&lt;br /&gt;
   &lt;br /&gt;
   public class Customer {&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Age can only be 3 digits long or less&lt;br /&gt;
   	@Digits(integer=3, fraction=0)&lt;br /&gt;
   	private int age;&lt;br /&gt;
   &lt;br /&gt;
   	   public String getAge() {&lt;br /&gt;
   		   return age;&lt;br /&gt;
   	   }&lt;br /&gt;
   &lt;br /&gt;
   	   public void setAge(String age) {&lt;br /&gt;
   		   this.age = age;&lt;br /&gt;
   	   }&lt;br /&gt;
   	   &lt;br /&gt;
   	   ...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.Customer;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class CustomerController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/registerCustomer&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
   	   public @ResponseBody String registerCustomer(@Valid Customer customer, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== @Min / @Max == &lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Min(value=), @Max(value=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': BigDecimal, BigInteger, byte, short, int, long and the respective wrappers of the primitive types; Additionally supported by HV: any sub-type of CharSequence (the numeric value represented by the character sequence is evaluated), any sub-type of Number&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks whether the annotated value is higher/lower than or equal to the specified minimum&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Min&lt;br /&gt;
   import org.hibernate.validator.constraints.Max&lt;br /&gt;
   &lt;br /&gt;
   public class Review {&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Review rating must be between 1 and 5&lt;br /&gt;
      	@Min(1)&lt;br /&gt;
      	@Max(5)&lt;br /&gt;
      	private int reviewRating;&lt;br /&gt;
   &lt;br /&gt;
      	public int getReviewRating() {&lt;br /&gt;
      		return reviewRating;&lt;br /&gt;
      	}&lt;br /&gt;
   &lt;br /&gt;
      	public void setReviewRating(int reviewRating) {&lt;br /&gt;
      		this.reviewRating = reviewRating;&lt;br /&gt;
   	   }&lt;br /&gt;
   	&lt;br /&gt;
   	...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.ReviewRating;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class ReviewController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/postReview&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
      	public @ResponseBody String postReview(@Valid Review review, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== @Size ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Size(min=, max=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': CharSequence, Collection, Map and arrays&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks if the annotated element’s size is between min and max (inclusive)&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Size&lt;br /&gt;
   &lt;br /&gt;
   public class Message {&lt;br /&gt;
   	   &lt;br /&gt;
           //Constraint: Message must be at least 10 characters long, but less than 500&lt;br /&gt;
   	   @Size(min=10, max=500)&lt;br /&gt;
   	   private String message;&lt;br /&gt;
   &lt;br /&gt;
   	   public String getMessage() {&lt;br /&gt;
   		   return message;&lt;br /&gt;
   	   }&lt;br /&gt;
   &lt;br /&gt;
   	   public void setMessage(String message) {&lt;br /&gt;
   		   this.message = message;&lt;br /&gt;
   	   }&lt;br /&gt;
   	   &lt;br /&gt;
   	   ...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.Message;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class MessageController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/sendMessage&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
      	public @ResponseBody String sendMessage(@Valid Message message, BindingResult result, HttpServletResponse response){	&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== @Past / @Future ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Past, @Future&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': java.util.Date, java.util.Calendar, java.time.chrono.ChronoZonedDateTime, java.time.Instant, java.time.OffsetDateTime&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks whether the annotated date is in the past / future&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Past&lt;br /&gt;
   import org.hibernate.validator.constraints.Future&lt;br /&gt;
   &lt;br /&gt;
   public class DoctorVisit {&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Birthdate must be in the past&lt;br /&gt;
      	@Past&lt;br /&gt;
      	private Date birthDate;&lt;br /&gt;
   &lt;br /&gt;
      	public Date getBirthDate() {&lt;br /&gt;
      		return birthDate;&lt;br /&gt;
      	}&lt;br /&gt;
      &lt;br /&gt;
      	public void setBirthDate(Date birthDate) {&lt;br /&gt;
      		this.birthDate = birthDate;&lt;br /&gt;
      	}&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Schedule visit date must be in the future&lt;br /&gt;
      	@Future&lt;br /&gt;
      	private String scheduledVisitDate;&lt;br /&gt;
   &lt;br /&gt;
      	public String getScheduledVisitDate() {&lt;br /&gt;
      		return scheduledVisitDate;&lt;br /&gt;
      	}&lt;br /&gt;
   &lt;br /&gt;
      	public void setScheduledVisitDate(String scheduledVisitDate) {&lt;br /&gt;
      		this.scheduledVisitDate = scheduledVisitDate;&lt;br /&gt;
      	}&lt;br /&gt;
      	&lt;br /&gt;
   	...&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.DoctorVisit;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class DoctorVisitController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/scheduleVisit&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
      	public @ResponseBody String scheduleVisit(@Valid DoctorVisit doctorvisit, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Additional Constraints == &lt;br /&gt;
&lt;br /&gt;
In addition to providing the complete set of JSR303 constraints, Hibernate Validator also defines some additional constraints for convenience:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;@CreditCardNumber&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@EAN&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@Email&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@Length&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@Range&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@SafeHtml&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@ScriptAssert&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@URL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#table-custom-constraints&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Custom Constraints =&lt;br /&gt;
&lt;br /&gt;
One of the most powerful features of bean validation is the ability to define your own constraints that go beyond the simple validation offered by built in constraints.&lt;br /&gt;
&lt;br /&gt;
Creating custom constraints is beyond the scope of this guide. Please see http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch06.html&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Error Messages =&lt;br /&gt;
It is possible to specify a meesage ID with the validation annotation, so that error messages are customized :&lt;br /&gt;
&lt;br /&gt;
            @Pattern(regexp = &amp;quot;[a-zA-Z0-9 ]&amp;quot;, message=&amp;quot;article.title.error&amp;quot;)&lt;br /&gt;
   	   private String articleTitle;&lt;br /&gt;
&lt;br /&gt;
Spring MVC will then look up a message with id &amp;quot;article.title.error&amp;quot; in a defined MessageSource. More on this [http://www.silverbaytech.com/2013/04/16/custom-messages-in-spring-validation/]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
Anton Abashkin - abashkin.anton [at] gmail.com&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Bean_Validation_Cheat_Sheet&amp;diff=218815</id>
		<title>Bean Validation Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Bean_Validation_Cheat_Sheet&amp;diff=218815"/>
				<updated>2016-07-11T15:33:42Z</updated>
		
		<summary type="html">&lt;p&gt;Sytzevk: /* Basics */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt; __NOTOC__&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:Cheatsheets-header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}''' &lt;br /&gt;
= Bean Validation Introduction =&lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
&lt;br /&gt;
This article is focused on providing clear, simple, actionable guidance for providing Java Bean Validation security functionality in your applications. &lt;br /&gt;
&lt;br /&gt;
Bean validation (JSR303 aka [http://beanvalidation.org/1.0/spec/ Bean Validation 1.0] /JSR349 aka [http://beanvalidation.org/1.1/spec/ Bean Validation 1.1]) is one of the most common ways to perform [https://www.owasp.org/index.php/Input_Validation_Cheat_Sheet input validation] in Java. It is an application layer agnostic validation spec which provides the developer with the means to define a set of validation constraints on a domain model and then perform validation of those constraints through out the  various application tiers.&lt;br /&gt;
&lt;br /&gt;
One advantage of this approach is that the validation constraints and the corresponding validators are only written once, thus reducing duplication of effort and ensuring uniformity:&lt;br /&gt;
&lt;br /&gt;
== Typical Validation ==&lt;br /&gt;
&lt;br /&gt;
https://www.owasp.org/images/d/db/Bean_validation_typical.jpg&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== Bean Validation ==&lt;br /&gt;
&lt;br /&gt;
https://www.owasp.org/images/6/69/Bean_validation_jsr.jpg&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
= Setup =&lt;br /&gt;
&lt;br /&gt;
The examples in this guide use Hibernate Validator (the reference implementation for Bean Validation 1.1).&lt;br /&gt;
&lt;br /&gt;
Add Hibernate Validator to your pom.xml :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;dependency&amp;gt;&lt;br /&gt;
      &amp;lt;groupId&amp;gt;org.hibernate&amp;lt;/groupId&amp;gt;&lt;br /&gt;
      &amp;lt;artifactId&amp;gt;hibernate-validator&amp;lt;/artifactId&amp;gt;&lt;br /&gt;
      &amp;lt;version&amp;gt;5.2.4.Final&amp;lt;/version&amp;gt;&lt;br /&gt;
   &amp;lt;/dependency&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Enable bean validation support in Spring's context.xml&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;beans:beans ...&lt;br /&gt;
   ...&lt;br /&gt;
   &amp;lt;mvc:annotation-driven /&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
   &amp;lt;/beans:beans&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more info, please see the [http://hibernate.org/validator/documentation/getting-started/ setup guide]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Basics =&lt;br /&gt;
&lt;br /&gt;
In order to get started using Bean Validation, you must add validation constraints (&amp;lt;code&amp;gt;@Pattern, @Digits, @Min, @Max, @Size, @Past, @Future, @CreditCardNumber, @Email, @URL&amp;lt;/code&amp;gt;, etc.) to your model and then utilize the &amp;lt;code&amp;gt;@Valid&amp;lt;/code&amp;gt; annotation when passing your model around in various application layers.&lt;br /&gt;
&lt;br /&gt;
Constraints can be applied in several places:&lt;br /&gt;
* Fields&lt;br /&gt;
* Properties&lt;br /&gt;
* Classes&lt;br /&gt;
&lt;br /&gt;
For Bean Validation 1.1 also on:&lt;br /&gt;
* Parameters&lt;br /&gt;
* Return values&lt;br /&gt;
* Constructors&lt;br /&gt;
&lt;br /&gt;
For the sake of simplicity all the examples below feature field constraints and all validation is triggered by the controller. Refer to the Bean Validation documentation for a full list of examples.&lt;br /&gt;
&lt;br /&gt;
When it comes to error handling, the Hibernate Validator returns a &amp;lt;code&amp;gt;BindingResult&amp;lt;/code&amp;gt; object which contains a &amp;lt;code&amp;gt;List&amp;lt;ObjectError&amp;gt;&amp;lt;/code&amp;gt;. The examples below feature simplistic error handling, while a production ready application would have a more elaborate design that takes care of logging and error page redirection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Pre-defined Constraints =&lt;br /&gt;
&lt;br /&gt;
== @Pattern ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Pattern(regex=,flag=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': CharSequence&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks if the annotated string matches the regular expression regex considering the given flag match. Please visit [[OWASP Validation Regex Repository]] for other useful regex's.&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Pattern&lt;br /&gt;
   &lt;br /&gt;
   public class Article {&lt;br /&gt;
   &lt;br /&gt;
   	   //Constraint: Alpha Numeric article titles only using a regular expression&lt;br /&gt;
   	   @Pattern(regexp = &amp;quot;[a-zA-Z0-9 ]&amp;quot;)&lt;br /&gt;
   	   private String articleTitle;&lt;br /&gt;
      &lt;br /&gt;
   	   public String getArticleTitle() {&lt;br /&gt;
   	      	return articleTitle;&lt;br /&gt;
   	   }&lt;br /&gt;
   &lt;br /&gt;
   	   public void setArticleTitle(String articleTitle) {&lt;br /&gt;
   		   this.articleTitle = articleTitle;&lt;br /&gt;
   	   }	   &lt;br /&gt;
   	   &lt;br /&gt;
   	   ...&lt;br /&gt;
   	   &lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
	  &lt;br /&gt;
'''Controller'''  &lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.Article;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class ArticleController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/postArticle&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
   	public @ResponseBody String postArticle(@Valid Article article, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== @Digits ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Digits(integer=,fraction=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': BigDecimal, BigInteger, CharSequence, byte, short, int, long and the respective wrappers of the primitive types; Additionally supported by HV: any sub-type of Number&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks whether the annotated value is a number having up to integer digits and fraction fractional digits&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Digits&lt;br /&gt;
   &lt;br /&gt;
   public class Customer {&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Age can only be 3 digits long or less&lt;br /&gt;
   	@Digits(integer=3, fraction=0)&lt;br /&gt;
   	private int age;&lt;br /&gt;
   &lt;br /&gt;
   	   public String getAge() {&lt;br /&gt;
   		   return age;&lt;br /&gt;
   	   }&lt;br /&gt;
   &lt;br /&gt;
   	   public void setAge(String age) {&lt;br /&gt;
   		   this.age = age;&lt;br /&gt;
   	   }&lt;br /&gt;
   	   &lt;br /&gt;
   	   ...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.Customer;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class CustomerController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/registerCustomer&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
   	   public @ResponseBody String registerCustomer(@Valid Customer customer, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== @Min / @Max == &lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Min(value=), @Max(value=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': BigDecimal, BigInteger, byte, short, int, long and the respective wrappers of the primitive types; Additionally supported by HV: any sub-type of CharSequence (the numeric value represented by the character sequence is evaluated), any sub-type of Number&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks whether the annotated value is higher/lower than or equal to the specified minimum&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Min&lt;br /&gt;
   import org.hibernate.validator.constraints.Max&lt;br /&gt;
   &lt;br /&gt;
   public class Review {&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Review rating must be between 1 and 5&lt;br /&gt;
      	@Min(1)&lt;br /&gt;
      	@Max(5)&lt;br /&gt;
      	private int reviewRating;&lt;br /&gt;
   &lt;br /&gt;
      	public int getReviewRating() {&lt;br /&gt;
      		return reviewRating;&lt;br /&gt;
      	}&lt;br /&gt;
   &lt;br /&gt;
      	public void setReviewRating(int reviewRating) {&lt;br /&gt;
      		this.reviewRating = reviewRating;&lt;br /&gt;
   	   }&lt;br /&gt;
   	&lt;br /&gt;
   	...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.ReviewRating;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class ReviewController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/postReview&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
      	public @ResponseBody String postReview(@Valid Review review, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== @Size ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Size(min=, max=)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': CharSequence, Collection, Map and arrays&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks if the annotated element’s size is between min and max (inclusive)&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Size&lt;br /&gt;
   &lt;br /&gt;
   public class Message {&lt;br /&gt;
   	   &lt;br /&gt;
           //Constraint: Message must be at least 10 characters long, but less than 500&lt;br /&gt;
   	   @Size(min=10, max=500)&lt;br /&gt;
   	   private String message;&lt;br /&gt;
   &lt;br /&gt;
   	   public String getMessage() {&lt;br /&gt;
   		   return message;&lt;br /&gt;
   	   }&lt;br /&gt;
   &lt;br /&gt;
   	   public void setMessage(String message) {&lt;br /&gt;
   		   this.message = message;&lt;br /&gt;
   	   }&lt;br /&gt;
   	   &lt;br /&gt;
   	   ...&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.Message;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class MessageController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/sendMessage&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
      	public @ResponseBody String sendMessage(@Valid Message message, BindingResult result, HttpServletResponse response){	&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== @Past / @Future ==&lt;br /&gt;
&lt;br /&gt;
'''Annotation''': &amp;lt;code&amp;gt;@Past, @Future&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Data Type''': java.util.Date, java.util.Calendar, java.time.chrono.ChronoZonedDateTime, java.time.Instant, java.time.OffsetDateTime&lt;br /&gt;
&lt;br /&gt;
'''Use''': Checks whether the annotated date is in the past / future&lt;br /&gt;
&lt;br /&gt;
[http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#section-builtin-constraints Reference]&lt;br /&gt;
&lt;br /&gt;
'''Model'''&lt;br /&gt;
&lt;br /&gt;
   import org.hibernate.validator.constraints.Past&lt;br /&gt;
   import org.hibernate.validator.constraints.Future&lt;br /&gt;
   &lt;br /&gt;
   public class DoctorVisit {&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Birthdate must be in the past&lt;br /&gt;
      	@Past&lt;br /&gt;
      	private Date birthDate;&lt;br /&gt;
   &lt;br /&gt;
      	public Date getBirthDate() {&lt;br /&gt;
      		return birthDate;&lt;br /&gt;
      	}&lt;br /&gt;
      &lt;br /&gt;
      	public void setBirthDate(Date birthDate) {&lt;br /&gt;
      		this.birthDate = birthDate;&lt;br /&gt;
      	}&lt;br /&gt;
   	&lt;br /&gt;
        //Constraint: Schedule visit date must be in the future&lt;br /&gt;
      	@Future&lt;br /&gt;
      	private String scheduledVisitDate;&lt;br /&gt;
   &lt;br /&gt;
      	public String getScheduledVisitDate() {&lt;br /&gt;
      		return scheduledVisitDate;&lt;br /&gt;
      	}&lt;br /&gt;
   &lt;br /&gt;
      	public void setScheduledVisitDate(String scheduledVisitDate) {&lt;br /&gt;
      		this.scheduledVisitDate = scheduledVisitDate;&lt;br /&gt;
      	}&lt;br /&gt;
      	&lt;br /&gt;
   	...&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
'''Controller'''&lt;br /&gt;
&lt;br /&gt;
   import javax.validation.Valid;&lt;br /&gt;
   import com.company.app.model.DoctorVisit;&lt;br /&gt;
   &lt;br /&gt;
   @Controller&lt;br /&gt;
   public class DoctorVisitController {&lt;br /&gt;
   &lt;br /&gt;
   ...&lt;br /&gt;
   &lt;br /&gt;
   @RequestMapping(value={&amp;quot;/scheduleVisit&amp;quot;, method={RequestMethod.POST})&lt;br /&gt;
      	public @ResponseBody String scheduleVisit(@Valid DoctorVisit doctorvisit, BindingResult result, HttpServletResponse response){&lt;br /&gt;
   		&lt;br /&gt;
    		if(result.hasErrors()){&lt;br /&gt;
    			String errorMessage = &amp;quot;&amp;quot;;&lt;br /&gt;
   			response.setStatus(HttpServletResponse.SC_BAD_REQUEST);&lt;br /&gt;
   			List&amp;lt;ObjectError&amp;gt; errors = result.getAllErrors();&lt;br /&gt;
   			&lt;br /&gt;
   			for( ObjectError e : errors){&lt;br /&gt;
   				errorMessage+= &amp;quot;ERROR: &amp;quot; + e.getDefaultMessage();&lt;br /&gt;
   			}&lt;br /&gt;
   			return errorMessage;&lt;br /&gt;
    		}&lt;br /&gt;
   			&lt;br /&gt;
    		else{&lt;br /&gt;
   			   return &amp;quot;Validation Successful&amp;quot;; 	&lt;br /&gt;
   		}&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== Additional Constraints == &lt;br /&gt;
&lt;br /&gt;
In addition to providing the complete set of JSR303 constraints, Hibernate Validator also defines some additional constraints for convenience:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;@CreditCardNumber&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@EAN&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@Email&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@Length&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@Range&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@SafeHtml&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@ScriptAssert&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;@URL&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch02.html#table-custom-constraints&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Custom Constraints =&lt;br /&gt;
&lt;br /&gt;
One of the most powerful features of bean validation is the ability to define your own constraints that go beyond the simple validation offered by built in constraints.&lt;br /&gt;
&lt;br /&gt;
Creating custom constraints is beyond the scope of this guide. Please see http://docs.jboss.org/hibernate/validator/5.2/reference/en-US/html/ch06.html&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
= Author =&lt;br /&gt;
&lt;br /&gt;
Anton Abashkin - abashkin.anton [at] gmail.com&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
= Other Cheatsheets =&lt;br /&gt;
{{Cheatsheet_Navigation_Body}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Cheatsheets]]&lt;/div&gt;</summary>
		<author><name>Sytzevk</name></author>	</entry>

	</feed>