8/14/2015

Internet Explorer 11, updating the user interface


Internet Explorer 11 is difficult to use and difficult to customize. Here is a way to make it easier to use.


The usual methods of customizing the user interface that worked with previous generations of the Internet Explorer browser no longer work. A way to work around this is to make the best of the IE settings available and then disable the components that no longer allow customization, replacing them with an add-on extension.

One such extension is the Quero Toolbar it installs in a fairly confusing default state.

To reach the state as displayed in the first image of this article, first download and install Quero Toolbar then open IE11 and press ALT+Q to get to its configuration menu.

Examine each tab in turn and make sure they are setup as follows:

Tab1 - Settings

Tab2 - Ad Blocker


Tab3 - Appearance


Tab4 - Search Profiles


Tab5 - Security

Tab6 - Advanced


Then right click in the exposed toolbar area of IE11 and change the selcted options to match this:


The default navigational icons will not be the colorful ones in these images, to get those you will need to visit the Quero Themes page and download the Crystal Theme, it consists of one DLL which contains the icons, save it to a place like your Documents directory, then visit the Tab3 - Appearance tab  from the Quero ALT+Q configuration menu and select the Theme by pressing the browse button at the bottom of the tab and selecting the Theme DLL.

All Browsers (IE, FF, Cr) have a hardware acceleration option. In general it attempts to offload some of the rendering to the local GPU.. in general it doesn't work very well and can cause problems and crashes.

If you would like to disable the hardware accelaration feature in IE11, it can be reached by left clicking on the 'gear' icon in the top right and selecting 'Internet Options' then the Advanced (tab) it will be the first item listed,  check it  and press [Apply] and then [OK]


The end result is a browser with a viewing and control profile very similar to what can be acheived in Firefox and Chrome.

Internet Explorer 11.0.9600.17959


Mozilla Firefox 40.0.2


Google Chrome 44.0.2403.155 m


note: while I am aware it is possible to go even further and make them virtually identical, this article was merely a quick demonstration of concept. current browsers are more similar than they are different in form and function, and regardless of their underlying differences can reach broader audiences by conforming to more common user interface elements.

8/11/2015

Windows 2008r2, Powershell resuming a Service

The  Event Viewer  in Windows can start a  Task Scheduler  job when a specific  Windows log  entry is detected. The Powershell command language supports 'horizontal' line command scripting as well as 'vertical' line command scripting. So this can be encapsulated into a single line of instructions.

For example:

Start > Administrative Tools > Event Viewer

will start an instance of the Event Viewer discovery program focused on the (Local) binary logs

the categories down the vertical navigation panel to the Left generally indicate the source of a notification, Application (user), Security (kernel), System (system)

the levels in the central panel indicating "severity" more descriptive "source" and specific "event"


right-clicking an event and selecting "Attach Task To This Event"


will open a [Create Basic Task Wizard] window and create a Task Scheduler entry

the Action can be set to :



where the [Add arguments (optional):] field can be used to pass a 'horizonal' command line script


-command &{Start-Sleep -s 50; Restart-Service -displayname "StorageCraft ImageManger"}

in this case the script dictates to enter a sleep cycle for 50 seconds then peform a restart of a registered operating system service daemon with a displayname "StorageCraft ImageManager"

the actual "displaynames" of registered service processes can be obtained from a powershell prompt using the "get-service" command "let" or cmdlet, the displayname is not the same thing as the running process name






7/21/2015

Tomcat, err ssl version or cipher mismatch


When using Tomcat  without  a robust web server frontend  ( like Apache or Nginx )  to manage SSL connections and sessions. Java keystore problems can produce several misleading error message in browsers. In addition to that, the imported certificate and private key used per website must have the same password/passphrase as the keystore itself and cannot be "blank".

The browser may display a cryptic error message and refuse to open an encrypted data channel using the certificate, resulting in an open http:// connection with the following message in the browser window:

ERR_SSL_VERSION_OR_CIPHER_MISMATCH

Keytool does not have a method for importing a third party signed certificate and its private key into a new keystore natively.

