Sunday, 4 November 2012

Michael Feather's 10 Papers Every Programmer Should Read (At Least Twice)

Michael Feathers posted 10 Papers Every Programmer Should Read (At Least Twice) which looks like a great list for a rainy day.

Here are the 10 (and I'm embaraced to say that I have not read most of them):
If you don't have time to read them, or want to chose the first one to tackle, go to Michael's 10 Papers Every Programmer Should Read (At Least Twice)  post and read is brief description of each of these papers.

Website monitoring services?

I'm looking for a website monitoring service (for a couple TeamMentor live sites) that provides the following:
  • Uptime (site is up/down)
  • Performance stats (page loads)
  • Broken pages/links
  • GUI still looks the same (this is a visual check, not a code one)
  • Transaction checks (for example 'login sequence' and 'article viewing')
  • Content changes (ideally with detection of injected malicious code)
  • Web/SaaS based solution
  • API to trigger and consume results
  • Solution based on Unit tests (where the checks are scripted and easily modified/customized) - but I don't think such service exists today :)
Any recommendations or personal accounts/horror-stories?

A quick google search found:



and http://www.alertra.com





Using SAST technology on Android to detect SSL implementations issues

Arvind called my attention to this pdf Why Eve and Mallory Love Android: An Analysis of Android SSL (In)Security which (looks like) is a great read and it includes this really interesting paragraph:

8. COUNTERMEASURES
8.1 OS SolutionsMalloDroid 

Installation Protection. (page 59)
MalloDroid could be integrated into app installers, such as Kirin [9], to perform static code analysis at install time. This analysis performed directly on a phone could warn of potentially unsafe applications. Users would then have to decide whether they wish to install the app irrespective of the warning.

I ABSOLUTELY agree with this!!!!!

There is a point where the complexity level of what is being implemented is so high and there are so many moving parts to take into account (or to do them consistently in deployment) that we need a way to codify what is (or should) happen.

Interesting SSL challenge between Dev/QA and production

So as we have another small issue with SSL in of TeamMentor's live server (see Problem loading content via SSL in docs.teammentor.net) I'm trying to figure out a way to make SSL deployment more robust.

At the moment there is already a setting in TM to force SSL redirects for all requests. But one issue that exists, is that normally during Dev and QA we don't test on SSL sites, which means that this setting tends to be disabled. Yes this something that we should be changing, but I really like the current light 'dev environment setup' that TM currently has, and adding SSL to it will increase its complexity.

This is actually one of those cases where the 'individual' solution(s) are easy and understood. The problem is in getting them to work in a streamlined and 'check-list-driven' mode. And that is one of the big challenges of Security. Every change as side-effects and ensuring that all moving parts happen at the same time and in the right order is a big challenge.

So when we (the security-side) say 'you should run all your site in SSL', we should understand that there is a lot more to it than just flip a switch in a webserver. See Etsy's Scaling User Security post for some of the challenges that they had when moving to SSL (and I also agree with their decision that the control of SSL should rely on the application and not on the infrastructure).

Another big problem that exists is getting accurate feedback on what is going on. Our UnitTest coverage in TM is not as good as it should, and we still don't have a live website monitoring with 'is it still ok' service (which is something we need to look into next)

I'm thinking about ways to address this in code:

  • Detect if the current server supports SSL (and don't allow SSL redirects if that is not working)
  • Allow the enable and disable of SSL via a special 'admin only' REST command (which will be a challenge to do if the whole site is currently redirecting to SSL)
  • Create a special 'Current Stats' REST command that provides information about the current server
  • Find if there is a way to access IIS logs from TM so that we can use TM to detect that something is going wrong with IIS (for example the 404 errors in the current problem are IIS one, and they never reach the .NET Http pipeline
  • Create a set of SAST rules specific for each release so that these 'check-list' items can be checked in a programatically fashion (and part of the deployment workflow)

Saturday, 3 November 2012

Windows Store/Metro Apps - A 'client-server' sandbox built using Javascript?

I read the MSDN article Web to Windows 8: Security by Tim Kulp (@seccode), and one topic that caught my attention was the idea that in Windows Store Apps there are two 'Contexts' that javascript can run under (see. Features and restrictions by context (Windows Store apps using JavaScript and HTML)) 

Tim in the Web to Windows 8: Security article keeps referring to the idea that in a normal client-server application (like when a website consumes data from a website/server) most client-side security is for 'usability purposes' and the real security work (for example Constrain, Reject and Sanitize input or authorise data accesses) happens at the server.

Now is correct when the 'assets (and capabilities) to protect' are at the server and the client shouldn't have full access to them.

I.e. the security needs to happen at the location where there are security implications and abuse scenarios. A simple example is authorisation: we don't want the user to be able to click on 'admin' features, but the enforcement of that security measure (i.e. 'users don't have access to admin functions') must not happen on the client but on the server.

So as I read that article and got my head around the new 'Local vs Web context' I was thinking "Hold on, this has nothing to do with javascript code vs server code". What matters is 'where' the client and server code are located. And it looks to me as what is happening is that in Windows Store Apps the client is the 'Web Content' code and the server is the 'Local context' code

Looking at this code execution from the point of view of trust and capabilities boundaries, we have the same concepts and architecture as in the normal 'Browser-WebServer' model.

In the example shown in the article, there is code that running at a higher privilege mode (the Local Context code) which as access to important assets (like the local data storage) and there is code that runs at a lower privilege mode (the Web Context code) which is going to do dangerous thinks like 'fetching javascript from other sources'.

There is even an 'official' communication channel between the Web and Local contexts that uses the postMessage Html5 feature (see example in 'Communicating Between Contexts' section) 

This is a typical client-server architecture where security needs to be applied at the location where the assets can be accessed (in this case the Local Context code) and 'untrusted code' is sandboxed (i.e. isolated).

Is this Microsoft inventing another Sandbox technology? (Btw I still think that CAS (Code Access Security) is by far the best Sandbox model out there , which is a shame since CAS has been killed but  since there is a big different between mostly dead and all dead a 'miracle man' might bring it back one day :)  )

Back to Windows Store Apps, the most important question on any Sandboxing technology, is who is enforcing the sandbox? 

Practically speaking, a Sandbox is just a way to prevent 'unprivileged code' from executing 'privileged actions' or accessing 'privileged data':
  • In kernel drivers: there is no sandbox
  • In Windows apps: The Windows Process is the sandbox, enforced by the Kernel
  • In .Net and IIS apps: The Windows Process is the sandbox, enforced by the Kernel
  • In .Net apps and IIS running in partial trust: The .Net's AppDomain is the sandbox, enforced by the CLR
  • In Client-Server apps: the client is the sandbox, enforced by the server's attack surface
  • In Mobile apps: the app 'execution environment/process' is the sandbox, enforced by the OS (and a security policy)
  • In Windows 8 Store Apps: the Web Context is the sandbox, but who enforces it?
Its the last one that I am not sure of:
  • Who is actually enforcing this Sandbox? the browser? the Javascript engine, a javascript APIs? the windows process?
  • What are the communication possibilities between the Web and Local contexts?
  • Is there an CAS-Like security demands architecture that declares and enforces Code Access Security on specific functions (or assets)?
  • Aren't they both (Web and Local contexts) javascript/html code that is running on the same browser session? (and OS process)?
  • Isn't there a gazillion of objects (think Html elements and Javascript variables/objects) that are shared between them?
  • How does this play with the powerful javascript capabilties to 'bend reality' and change just about everything (for example prototypes)?
  • What are the rules-of-engagement for the Javascript this object?
  • What about all those Html 5 security issues? (see these two cheat-sheets)
  • Are there any SAST (static code analysis) tools that can scan these Windows Store Apps and identify security issues?
  • Is this a javascript sandbox for javascript code? That is a hard one to pull off (and if so, surely Microsoft must have changed the way its Javascript's engine works)
Btw, let me know if there a site or page with these answers? (see the Windows 8 Sandboxing post for some good references I found)  

OK, so if I'm getting this right, in Windows Store Apps: 
  • We have a browser (IE 10) running under an 'locked down' user identity (with for example file restrictions enforced by the OS)
  • That browser loads a website which has Javascript code running under two different contexts
  • 'Somebody' is enforcing/sandboxing a number of security restrictions on the 'Web Context' javascript code
  • There are a number of 'Javascript accessible' assets that need to be protected from that sandboxed Javascript code (which that can come from hostile/compromised sources)
Humm... this sounds very dangerous (from a security point of view). 

I bet part of Microsoft's strategy to keep Metro Apps secure, is to do a lot of security analysis on the app's submission for publishing (note: after trying very hard on this post to use the 'Windows Store Apps' (or whatever the latest name is) I agree with Hal in just keep calling it Metro , and am going to use the Metro Apps name from now on).




Appendix: 

Error in plain sight: What is wrong with these two pictures (which passed MSDN publishing QA)

Image from the MSDN article:


Original image (used as inspiration for the one above)



Friday, 2 November 2012

Util - Cir Viewer (with C# DLL converter) v1.0

Here is an oldie one by still really effective.

I just rebuilt the O2's CirViewer (CIR = Common Intermediate Representation (from the OunceLabs days)) as an easy to consume stand-alone tool which you can get from: Util - Cir Viewer (with C# DLL converter) v1.0.exe

MSDN Magazine article: "Web to Windows 8: Security"

Here is an interesting article to read (which I haven't (yet)):

Web to Windows 8: Security

It is in the Nov 2012 issue of MSDN magazine, in the Javascript Security section, and it covers topics like:

  • Input Validation 
  • Sensitive Data Storage 
  • Local vs. Web Contexts 
  • Communicating Between Contexts

Scripting MDbg and DbgHostLib

If you are into script .Net debugging sessions (see WinDbg, Cdb, Sun-Of-Strike and Util - Start SoSNet (O2 Version).exe  and Scripting SoS (Sun-of-Strike) .Net managed extension using O2 ) you will also find interesting the Scripting MDbg.pdf and  Scripting DbgHostLib.pdf documents (both embedded below)

WinDbg, Cdb, Sun-Of-Strike and Util - Start SoSNet (O2 Version).exe

If you are want to manipulate or analyze a .Net in real time, one of the best options is to use the .Net debugging API, and the best way to do that is to use the cdb.exe utility (downloadable from here) with the SoS (Sun-Of-Strike) managed debugger extension

A while back I found the SoSNet project (which was a gui on top of Sos) from https://bitbucket.org/grozeille/sosnet which I then forked into https://github.com/o2platform/O2_Fork_SoS_Net/ in order to allow it to compile under Roslyn (and add a couple other changes/fixes)

If you want to give this tool a test drive here is an stand-alone exe: Util - Start SoSNet (O2 Version) v1.0.exe (created from the Util - Start SoSNet (O2 Version).h2 script), which you can see in action at the end of this post.

Scripting SoS (Sun-of-Strike) .Net managed extension using O2

If you want to script the Sun-of-Strike (SoS) managed .Net debugging extension (see WinDbg, Cdb, Sun-Of-Strike and Util - Start SoSNet (O2 Version).exe post) you should read the Scripting SoS.net pdf (embedded bellow) since it provides a detailed explanation (with tons of scripts) of how I used the O2 Platform to script (in realtime) SoS and to create the Util - Start SoSNet (O2 Version) v1.0.exe tool (see also the SunOfStripeAPI.cs and SosNet scripts folder)

(tips of Firebug and) Using TM code sample as source material for posts

Arvind just posted Javascript application testing - Firebug which talks about using Firebug to do some client-side manipulation on a browser.

What I like about that post is that he is using TeamMentor as the background of his example.

That is great, since one of the reasons why I fell is so important to have TeamMentor's source code publicly available is to allow its code to be used in application security threads (like for example the one I tried to start with Is there a spreadsheet/template for Mapping WebServices Authorization Rules? ) 

Thursday, 1 November 2012

The complexity will still exists (even if you don't want to look at it)

One of the common complains I get when presenting a large set of ideas (or prototypes) is the "woooahhh that's complex" or "that's too complex" or "that's too much"

To usually my reply is "... well we are dealing with a complex topic..."

It's always interesting how it is easier to ignore complexity, than it is to try to understand it.

It's easier to ignore reality, than to see what really exists (or what is possible).

And the 'reality' will still be there, but if we ignore it, usually what happens is : Nothing! 

Unless we are very lucky, it is very hard to solve a problem when we don't know what the problem is.

For me, the interesting questions are :

  • "Is this 'complex thing' that I'm presenting an accurate representation of reality?"
  • "If so, is it simpler than the previous version (or the current status quo)"
If the answer is NO, then its time to understand where the 'understanding gaps' exist, to modify the model/solution and to see if it still works.

If the answer is YES, then I'm happy that I'm on the right direction.

Now usually at this stage, the 'complexity level' is still too high, and maybe the target 'user base' is very small. But I believe that Simple solutions are a result of an continuous refactoring of complexity, until the 'right' solution 'just happens'. 

So until we reach the "...now that's simple..." destination, its time to go back to the engine room and  create the next generation of the working prototype (which hopefully will be simpler/less-complex and closer to the final solution).

Btw, one of my favourite moments, was when I was presenting (to a wider audience) an early prototype of O2's ability to visualise multiple SAST traces into one 'consolidated trace' and 

 ... the first guy said (pointing at the screen) "THAT! is crazy!, this is far to complex and hard to use"
and

 ... the 2nd guy said (pointing at the screen) "THAT! is simplicity!, because I spend hours and hours to process the same traces, and don't even get to this level of understanding" 

I wish that OWASP in 2014 ....

In 2014, it would be amazing if OWASP  has:

Wednesday, 31 October 2012

Open question to Etsy security team: How can OWASP help?

Since I don't have a direct contact at Etsy's security team (apart from security-reports@etsy.com), here is the question I would like to ask them (which hopefully will reach the right person).

------------------------------------------------------------------------------------------------

Dear Etsy security team, 

How can OWASP help?

Etsy.com - A case study on how to do security right?

First a quick disclaimer that as far as I can think of, I don't know anybody at Etsy.com or had any conversations with them in the past.

Following from Nick's presentation on Amazing presentation on integrating security into the SDL ,  my look into Etsy's Code as Craft blog and my experiment with Graphite (see Measure Anything, Measure Everything, AppSensor and Simple Graphite Hosting).

I have to say that I have been more and more impressed with Etsy's pragmatic and focused approach to application security.

For example check these out:


This is 'real-world' stuff and its what happens when there is a good awareness on the importance and need for doing security.

As you can see,  here is a team (from management to engineering) that 'gets' application security, and these are the guys that should be driving a number of OWASP's initiatives, since they represent the 'real-world'. Please correct me if I'm wrong, but a google and owasp search (for 'OWASP Etsy') didn't show a lot of joint activity (the best ones where Nick's participation in the AppSec USA and this job post mentioning the OWASP Top 10). It would be great to see Etsy's guys pushing projects like: AppSensor, ESAPI, Zap, Testing+Developer+Code-Review guides, O2, Exams/Certification, etc...

We (OWASP) need to find ways go get these guys more involved and put them on the driving seat.

In fact, for the next OWASP Summit, we have to make sure these guys are there, working collaboratively with the best minds in Application Security :)

CsQuery - C# jQuery Port for .NET 4.0

CsQuery sounds like a very interresting project, specially it's DOM parsing capabilities.

Need to take it for a test drive and see how well it works.

Measure Anything, Measure Everything, AppSensor and Simple Graphite Hosting

One of Nick's key concepts in his Amazing presentation on integrating security into the SDL presentation is the need to measure and visualize what is happening with an application (and the side-effects of code deployments/fixes).

A key reference is the Measure Anything, Measure Everything and Tracking Every Release posts which talk about how etsy.com uses the Graphite ('Scalable Realtime Graphing') tool with some events consolidation/aggregation via StatsD

What is really interesting about this 'events monitoring capabilities' is that it can be used to monitor Network/Application behaviour/status, and capture/visualize security events (check out the login failures graph in the Measure Anything, Measure Everything post). And if you add this to an OWASP AppSensor aware app, we start to have a very interesting/powerful solution.

So (since we need a solution to monitor what is going on with Teammentor.net) I want to give Graphite a test drive.

The first problem is that the Graphite Installation page has a couple more dependencies and steps than I would like (I was expecting one download and two steps: download + Run :)  )


So since I'm not in the mood (or have the time) to do some linux hacking, I googled for a hosted solution and found the Hosted Graphite company who is providing what I need at a price that allows me to experiment them:


Let's see what happens :)


My TeamMentor 'to-do' list for the next 6/12 months :)

I was thinking today about the areas/ideas that I think should/could be developed over the next 6/12 months on TeamMentor and come up with the list below (I stopped after a while since the list was getting quite big :)  )

