Feature in JSF 2.0 (EE 6) GitHub JsfApplicationJboss.
I'm dedicated agile security architect/system architect/developer with specialty of open source framework.
October 28, 2018
Using JAAS in Tomcat Example
JAAS is part of the Java SE since Java 5, so choosing that API, when you want to deploy to only a web container, such as Tomcat or Jetty, is a good choice.
/META-INF/context.xml. See where best to put your configuration How to handle Configuration in Tomcat with Context
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Realm className="org.apache.catalina.realm.JAASRealm"
appName="BytesLoungeLogin"
userClassNames="com.byteslounge.jaas.UserPrincipal"
roleClassNames="com.byteslounge.jaas.RolePrincipal" />
</Context>
$CATALINA_BASE/conf/jaas.config
BytesLoungeLogin {
com.byteslounge.jaas.BytesLoungeLoginModule required debug=true;
};
And starting
JAVA_OPTS=$JAVA_OPTS "-Djava.security.auth.login.config==$CATALINA_BASE/conf/jaas.config"
Scanning Your System with OpenSCAP
With SCAP and a good policy you can centrally scan your system and verify that they are properly secured and get a nice automatically report at the end.
Resource
Java Smart Card APDU Commands
Almost all smart card are Java Smart Card based. You can manage smart card via the Java Smart Card SDK, but you can also access the card via standard Java SE and javax.smartcardio API.To do that you need to know the card and card type native APDU commands, here are some examples.
Requiring SSL client authentication in a user friendly way in Apache
Requiring SSL client authentication in a user friendly way in Apache
Remember when downgrading to 'SSLVerifyClient require', you also weaken your defense from DOS attacks.
OWASP XSS (Cross-Site Scripting)
XSS is all about scripts sent to a web page and typically it is javascripts.
There are three types of XSS: Stored XSS, Reflected XSS and DOM based XSS
Top 10-2017 A7-Cross-Site Scripting (XSS)
https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
To protect against XSS, you must have a strong Data Validation:
- Accept known good otherwise reject (white list), e.g. phone number, only ascii [a-zA-Z0-9])
- Sanitize. i.e. change the user input into an acceptable format. See Input Validation - OWASP Java HTML Sanitizer
- Reject known bad (blacklist), e.g.
, ' (SQL injection)
Beside Data Validation, you should add OWASP Security HTTP Headers. And especially 'X-XSS-Protection: 1; mode=block'.
October 27, 2018
Oracle Code One 2018 Hacking and Hardening Java Web Applications
https://s3.amazonaws.com/cmj-presentations/Hacking+and+Hardening+Java+Web+Apps+-+OC12018.pdf
Kali Linux Varient Virtual Machine https://s3.amazonaws.com/cmj-presentations/hacking-uberconf-2016/hhjwa-2016.1-vbox-amd64.ova
https://github.com/cjudd/wordyninjablog
https://github.com/cjudd/hacking-and-hardening-java-web-apps-workshop