The Openssl toolkit can create a Microsoft PCKS12 format cert and private key pair.

The Java keytool tool can then be used to import/convert a PCKS12 storage container into a keystore and set the "keypass" and "storepass" at the same time.

For example, it is common in Red Hat Enterprise Linux to use the /etc/pki/tls directories and genkey utilities from the crypto-utils package to create PEM encoded private key and CSR pairs and receive a signed PEM format CER cert. This is the least friction, most common method known of obtaining SSL certs and is fairly well documented.

The following will produce a keystore that contains the private key and signed cert in a keystore with the private key and keystore pass set to the same value:
# cd /etc/pki/tls
# openssl pkcs12 -export -in certs/www.server.com.cer -inkey private//www.server.com.key -out www.server.com.p12 -name tomcat -CAfile certs/ca_bundle.cer -caname root -chain
# mv www.server.com.p12 /usr/share/jdk1.7.0/bin/ ; cd /usr/share/jdk1.7.0/bin/
# keytool -importkeystore -deststorepass changeit! -destkeypass changeit! -destkeystore tomcat_java.keystore -srckeystore www.server.com.p12 -srcstoretype PKCS12 -srcstorepass changeit! -alias tomcat
 Since this keystore is intended to be used with Tomcat, the alias should be "tomcat"

Also since the server is now expected to provide the certificate chain, and in the correct order the following steps might be wise; It would be wise to also be aware that bundle files often come with multiple certs in one file and the keytool will silently discard and not import more than one certificate at a time, in which case if the file does contain multiple certificates breaking the file into one file per cert and importing them separately would be advised. The root of the chain possibly appearing as the "last" certificate in the bundled "chain file" and might need to be imported "first" in order to avoid problems with mobilty clients.
# keytool -import -trustcacerts -alias AddTrustExternalCARoot -file ca_bundle3.crt -keystore tomcat_java.keystore
# keytool -import -trustcacerts -alias USERTrustRSACA -file ca_bundle2.crt -keystore tomcat_java.keystore
# keytool -import -trustcacerts -alias RSAServerCA -file ca_bundle1.crt -keystore tomcat_java.keystore

And finally to address the ciphers problem.

The Tomcat connector ( server.xml ) needs to explicitly "tip toe" about known Common Vulnerabilities and Exploits (CVE)s, this may work like "magic" but the set is carefully crafted around a balance between known vulnerabilities, the capabilities of a jdk without enhanced cipher capabilties and what browsers will allow a connection to be formed with.
<Connector
port="443"
protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150"
SSLEnabled="true"
scheme="https"
keystoreFile="/usr/share/jdk1.7.0/bin/tomcat_java.keystore"
keystorePass="changeit!"
secure="true"
clientAuth="false"
sslProtocol="TLS"
ciphers="
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
TLS_RSA_WITH_AES_128_CBC_SHA256,
TLS_RSA_WITH_AES_128_CBC_SHA
"
/>
Its best to consider carefully whether to forego using the "Free" wisdom and customs gathered and standardized by the more mature and currently very vital and active web server projects like Apache and Nginx. They are constantly being updated and repaired for Zero-Day attacks and exploits.

Java is a "language" and does not prioritize "web services" as a daily updated and maintained feature.. by "definition"

Tomcat is almost certainly "guaranteed" to be  "Exploitable"  the day it is released

To serve the useful purpose of an Example of   "What Not To Do.."   this has been widely and strongly publicized almost from its inception.

The position has not been changed, regardless of less experienced users promoting propaganda that "that's what they used to say.. it is still True Today  .. it is still in the documentation" it speaks highly of programmer experience level to say otherwise.

The AJP and Mod_jk projects explicitly "exist" because of the Java libraries that support them, they are not token projects that serve merely as examples.. they are there for a reason.. whenever "bindings" between projects exist and are maintained for "generations" do be curious and suspicious of why the the High Level of effort is continually put in place to maintain them.. usually unused code would fail over time if it were not actively being used. There Is A Reason.. Be Curious !!