The good news is that with the new TeamMentor 3.2 codebase and architecture, this is all doable, specially when compared with what has already been implemented over the past 18 months (btw, if you are a TM user feel free to put 'pressure' on which ones should happen first :) ).

With the caveat that these (very draft/raw) ideas are not in the right order in terms of priority or effort:  

Key Scenarios to support/improve:
  • How Developers find/are-exposed-to TM content
  • Time that it takes to create an Article
  • Time that it takes to push changes to an article (from the first email/reddit comment, to its creation/edition, to its publishing in the official SI library, to the moment it is available in a customer site)
  • Improve TM hyperlinks and its connections to/from the best content out there
  • Ability for TM to help developers to fix code
  • Ability of TM to help policy makers to define, distribute and enforce security policies
  • Ability to 'react to current events' and have relevant TM articles about it
  • How Security teams create and distribute their findings
  • How Security Knowledge and 'Best Practices' are created
  • How Security tools show guidance for the security issues their tools are able to find
  • How easy it is to create/convert content into the TM_Article schema
TM integration with 3rd party tools:
  • Consume TM in:
    • Security tools:
      • AppScan suite, HP tools, ThreadFix, Armorize, Veracode, Whitehat, Zap, ThreatModeller, Qualys, Metasploit Netsparker (see more tools here)
    • 'Policy' tools (and CMS)
      • MediaWiki, Sharepoint and what ever tools the CIOs and 'Policy-guys' use
    • IDEs:
      • VisualStudio (better plugin) Eclipse, MonoDevelop, Notepad, latest online javascript editor, GitHub, etc... (see IDE list here)
  • Import/Export
    • security-findings conversion into TM Article Schema,
  • Allow TM to directly invoke (and control) external tools for example:
    • Trigger scans from TeamMentor GUI
Make TeamMentor.net, docs.teammentor.net and teammentor.teammentor.net spectacular TM case studies
  • Use the fact that we use TM ourselves to show how/where TM adds value
  • On TeamMentor.net give the marketing team maximum visibility into what is going and integrate/export 'TM generated data' with the tools they use (email, SalesForce, HubSpot,etc...)
  • Add issues documented in https://github.com/TeamMentor/Master/issues?milestone=3&state=open and the next batch of their requests
Make TeamMentor a case study of a 'Secure app'
  • Document TM's security architecture and use it as a case study of 'how things should be done' (working with the AppSec community on what that actually means)
  • Continue with the practice of 'please hack teammentor' and the 'TM security bounty'
  • Add security features like HSTS and CSP (Content Security Policies)
  • Find a way to scan/test TeamMentor using the best security tools out there (Commercial and Open Source)

Consume/Map external data
  • NIST, CWE, SANS, OWASP, MSDN, StackExchange, Google
  • Better ways to consume/present TM data:
    • 'Google like' search engine mode 
    • Article's mappings schemas, 
    • Better design 
    • Link's visualisation,
Change TM Articles from the current 'flat content format' to a  'content + mappings' format:
  • Figure out a way to create, package and create TM Articles based on the concept of 'virtual mappings'
  • A key scenario to support is the reuse of the same landing pages for multiple technologies (i.e. '1 landing page + n mappings' into 'technologic specific' content/article)
    • This  'technologic specific' content, can be another TM Article or an external resource (a page in CWE site) or even just a title/topic ('Section XYZ of PCI ABC standard')