Finally, Java "is a Language" with many aspects that "look like" an operating system, its JVM is not as old or robust.. or as well maintained by "language developers" as dedicated "operating system developers". A person who mows your lawn does not often fix cars as well as they mow lawns.. please keep this analogy in mind.

If "language developers" were to ever devote the same level of energy, effort and accumulated expertise.. you would probably not appreciate the language as much as a language developed by dedicated "language developers" [ Expertise in one area, does not often translate into "Unrelated" Expertise in another area.. to assume so is usually disasterous ]

7/05/2015

RHEL 6, Installing Tomcat with Yum

Tomcat is a java Servlet, JSP web service provider. Red Hat Enterprise Linux doesn't install all of it without enabling the   Optional Subscription Channel   after RHN registration. Also an unresolved RPM java-gcj-compat requirement installs Java 1.5.0 gcj even if it is not used for running Tomcat.

The 'provides' tag was not added to subsequent newer versions of java as the gcj was gcj specific and is now for all intents and purposes retired. Sun, Oracle, IBM maintainers have no reason to add in this tag as a 'provides' and thus to satisfy the requirement pulls in the only java that satisfies it.. 1.5.0

There are ['ways'] of tricking the rpm dependency database into thinking it already has this requirement satisfied.. but they are not supported or approved by Red Hat.

Installing Tomcat without enabling the "Optional Subscription Channel" in RHN will result in a Tomcat service which has broken dependencies between java classes and java services in code written for the Tomcat service.

RHN Channel Subscription:

Subscribed Channels (Alter Channel Subscriptions)
[x] Red Hat Enterprise Linux Server (v.6 for x86_64)
|
+-> RHEL Server Optional (v.6 64-bit x86_64)

In particular the following package is only available from the "Optional Channel"
 jakarta-taglibs-standard    rhel-x86_64-server-optional-6
Pulling in Java 1.5.0 is suboptimal because Java 1.5.0 is no longer supported by its upstream provider.

However Java 1.8.0 changed and removed many of the java classes in use by a large portion of the web service code in common use today (i.e. Hashmaps).

Therefore it is more desirable to install Java 1.6.0 or Java 1.7.0

However while this is possible (and because the Alternatives symlinking will result in Tomcat running on the designated version of Java once it is installed) java 1.5.0 cannot be removed with the YUM package manager without causing a catastrophic "unwinding" that removes all packages that have the java-gcj-compat requirement.

To paraphrase the most recent statement from bug 1175457 
2015-05-12
This bug is not fixed, however a workaround is provided for rhel7. 
The true fix will probably never go into rhel6 

With these issues in mind the barest base install of Tomcat on RHEL 6.6 can be made with the command:
# yum groupinstall web-servlet
Which will install the following:

tomcat6
tomcat6-el-2.1-api
tomcat6-jsp-2.1-api
tomcat6-lib
tomcat6-servlet-2.5-api

It will provide a webservice, but serve a completely [blank] page.

http://localhost:8080/