TeamMentor Mobile/Tablet
  • Auto detection and display 'TM mobile version' to mobile users
  • Create downloadable/installable versions of TM Libraries (which can be sold in Apple's or Android's AppStore)
  • Use this version to explore multiple GUI options and to implemente (a much needed REST API for the fetch of Library/Folder/View data)
  • Find a way to package 'security reports' in TM Libraries that can be securely consumed on a tablet
  • Explore the reuse of the GUIs created for tablets in the developer's IDEs (i.e the same Web Interface used to consume (navigate into) an TM Article would be the same in an (Android) Tablet and in the developer's (VisualStudio) IDE.
    • This is a really important concept and one that I think will make a massive difference in TM's adoption and use
Improve TM Design
  • First 'clean rough edges' Design pass
  • 'What should TM 4.0 look like' design pass
  • Focus on making TM 'Simple to use'
  • Think about better ways to present the main TM web GUI (which at the moment is quite cluttered)

Technologic changes needed on TM code base:
  • Improve Unit Tests support and use them as part of TM continuous build
  • New control panel
  • Improve User Management and Automation of User provisioning/management 
  • Improve TM's use of Git's engine
    • Auto Commit on code changes
    • View Articles changes
    • Ability to change between TM versions (i.e. to go back into 'GitHub history')
  • Use Asp.Net MVC 4.0 for request routing
  • Add activity/request monitoring capabilities (maybe using Graphite) and add support for AppSensor-like capabilities
  • Remove legacy APIs and dead code (from TM 2.0)
  • Improve TM article cache architecture
  • Better HTML online editing capabilities
  • Better WikiText/Markup online editing capabilities (starting by adding Markup support)
  • Ability to Import data from other sources (word docs, web pages, etc..)
  • Allow the secure storage of data (by encrypting an Article's content (not the metadata))
  • Add TM installer for IIS and a better launcher (i.e. remove that 'start TeamMentor.bat')
  • Add support for OAuth authentication where it would be possible to authenticate using (for example) Google/Gmail, Twitter, Facebook, etc..
  • Add online-payments support to TM where the user can buy a TM license or to a TM Library from TM's user's control panel
  • Create a read-only version of TM 
  • Add support for 'providing anonymous feedback on TM usage' (with usage data and bugs/problems sent to SI)
Support for scheduled tasks:
  • Auto fetch of Content changes (and if desired, with auto merge with existing content)
  • Auto update (latest version of Code)
  • Auto rebuild (for sites like TeamMentor.net that need to always been in a pristine state)
  • Stats-web-traffic data analysis and email to devs and marketing
  • User Management (for example to expire users)

User-centric capabilities
  • Ability to track user's usage of TM
  • Ability to store user data and activities
  • Ability to change GUI based on store user data (namely its activities, behaviour and tasks)
  • Ability to define what a user should do in TM

TM deployments monitoring technologues, 
  • Ability to deploy first 10s then 100s of new TM instances per day 
  • TM Cloud Provisioning 'Control Panel' - with ability to create/start/stop new TM instances with a couple clicks
Improve 'Content Changes/Comments' workflow
  • Improve GUI to track and visualize content changes
  • Add support for 'Article' Forks (just like https://gist.github.com/ )
  • Allow users to make comments (and link to) to specific parts of an article (this could be done on a per user article fork)
Inter-TM communication where TM instances can
  • talk to each other and automatically Download/upload content
  • send/receive user data/activities/tasks

Trust should be the currency of software

See Rachel Botsman's Ted talk  The currency of the new economy is trust and think about how we could use similar trust models to map out the security properties of applications, APIs or even code snippets

Tuesday, 30 October 2012

The next level App Security Social Graph

My core belief is that openness and visibility will eventually create a model/environment where the 'right thing' tends to happen, since it is not sustainable (or acceptable) to do the 'wrong thing' (which without that visibility is usually not exposed and contested). See the first couple minutes on the Git and Demoracy presentation for a real powerful example of this 'popular/viral awareness' in action.

When I look at my country (Portugal and now UK) or my industry (WebAppSec) I see countless examples of scenarios where if information was being disclosed and presented in a consumable way, A LOT of what happens would not be tolerated.

For example, we (in WebAppSec) industry know how bad the software and applications created every day are. And we (and the customers) have accepted that vulnerabilities are just part of creating software, and that the best we can do is to improve the SDL (and reduce risk).

But, if the real scale of the problem was known, would we (as a society or industry) accept it? Would we accept that large parts of our society are built on top of applications that very few people have any idea of how they work? (might as well if they are secure).

So while OWASP is busy booking meetings to have meetings, the rest of the world is moving on, and is trying to find ways to connect data sets in a way that 'reality is understandable/visible', so that what is really going on, is exposed in a easy to consume and actionable way.

For example take a look at the Next Level Doctor Social Graph for an attempt at driving change while trying to figure out a commercially viable way of doing it (check out their '“Open Source Eventually” idea)



From that page, here is is their description of the problem:

"It is very difficult to fairly evaluate the quality of doctors in this country. Our State Medical Boards only go after the most outrageous doctors. The doctor review websites are generally popularity contests. Doctors with a good bedside manner do well. Doctors without strong social skills can do poorly, even if they are good doctors. It is difficult to evaluate doctors fairly. Using this data set, it should be possible to build software that evaluates doctors by viewing referrals as “votes” for each other." (see related reddit thread here)

This is what they call the Next Level Doctor Social Graph , and when I was reading it I was thinking about doing the same for software/apps under the title: The next level App Security Social Graph

Here is the same text with some minor changes (in bold) on what the  The next level App Security Social Graph could be:

"It is very difficult to fairly evaluate the quality of software/application's security in this country. Our regulators only go after the most outrageous incidents/data-breaches. The product/services websites are generally popularity contests. Applications with a good marketing do well. Applications without strong presentation skills can do poorly, even if they are secure applications. It is difficult to evaluate security fairly. Using this data set, it should be possible to build software that evaluates application's security by viewing ..... (to be defined)"

It would be great if the current debate was on that ..... (to be defined) bit (ideally with a number of active experiments going on to figure out the best metrics) ... but we quite far away from that world ....

... meanwhile another 8763 vulnerabilities (change this value to a quantity you think is right) have just been created since you started reading this post. These 'freshly baked' vulnerabilities are now in some code repository and will be coming soon to an app that you use (and your best defence is to hope that you are not caught by its side-effects)

Opposite of 'Security as TAX'

In the multiple articles tagged with Security as TAX I tried to show examples where security and 'secure coding' doesn't add (direct) value to an application/developer and is something the devs/companies have to pay in order to publish/release an application.

They are usually cases where the app was working ok in the 'insecure' state and the fixes had some nasty side effects (or where hard to implement).

But as I am planning to write a couple example of where security DOES add value (think: Amazing presentation on integrating security into the SDL), I was wondering what is the opposite of 'Security as TAX':

Humm... none of them works very well...

Let me know if you have any good ideas

Monday, 29 October 2012

Handling code samples on translation of technical content


Here an interesting problem, how to deal with code-samples when doing translations?

We are in the process of translating TeamMentor into a couple languages and the issue come up on how to identify the Code Samples for the translators (which at the moment should all be wrapped using <pre> tags (since that is how the Javascript-based-code-formatting works)).

Here is my first raw idea:
  1. create a fork (of the target library) for a particular translation
  2. run a script on all articles that remotes ALL code samples and replaces it with a unique ID (the extracted code snipptets would be stored separately)
  3. the translators work on the articles (which now have no code samples)
  4. the translators commit their change into their fork (we can help them if they want)
  5. we re-apply the code samples
What I like about this idea is: 

1) we remove 'areas for translators to make mistakes' (i.e. there are no code samples in their content)
2) we are able to visualize all code samples in one place
3) we can make a pontual decision on the cases where it makes sense to do some translation on the code samples (cases where there is a lot important code comments)

Since the translation house(s) have its own tools (and parsers), the final solution is probably going to be a mix of this idea and what they already do with their technology (no need to solve problems that already have solutions :)  )

Any good solutions out there that work well for Html content with code samples?

Util - O2 Java Tools (IKVM Based) v1.0

For the Java users, here are a couple O2 Tools that expose GUIs to view java class files  and programatically analyze them.

These tools leverage the amazing IKVM project to parse the Java class files into C# classes.

You can download the exe from Util - O2 Java Tools - IKVM Based v1.0.exe (its 20Mb since it includes the latest version of IKVM)

So nice of Microsoft to keep the level low :)

As I am starting to worry about 99.999% website uptime and availability for TeamMentor.net (let me know if you know any good website monitoring services, or tools, or APIs), it is nice to know that if do we achieve that, we will be way above the average :)

For example, here is what happened today (2:13am on 29th/Oct/2012) if you click on 'Schedule service' or 'Check service status' from the new shiny Microsoft Suface website:


Oops , this what we get on https://myservice.surface.com :


Don't they have website monitoring or WAFs over there?

It looks like the problem is in the https part of the surface.com site (the http redirects to a microsoft.com url)


Now here an interesting twist, I was going to recommend that they used ASafaWeb but all looks good from its point of view (note how the main request returns a valid page)