[ don't forget about - iptables and selinux ]

The following packages [will not be installed] but you may expect and wish to install them:

tomcat6-admin-webapps
tomcat6-docs-webapp
tomcat6-javadoc
tomcat6-log4j
tomcat6-webapps

One reason is that these other packages pull in even more dependencies for supporting the Example and Sample JSP and Servlet applications, which "people tend to install tomcat because they want to serve JSP and Servlet applications.."

If you install only the group web-servlet, your very secure.. but most of your JSP and Servlet apps will not work unless you selectively install supporting packaged versions of support software for JSP and Servlet apps. Kind of a knock on side-effect. Figuring out which packages contain those support services.. is "fun"

Upon enabling the Optional Channel and installing all of the packages, Tomcat behaves more like a freshly compiled source code distribution.

By installing an alternate version of java [before] the java_1.5.0 version is pulled in by a dependency (i.e. on a freshly installed server) the later version of java will take priority and keep the alternatives pointers fixed on the newer version of java [ alternatively the "alternatives" command can be used to manually adjust the pointers, however its just easier to install a different java version before 1.5.0 is pulled in ] [ the non-devel package will pull in only the java runtimes JRE, the "-devel" package will pull in the java development kit javac compiler JDK which could be useful ]
# yum install java-1.7.0-openjdk  java-1.7.0-openjdk-devel
# yum install tomcat6 tomcat6-el-2.1-api tomcat6-jsp-2.1-api tomcat6-lib tomcat6-servlet-2.5-api tomcat6-admin-webapps tomcat6-docs-webapp tomcat6-javadoc tomcat6-log4j tomcat6-webapps
The APR, OpenSSL, JNI - libtcnative.so or tomcat-native component is apparently not available as a packaged option on RHEL6. While facility to accomodate it was made in the /etc/sysconfig/tomcat6 file under JAVA_OPTS= it was never packaged for the x86_64 architecture.

It can in theory be compiled and inserted into the /usr/lib64 path "since it is in fact a C" library. But then you run the risk of further maintenance addressing CVEs and other Security audits.

For RHEL7 and Tomcat 7.0 it appears libtcnative may be available as a packaged option.

EPEL and RHSCL also do not appear to offer much support for Tomcat6 on RHEL6.

JBoss however, if contracted and installed, does appear to have a libtcnative however that is not to my knowlege a generally supported option unless you are running that platform.

5/18/2015

Syncplicity, How to use with Shibboleth


EMC Syncplicity is a a cloud based "Software as a Service" offering. The Syncplicity brand is owned by EMC Corporation. For companies that purchased substantial hosting services they create a custom branded EMC website for managing the cloud hosted accounts.

A cloud hosted account is a signed in user who has the ability to initiate and maintain a file storage session for the purpose of conducting file sharing services over the EMC Syncplicity cloud based file sharing system. Participants who maintain a cloud account are not individually licensed but receive web browser delivered software agents that enable their internet connected workstation or mobile device to use EMC cloud storage to share files.

Customers of EMC often already have an authentication system such as Active Directory, and often use ADFS or an OASIS style SAML2 compatible Single Sign On service in order to avoid proliferation of account management issues and to allow members of their domain to remember only one set of logon credentials.

Shibboleth is a commonly used SAML complaint SSO.

This is an example with Shibboleth 2.4.2 on RHEL6 connected to a Windows 2008r2 Domain.

Images: within this document are Expandable by "clicking" on them to enhance readability.

On the EMC provided Management page for the Customer service site

  •  NOTE:  When setting up SSO  "the Management page"  may log you out automatically after 30 minutes (before you are finished) . You can log back in regardless of whether SSO is enabled by going to the my.syncplicity.com website and "clicking" the triangle for  Sign-in Help   it will take you back to the Admin page for your subdomain account.

After signing into the EMC Management site you begin by choosing from the

Menu bar > Admin > Settings

Manage Settings
>Account Configuration
>>Custom Domain and single sign-on.




STEP 1

> Configuration Authentication Settings
>> Domain Settings (should already be filled out for you)

> Single Sign-On (SSO)
>> Single Sign-On Status*

"select" the radio button [Enabled] to un-grey the fields that follow


STEP 2

upload a PEM format X.509 copy of your Shibboleth Idp "internal" signing certificate:

[NOTE: This is the Idp "internal" cert used for signing SAML assertions. It is NOT the SSO Website certificate a users browser receives when they are directed to a logon page]

For example:

The SAML signing cert for Shibboleth is commonly placed here:

/opt/shibboleth-idp/credentials/idp.crt



 Master Tip! 

be sure to take a look at the [Current Certificate: ] information after it uploads

it is common for an Idp cert to reveal very little information

"too much" information could signal the  wrong  cert was uploaded


"the right" amount of information signals the  right  cert was uploaded 


STEP 3

complete the rest of the fields that refer to the Shibboleth server hosted at your site



Provide the Identity provider (Entity Id) for the Shibboleth Idp website:  < on your server > 

Provide the Customer facing "Sign-in page" (SSO) url:  < on your server > 

Provide the Customer facing "Logout page" (SSO) url:  < on your server > 

The press  [ Save Changes ]  to save the settings.


note: these are "paths" to web services on your shibboleth server, they have to be setup on your shibboleth server to receive requests and provide answers; they can be mapped to different paths, you have to be sure to use the correct paths; these are provided as common examples


On the Shibboleth server


STEP 1

The EMC website needs to be added as a Service Provider to the relying-party file.

The EMC website will be "relying" on your Shibboleth server to provide "authentication".

For example:

The shibboleth relying-party file is commonly found here:

/opt/shibboleth-idp/conf/relying-party.xml



The file is in xml format and has a series of "chunks" or "sections" of information


Syncplicity needs a new section like this
 rp:RelyingParty

Where id = "Service provider (SP id) for the EMC hosted website /sp"
Where provider = "Identity provider (Entity ID) for your shibboleth svr"
to save time and typing errors you can copy an existing section and modify it

Syncplicity needs to be added to this section
metadata:MetadataProvider

the Metadata that goes into the file
/opt/shibboleth-idp/metadata/emcshib.xml
has to come from EMC and is specific to your hosted service
here is what it looks like

the Metadata is a "contract" for how the Service Provider will communicate
it includes the SP id, the SAML protocol type, the SP x509 signing cert, what it expects to see used in the Subject line for communications (the "NameID") and how to contact the Service Provider when the Shibboleth server is done fullfilling the User login request
you can obtain it in one of three ways; 

1. https://custdomain.syncplicity.com/Auth/ServiceProviderMetadata.aspx
wget https://customain.syncplicity.com/Auth/ServiceProviderMetadata.aspx -O emcshib.xml
curl https://custdomain.syncplicity.com/Auth/ServiceProviderMetadata.aspx > emcshib.xml
 NOTE:  this method currently retrieves metadata with a known problem

2. https://syncplicity.zendesk.com
sign up for a Syncplicity Support account and "open" a Support Ticket
 NOTE:  support will review the ticket and may take up to 1 day to respond 

3. write it yourself
obtaining the Service Provider x509 cert is the only really hard part
you can fetch that from the URL for your hosted site in method # 1

STEP 2

The attributes to be returned to the service provider after a successful login need to be defined.

The required attributes need to be added to 

/opt/shibboleth-idp/conf/attributes-resolver.xml 


Syncplicity needs a new section like this

 resolver:AttributeDefinition

 

a particular attribute is not required, but at least one must be capable of being turned into the "Name ID" for the conversation; and it must be tagged as being formatted as a

nameid-format:emailAddress 


For example

we invent an attribute "EmcID" and fill it with the users mail address from an LDAP query to Active Directory for the authenticated user and tag it as being formatted as a  

nameid-format:emailAddress  

and SAML encode it with the SAML2StringNameID routine


the result will be when it comes time to pare down the attributes to be sent back to the EMC Syncplicity service provider, this attribute will be available


STEP 3

The attributes to be released need to be defined in the attribute-filter policy file.

The attributes to be released need to be added to 

/opt/shibboleth-idp/conf/attributes-filter.xml 


Syncplicity needs a new section like this

 afp:AttributeFilterPolicy


an AttributeFilterPolicy applies to a particular Service Provider ID and declares what attributes are Permitted or Denied release, usually you will have more Deny rules than Permit rules


in a SAML2 based server its also important to filter out the "Transient ID" explicitly since it is by default Permitted and often unintentionally takes the place of the NameID

after all rules are applied to pare down the available attributes for a user, one is selected for the NameID and based on the Metadata from the Service Provider it uses an attribute that is in the format

nameid-format:emailAddress  

Syncplicity will use this attribute to find the User Account on the hosted Service Provider site and log them in


STEP 4


Services need to be stopped and started to pick up the changes.

# service tomcat stop
# service tomcat start

And a Shibboleth / Active Directory user should attempt to login to the EMC provided Service site

It will take them to their familar Shibboleth SSO logon page for authentication.

After authentication it will return them to the same EMC Service Site and if their

 NameID = nameid-format:emailAddress 

matches a User Account created in the EMC management page for this site.

They will be allowed to initiate a Syncplicity file sharing session.

To be completely clear

Syncplicity "uses" an Email address as the UID or Unique Identifier for a Syncplicity user account in their system. Shibboleth must return a NameID in an email address format that Syncplicity can use to "find" a Syncplicity user account in the EMC system. If it fails to find a match the user may indeed succeed in logging in with their SSO credentials but Syncplicity will present an error screen indicating it could not match up their login with a Syncplicity user account.

It is also not enough to return or "assert" an attribute for a successfully logged in user, it must be mapped or used as the NameID for the SAML conversation. Syncplicity does not scan the attributes returned for "any" email address, it only looks at the NameID of the SAML conversation.

This is "why" it is so critical to make sure a Transient ID doesn't get accidentally mapped into the NameID. It is in the wrong format and will not in general be sourced from the mail attribute for a user.

You can tell from the log messages in the idp-process.log when detail is turned up, which released attribute is being "used" for the NameID. This is a terrific troubleshooting step.

Its even easier if you use a SAML tracer plugin on Firefox to "watch" what is used as the NameID in the conversation between the browser and Syncplicity when it returns from a successful SSO sign in.

Which released attribute will be picked for the NameID can seem a bit random in nature depending on the attributes available after all the attribute filters for that service provider have been applied.


 TroubleShooting Tips! 


 TIP #1 

The logging for Idp, OpenSAML, LDAP and Protocol messages can be increased in this file

/opt/shibboleth-idp/conf/logging.xml

After restart the tomcat Shibboleth process will record additional detail in

/opt/shibboleth-idp/logs/idp-access.log
/opt/shibboleth-idp/logs/idp-audit.log
/opt/shibboleth-idp/logs/idp-process.log
  
the ipd-process.log file will contain the most useful information.

these log files typically roll over at midnight local time.

Be sure to reduce the logging detail after troubleshooting.


 TIP #2  

The Firefox web browser has a SAML transaction decoder and monitoring tool [ Add-on ]

 NOTE:  works with Firefox version 29.0 and later "only"  


After it is installed

> Tools
>> SAML tracer

will open a separate box and track all of the traffic within open browser windows

traffic identitied as encrypted and SAML encoded will be decrypted and decoded into human readable content (can you 'Spot' the <saml2:NameID > line?)




 Be Careful  when sharing screenshots of decrypted SAML sessions as there is often "sensitive" user information exchanged within the SAML transactions 


 TIP #3  

Once SSO is enabled, only Users with accounts already set up in Syncplicity will be able to log into their Syncplicity accounts.

To be clear

If "End-users" merely visit the hosted portal site at <custom-domain>.syncplicity.com and try to login with their SSO credentials. They may indeed succeed in authenticating, but upon return from their SSO login page Syncplicity "will not" proceed with the "Self-signup" process. They will be denied access.

   Setting up "End-user self-signup" is a completely separate Administrative task.    

Once it is configured and enabled End-users will need a specially crafted "invitation URL" created for the Syncplicity hosted domain in order to begin the self-signup process.

The "invitation URL" is unique to the hosted site, but not to the End-user, so once it is created the same URL can be shared with everyone who is entitled within an organization to participate.



3/26/2015

Win MMC, adding tasks to the ADUC menu


Its not a common thing to do, customizing the MMC console Apps so they are less annoying when they first startup, or adding third party tools that take arguments from an MMC context menu.. as in perform this task on this machine or collection of machines. Here's how to do that.

... to be continued

Win Task, email the results


There are a couple of ways of sending email from Windows 2008r2 or Windows 2012r2.

Both depend on whats inherently available with the operating system.

Windows 2008r2 included an email function built-into WinTask, but it also imposed a limitation on email "From:" to be only from the username that executed the task, hence that account had to have a mailbox or it would generically error out befuddling the hapless administrator.

Windows 2012r2 removed the email function citing security concerns and the availablility of a email function in the powershell toolbox as the preferred method for emailing.

This demonstration will show how to use both, when triggered by the ending of another WinTask script.. which can be monitored by process "WinTask name" using a custom XML trigger for its criteria.

... to be continued