so I though that maybe the problem was with using Chrome, and IE would work, but no such luck, IE shows the same error:


There is definitely something interesting going on here, I wonder what it is :)

The realisty is that it is really complex to provide online services. Its an environment with very little margin for error,  where every small detail counts and semi-real-time feedback/reaction is really important.

The Day Microsoft killed Partial Trust

I missed this when it come out (was in June 2012?) , but I guess that Microsoft ask finally killed ASP.NET partial trust:


This is how the  ASP.NET Partial Trust does not guarantee application isolation KB article describes it:"...We previously described ASP.NET partial trust as a mechanism for enforcing application isolation in a shared hosting environment in which multiple applications that have different trust levels are hosted on the same web server. We are updating our guidance about this to reflect that running an ASP.NET page framework application in partial trust does not guarantee complete isolation from other applications that are running in the same process or on the same computer..."

I guess I could see this coming, since Partial Trust has been a massive failure with very little adoption and commercial use.

I wonder what prompted this announcement? I would bet that Microsoft found some nasty vulns in the PartialTrust environment which they can't (or won't) fix, so it's better to drop Partial Trust than to wait for a public disclosure.

It's actually quite sad to see such powerful idea and technology being dropped, but at least the good news is that it makes it more clear that running .NET code is a very dangerous activity and that we need better Sandboxing and SAST technologies.

I have always been a fan of .NET's partial trust, which was MUCH better designed and implemented than the Java Security Manager, and for a while it showed a path into a much safer .Net development environment.