Category: Agile Software

Contributing Authors to the Practical Software Security Book

By , January 24, 2012

If you are a regular reader of this blog you should know I am working on a book for O’Reilly called Practical Software Security. It’s in the early stages and evolving as we start to get into the details. You can sign up to get notifications of progress here.

There are five main sections:

  • Introduction
  • Security Concepts
  • Languages & Frameworks (was called Tools & Technologies)
  • Building a Software Security Program
  • Engineering Scenarios

In the Security Concepts section we will introduce developers to things like cryptography, authentication, authorization and then in the Languages & Frameworks sections we will cover the security features available and how to use them properly for the popular development technologies. In the engineering scenarios well get to code level guidance of how to pull it all together to solve real world problems that all developers face like securing a REST API or creating a federated authentication system.

I am delighted that we have been able to recruit a fantastic list of subject matter experts to write and review the Languages & Frameworks section of the book. I will be writing the Security Concepts section (and the Ruby on Rails section) and the following folks will be writing or reviewing:

Note: we will be doing C / C++ as there is still so much being produced but haven’t yet locked on that author and we will be figuring out how to deal with things like Spring or Cake (and where to draw the line).

In the Building a Software Security Program section we organize the section into People, Process & Tools. Justin Collins (author of Brakeman Scanner) is going to write the static code analysis section in Tools and Tasos Laskos (author of Arachni) will write about how dynamic web application scanners work. Many other tools will of course be covered! I will be writing extensively about integrating Agile practices and using TDD / BDD techniques and tools. I probably won’t start on this section until March / April. I am hoping we will have the Security Concepts section and the Languages & Frameworks section complete by the end of February so we can open up a site for a much broader set of reviewers (invite only but register to get on the invite request list here) around March.

OK, now to set up the git repo for the contributing authors, create a README.md for them and kick off the discussion about we want to structure things. Gentlemen start your engines!

 

Edits : 1/25 – Added HTML5 (and friends), 1/25 – Added Gunnar Peterson to Identity

Share on TwitterSubmit to reddit

Git Cheat Sheet

By , January 17, 2012

 

I have started making some developer cheat sheets for my own personal use using EverNote. There is so much to remember and I am often reminded that the goal is to develop good software and not to remember thousands of commands (as big and superior as doing that makes some people feel). I need cheat sheets! I am working on my own cheat-sheets for git, zsh, rvm, aws and heroku as well as some language ones.  A few folks asked me to share them so here goes starting with my git cheat sheet . Given they are primarily for myself they won’t contain all commands you may want to use so feel free to copy and modify (this is all copied from others in the first place). For instance in this git cheat sheet there is no rebasing and very little about resetting your local repository when things go horribly wrong. I am sure I will update it in due course. You can subscribe to the shared Evernote file if you are an EverNote user here. I will try and keep this page updated but that EverNote will be my source of truth!
If you do find mistakes, have smarter ways of doing things or can’t figure out why something is missing do let me know. I would love to make it better for me and anyone who is using it.
Useful Resources
(see shell customization cheat sheet for adding a good git prompt in the shell)


Global Settings

git config [--global]

User Details
user.name $name i.e git config –global user.name Mark Curphey
user.email $email i.e git config –global user.email mark@curphey.com
Github
github.user $user
github.token $token
or just edit the ~/.gitconfig file !

 

Creating Repositories

Create Local Repository from an Existing Local Project

cd ~/project_dir
git init
git add .

Clone Remote Repository
git clone git://github.com/user/repo.git
git clone https://github.com/user/repo.git

Clone a Local Repository
git clone ~/existing/repo ~/new/repo
git clone you@host.org:dir/project.git

Local Repositories
List Changes in Working Directory
git status

Add Files to Repository
git add [filename1] [filename2]
git add .

Delete Files in Repository
git rm [filename1] [filename2]

List Changes to Tracked Files
git diff

Commit Changes
git commit -am “commit message”
(-a is all files that are tracked, NOT all files, so you still need to add filename or add .)
(-m is with a commit message)
Return to Last Committed State
git reset –hard HEAD


Remote Repositories (Github)


List Remote Repositories Aliased
git remote

Add Remote Repository
git remote add [alias] [location] i.e. git remote add origin git://github.com/curphey/repo.git

Remove Remote Repository
git remote rm [alias] i.e. git remote rm origin

Pull from Remote Repository and Merge into Current Branch
git pull [alias] [location] i.e. git pull origin master
(once you have pulled once the alias and remote branch are no longer needed)

git fetch from Remote Repository is same as pull but without auto-merging

Push Local Changes to Remote
git push [alias] [branch]

If the server rejects your push, always try a git pull and then retry as 99 times out of 100 you didn’t have the latest remote!


Branching and Merging

List Available Branches
git branch

Create a Branch
git branch [branch name] i.e git branch [experimental]

Switch to Work in a Branch
git checkout [branch name] i.e git checkout experimental
Create and Immediately Switch to New Branch (i.e both of last two steps)
git checkout -b [branch name]

Merge Branch
git merge [branch to merge] i.e. git merge experimental will merge experimental back into working branch

Track Original Repository of an Open Source Project on Github
Fork repository, create an upstream remote, fetch and merge (or pull) changes into your fork.

git remote add upstream https://github.com/rails/rails.git
git fetch upstream
git merge upstream/master

Show Log of Activity
git log

Tag a Commit i.e. v.0_beta1
git tag [note]
Share on TwitterSubmit to reddit

What’s on Your List ? Web Dev Stuff That I’m Watching & Playing

By , August 24, 2011

This is my tickler list of web dev stuff I am currently watching and or playing with :

What’s on your list (and missing from mine)?

Share on TwitterSubmit to reddit

Setting up a Python Development Environment on OSX – Part 4 – Setting Up Pycharm

By , August 17, 2011

This is part 4 of a series on setting up a great Python development environment on OSX. Part 1 can be found here, Part 2 can be found here and Part 3 here. This simple part focuses on configuring Pycharm to use your VirtualEnv (Part 3).

The religious debate over IDE versus text editors can rage on. I like both but generally want to use an IDE where it helps me. The JetBrains IDE’s are great and Pycharm is the Python version. It’s $99 but well worth the money. Current version is 1.5.x and can be found here. Installation is simple and easy.

The first thing you will want to do when you are installed is to be able to point your project to the virtual environment you created in Part 3. Pycharm stores IDE preferences in a series of files in the.idea folder. These is a hidden folder so you need to use a neat OSX trick to view them. You can set global OSX preferences to show all hidden folders and files or as a quick temporary fix you can hold down Shift + Command + Period at an Open dialog box! Create a new project (in my case “test_charm”, navigate to it from File Open in Pycharm and then Shift + Command + Period and you will see the files in my screen shot.

Hidden files

Some settings are IDE wide and some settings are per project. I haven’t audited which ones are which (if anyone has done this it would be useful so please share) but I am assured by the JetBrains support that the interpreter configuration is per project (so I assume stored in the.iml file) and I have tested this to validate. By default you will see below when I create a new project I am using the system interpreter (2.7.1) and you will notice I just have a few site-packages installed.

Pycharm vanilla project

To set up Pycharm to use use a VirtualEnv I first create the virtualEnv in terminal (see Part 3), then create a new Pycharm project in the folder. The virtualEnv creates three folders (bin, lib and include so I create a “source” folder at the same level and create the project in that.

New env

Now create your new project in the “source” folder of the virtualenv structure

Pycharm new

From the Pycharm preferences menu select the Python interpreter and navigate to the /bin folder of the virtualenv you created. Select add and Pycharm will do some analysis. When it has finished remove the system interpreter and you will be left with your virtualenv.

Pycharm prefs

Back in the main Pycharm window you all now see the project is pointing at the virtualenv interpreter! Voila! You can install packages using pip etc. and away you go !!

Next in the final part of the series an end-to-end project setup using all thats we have been threw for a simple web app using Django and a SQL Lite database along with Splinter, Selenium, Lettuce and South!

Share on TwitterSubmit to reddit

Six Things Running Taught Me About Learning to Code

By , July 26, 2011
I have been a distance runner now for about five years. It started with a the classic mid-life crisis: a trip to the Doctors for a tight chest only to be told that I had high-cholesterol, was dealing with way to much stress in my life and was a little over-weight. Oh yeah and I was approaching middle-age. I like to forget that part. At the time I was living in Boston and just about to move to France, having decided to take some time out from from a corporate career to explore a start-up idea. While the family moved to Toulouse I stayed behind in the US for two months finalizing the sale of the house. After seeing the Doctor I decided to radically change my diet and pick up running rather than start the slippery slope of medication. We lived minutes from Concord (where Paul Revere rode from Boston to notify the colonial militia of a British invasion), an area filled with amazing woodlands and trails. I changed my diet eating to consistent of pretty much nothing but cold chicken and salad for two months. I started off with short daily runs that near killed me but persevered and within a few weeks was running a few miles a day. By the time I went back to the Doctors 8 weeks later he was so taken aback by the progress that my blood tests showed I had made, he did everything short of accusing me of somehow cheating. Granted I had stopped working, had no financial stress and the ability to 100% focus on nothing but by health for two months but even given these luxury circumstances the results were abnormally good. It was at this point when I think I really became a runner life.My running has certainly varied over the years from near obsessive (currently) to the occasional casual run but no mater what the state of commitment, I have learned a tremendous amount about physical and mental training. I have learned a great deal about the human body (including the brain),  about myself and what I am capable of and how to apply what I have learned from running to other areas of my life. When I recently decided to learn Python I wasn’t at all surprised at how many times I drew on experience and knowledge learned from running.

Exercise Improves the Brain
When you run you increase blood flow. Your heart pumps harder and faster and blood flows to all parts of your body including your brain. More blood means more oxygen, nutrients and waste removal. When you exercises your body produces nitric oxide which regulates blood flow. As the flow gets more efficient the body produces more blood vessels which are in turn more effective at reaching the entire body including the brain. Studies have shown that more blood flow in the hippoocampus, an area of the brain involved in memory formation help people remember things. Other studies have shown that exercise stimulates Brain Derived Neurotrophic Factor (BDNF) and if that sounds grande it is, described in Brain Rules as brain fertilizer!

Training Schedules Matter
When you have a schedule you know what you are setting out to achieve and have something to measure your results against. You have a target. I run slow (anywhere from 9:00 to 10 min / miles). I only really care about the number of times I run each week and the distance I go each time. Many people track pace and cadence but I like to schedule distance as I get a kick out the number of miles I run in a week or a month and use the other metrics as ‘interesting’.  Schedules for me are actually about more than planning and tracking performance, they are a North Star that keep me motivated during the week. When you are good at setting realistic schedules and you have a track record of getting results from following schedules it becomes very hard to argue with yourself why not following your schedule will be OK. The human mind is amazing at convincing itself that the decisions it has made are the right ones. “I am not going to run today but that’s OK because X, Y and Z”. I once read a great article (lost reference) describing how people spend 90% of the time convincing themselves they are doing then right thing in which the author told described how people tell themselves they look great in particular clothes when for the vast majority of humans they can only ever hope to look average.

Of course coding is not always like running. If I put one foot in front of the other for an hour I know I will go roughly 7 miles but if I sit down to learn something for an hour I can’t do the same mapping and expect the same results. This is why I chose to use Agile planning. I created a backlog of Python learning (I used Rally) and used Agile estimation to track relative velocity. At the end of each day I knew what progress I had made and where I was tracking.

Schedules keep me truthful.

Walk the Course
There is an interesting phenomenon that running coaches across the world know and teach. No matter how mentally tough the athlete, the human body always holds something back if it doesn’t know when the pain will end. Running coaches have their athletes walk or jog the course before competing so when they hit that final mile or that final hill they know exactly how much pain they will need endure and when it will be over. If they know the course their brains and bodies don’t hold anything back.

Learning to code is like running, I could conceivably walk out of my door one morning, face one direction and not return for about 25,000 mile and I could try to learn every possible computer science and coding technique, style and trick. I found that by walking my coding course and setting out the core Python things I set out to learn (variables, expressions and statements; functions; conditions and recursion; iteration; strings; lists; dictionaries; tuples; classes, objects and inheritance) I was often able to see the end in sight and push on through.

Progressive Training (Iterate Until You Get It)
Sometimes no matter how hard you try you just don’t seem to see results. Recently after trying t get back to fitness after recovering from a long standing injury my average heart-rate for a one hour run just wasn’t dropping. I use my average heart rate as an indicator of my base fitness. It was frustrating that no matter how hard I worked my fitness level just didn’t seem to improve. Suddenly with no change to my schedule my average heart rate starting trending down and has dropped over 10 bpm in 3 weeks. That’s huge!

When trying to learn key computer science concepts I often found myself either struggling to understand something or getting extremely frustrated that I just wasn’t getting it. What seems trivial today was at the time quite complex and challenging. I knew that if I just kept coming back to the topic or issue I would eventually get it. I knew I had to iterate.

Dealing with Injuries – Everyone Needs Rest
A year or so ago I developed shin splints. I didn’t take the pain seriously and continued training for a marathon with little change to my schedule until it was too late. To cut a long story short the shin splints eventually turned into a stress fracture and left me with my leg in a cast and away from running for nearly six months. For me running injury free is now one of the most important things I strive to maintain although like any man easier said than done (see brain rules above). If you run hard everyday your legs don’t get to repair the micro-tears in the muscles and your joints don’t get a chance to rest. Sleep, rest and relaxation are all critical to running and learning.When learning to code I often got stuck on a particular concept. Early on I would keep iterating constantly until I got the hang of the issue but sometimes it actually made it worse. I would spend so much time thinking deeply about what was actually happening behind the scenes that I would often make relatively simple things far worse. I would try and track the object types in my head as I visualized stack diagrams (again in my head) and try to map what I thought was actually happening in the interpreter.

When I found my Python learning rhythm I found that rest was an important part of the schedule.  During my “Learn Core Python in a Week – My Way” week I structured my day so I ran first thing and was relaxed. I only coded during the day and always ate dinner with the family. I didn’t pull any crazy heroic late nights.

Mix Up Your Course
I have a few favorite runs. One is from my house, over the Ballard bridge, through Ballard and over the salmon locks. I then run up through Discovery Park and back home. Another is my run commute which is almost all along the Burke-Gillman trail which runs along side of Lake Union. I am very lucky, despite the horrid weather in Seattle (and yes it really is even worse than everyone says) I get to see mountains with snow on in the distance (the Olympics and the Cascades), boats and sea-planes, people living on houseboats and any numbers of interesting things on my average run. They say variety is the spice of life and I think running is the same. Exploring new runs, new places and new environments is fun. Next year I hope to do an international run somewhere, maybe Macha Picu or Kilimanjaro or something exotic. I’ll still enjoy the Burke-Gillman trail but will probably learn a different set of things about running from a different set of places.

When Learning Python I had a favorite text book, Thinking in Python. Its a great book and was especially well suited to me wanting to apply Python coding to computer science concepts. At the same time I often used other books to get a different perspective or learn different things.

OK time to get back to work and then back on the trail!

Share on TwitterSubmit to reddit

Learn Core Python in a Week – My Way

By , July 16, 2011

@curphey on Twitter and on Google Plus

I took a week off of work this week to learn Python. Truth is I have been trying to learn Ruby (and) or Python on and off for the last 18 months or so but work and kids (and the “dog ate my homework” syndrome) have always found priority and I made little meaningful progress. After a big release at work I checked my vacation balance, bit the bullet and booked this week off work. I told everyone I was going dark. It’s Friday and so far I am feeling like I have really got to grips with the basics of the core of the language. I am now in a place where I can be productive writing code and solving my own problems. I think I now have the basic level of knowledge to continue learning and overtime actually become a half-decent decent Python developer. In this post I share how I approached getting my results so far.

If you want to know why I wanted to learn a language and why I want to learn Python in particular there is of course a short story. I got involved in computer security via formal education (cryptography and mathematics). As my career progressed through start-ups and financial services companies I became good at managing technical projects and managing technical teams. Through personal interest I steered towards running software security programs and running teams of developers building software security tools. For the last five years I have been more interested in “software” than “software security” and while I am no pointy-haired boss (I have picked up a lot along the way) I have never been formally trained as a computer scientist or worked as a commercial software developer (code contributing developer). When I turned forty, two years ago I had the classic mid-life crisis. I took up distance running and evaluated my long term career plans. Many people start off their careers as highly technical individual contributors and slowly morph into spreadsheet crunching people managers. Power, money and (pseudo) respect in most corporate structures is understandably aspirational for some people but having been there and done it, I made a conscious decision to morph my career back the other way. I won’t ever stop wanting to lead teams of smart motivated and passionate people but I want to be a grass roots technical contributor creating meaningful software. I could write a very long post indeed on how I think the very nature of software teams is changing way beyond Agile and how I think the future is very small self-contained teams operating in an eco-system but perhaps for another day. The short summary is that I decided I wanted to be the member of a rock band and not a member of an orchestra and want to lead software teams from within.

Why Python? With the huge choice of languages and having explored a number over the years (Java, Ruby, Perl, C#) I decided to pick one with a view to becoming proficient in it rather than try and become a “jack of all trades” in a few. I view JavaScript and CSS as base knowledge for any modern developer so didn’t include those in the scope of my decision. You have to know them regardless if you want to build web applications. I have always been passionate about open source software and so one pre-requisite that there was a strong open source community (online, local meetings etc.) and eco-system (tools, components etc.) behind my language choice. At college in ’97 I first played with Java back when it was all about applets, then later when I ran the software security program at Charles Schwab between 2001 and 2003 we were all about EJB so Java might have been a natural choice and the eco-system is clearly very strong, but for some reason the community around Java doesn’t excite me. For me it essentially boiled down to Ruby vs. Python and to cut a long story short Python won. While Ruby has stronger test support with Cucumber (and friends) and of course a first class web framework in Rails, the developer community felt arrogant. Hang out on a ruby language mailing list for a week and you will know what I mean! Python on the other hand has a very strong scientific community behind it with a wider range of libraries for a broad spectrum of science things like bio-informatics. There is a great MVC framework called Django and in recent years Google has adopted it as one of its formal language for both use internally and on the Google App Engine. There is no real science behind my choice and it is very much personal preference but simply put it feels like a decent choice at this time.

Of course there will be a lot of code, a lot of learning and a lot of time before I will be a competent developer, if you are like me and want to learn Python (and have a day job that seems to get in the way) here is what has worked for me that you may want to consider.

1. Book a dedicated week – This is by far and away my number one tip. I took last Friday off to deal with the inevitable bow-wave of mail from work so I could enter this week 100% clear of any work issues. I structured my day with a 5 – 6 mile run every morning (obviously optional) followed by 4 hours of dedicated coding time. I take a break for the afternoon and then follow-up in the evening for a few hours (no fixed length) to cover any loose ends, extra reading and preparing for tomorrow. I created a bow-wave of learning so I wasn’t going into this week cold by starting tutorials a few weeks ago. This allowed me to focus this week on exploring important concepts and not understanding basic theory. I knew what I needed to learn going into this week and what success looked like for me so created my plan for the week (see below) ahead of time.

2. Agile Planning – I scoped out my work using Agile planning techniques. This maybe overkill but got me into the right mind-set. I used the community edition of Rally and set up a backlog and daily iterations. I even entered exercises as tests to prove my knowledge to myself. I have been able to look at my backlog, add stories and tasks and get better at estimating my velocity as the week wen’t along. Other decent free options for this include Pivotal Tracker or Agile Zen.

3. There is no substitute for writing code – You can read as many book as you want and write code in your mind but there is no substitute for writing code on your computer. It really is the only way you will learn syntax, semantics and how things really work. Don’t fool yourself into reading a chapter of a book or watching a video, writing code is what teaches you to write code. There is nothing more to say on that topic. Zed Shaw’s “Learn Python the Hard Way” echoes this. Use the Python shell as much as you can to experiment. iPython gives you a great extended shell to play with.

4. Hire (pay) a good instructor – Having a good mentor / instructor is essential. I was lucky enough to have a very smart friend (who is very, very good developer) last year agree to meet me for coffee every other week and teach me some Ruby. I never really made progress. Reason? I wasn’t committed. I never had to pay him, I would meet and catch up on a social level and our relationship was based on friendship and not on learning. This time I did some Googling, found out that the local University (University of Washington) ran an extension class and emailed the lecturer asking for private lessons. I met him for coffee first to make sure there would be a social fit and that his style would match what I was looking for. It’s not cheap (although all up will probably be 50% of the cost of doing a formal class like this) and has allowed me to operate at my own pace and on topics I want to cover. We can get side-tracked when we want. The lecturer (Brian Dorsey) is great and I look forward to meeting. During this seven day sprint we planned to meet three times and every Friday for a few weeks before and afterwards.

5. Use the Right Learning Material – Over the years I have bought a lot of language books. They range from step-by-step instructional books like the APress or Head First series to less structured books like the O’Reilly language series. While I have gotten a lot from them I have either found them to be “draw by numbers” or not organized in the way I wanted to learn. Bryan suggested “Python for Software Design – How to Think Like a Computer Scientist” which is what the UW course is based on. You can get a free PDF version here. The book has been a perfect fit for me as it talks about computer science in terms of recursion and stack diagrams and has exercises to build fractals and solve math problems. It is an an academic level that I can relate. The right material has really had a significant impact on my learning this week.

6. Use an IDE – Many purists will expose that using a text editor like TextMate (which I own) or TextWrangler is the best way to learn but for me using a fully fledged IDE has been a serious benefit. I use PyCharm and for the most part love it. When you are exploring an API you can see the functions it supports and syntax errors are highlighted as you type. While this could indeed make you lazy I think it helps you get up to speed faster so that the syntax becomes second nature. For me it’s like the difference between using a text editor or word processor to write a story.

7. Use good development practices as you learn – All week I have put my code into revision control. I generally use Git so also took the opportunity to learn Subversion this week (my only real violation of my next tip but it was so simple that …). I comment all my code no matter how trivial the example and even took to running it through the Python style guide PEP-8. Towards the end of the week I have even taken to writing unit tests for all code. Python Koans are great for learning testing in Python.

8. Just Learn the Language, Nothing Else – It’s very tempting to also learn Django at the same time as learning Python. If you want to build web apps you will need a framework to build on but I think it has been very valuable to separate the two. Apart from separating the complexity and scope it forces you to focus on the language only and not how to use the language to drive a framework.

That’s it for now. If I can think of more I will add it and I would love to hear others tips and tricks.

Useful References

A Jump Start for Learning Python

33 projects that make developing django apps awesome

http://learnpythonthehardway.org/

ipython

Python Koans

 

 

 

 

Share on TwitterSubmit to reddit

Online Community Patterns

By , December 28, 2010

I have been looking for a meaningful new side-project for a while and have now been actively working on an idea with a “partner-in-crime” for a few months. We plan to launch a web-site sometime early in the new year and we will start blogging and tweeting about it soon.

The last big side-project I started was OWASP (which now has thousands of “partners-in-crime”). Looking back the time I spent working on OWASP was one of the most motivated and creative times of my adult life. When we first started the project there was no goal or rule book to follow. There was a set of ideas and a collective passion for web application security. That was it. Everything else got figured out along the way as a community. A community that had no definition, no initial structure and no governance. I don’t think anyone even recognized it as a community for a year! Probably most importantly was that there was a feeling that there were no-rules and no-limit to what could be achieved if a few like minded passionate people came together. While I haven’t been involved in OWASP in any meaningful way for a number of years and so can’t take credit for it’s phenomenal success over the last decade, it ignited my interest in something that I think is quite profound. In truth while there will always be software security in my DNA it was the community aspect of OWASP that I enjoyed and learned from the most. I read a lot and often find myself relating passages in modern online social science books like Getting Real (Re-Work), The Long Tail, Groundswell and Here Comes Everybody to what I have observed happened (and is happening) at OWASP. It has been a very good online social science lab!

Of course at the time certain patterns of behavior or actions weren’t calculated. They just happened by luck (lucky timing  I guess) but several years on and way too many hours spent online I am utterly convinced that there is a very strong correlation between key patterns in online social science and organizational theory which when combined with design patterns in social software are strong indicators of the success or failure of online communities.

The way people organize themselves, the types of people that are involved, who makes decisions (and of course how decisions are made), how community members are recognized and rewarded and how disputes are resolved are all critical patterns. The type of software communities embrace is also vitally important to success. Social software be it a wiki enabling collective editing, a mailing list enabling seamless discussions or a blog enabling friction-free publishing work with different degrees of effectiveness depending on the community.

Most fascinating of all of this of course is that no one size fits all. There are clear patterns but not play-books and that’s what makes it so fascinating.

So my next project will a community for community organizers and developers!

- Mark Curphey

 

 

 

 

 

 

Share on TwitterSubmit to reddit

What Would You Include in the The Internet Operating System?

By , September 7, 2010

I have an interesting personal project brewing looking at ways to build better community software and am exploring emerging thinking about the next generation of web applications. Tim O’Reilly wrote a seminal blog (part one and part two) describing the Internet as THE new operating system. In the post he uses the analogy of traditional operating systems like Windows or Unix and the computing services they provide (file storage, networking, user management etc.) and then describes the Internet as an Operating System providing information services to distributed applications. There are some obvious fundamental differences in thinking about building scalable applications on the Internet Operating System such as binding together distributed services. There are also a number of less obvious but fundamentally important things to consider such as the fact that there will be many choices for common services such as authentication (Google, Yahoo, LinkedIn, Twitter, FaceBook Connect etc.) and smart application designers will need to adopt new architectural and functional models that provide the user with their preferred choice and not just one option as is the norm with traditional operating systems.

As I have started to think about the model I started to capture the potential services you could consume in a diagram (below). Its a first pass that I plan to update. The simple rule I am operating under is that to be considered a service there should be a published API in which to connect.

What else would you include?

image

Share on TwitterSubmit to reddit

Crazy Idea #10- Adopt Agile Mindset

By , September 7, 2010

This post is #10 (the last and hopefully the best) in a series 10 Crazy Ideas That Might Just Change the State of the Security Industry.

image I have been doing Agile development in earnest for about two years now. First while building security tools like static code analysis and web protection libraries and most recently building large scale web sites. I have learnt a lot (actually I have learnt a great deal) and while Agile is clearly not a panacea, I firmly believe that it could be successfully applied to many security situations to improve the state of the security industry. What follows are a selection of ideas; certainly not complete and certainly not exhaustive. This post should not be confused with infusing security into an Agile process. This post is about using Agile techniques for security.

image

For context Agile works best in a world sandwiched firmly in-between complex & chaotic projects and predictable & simple projects. This is the Agile “sweet-spot” and luckily enough (from my experience) where 99% of the security projects I have seen fall. Many stalwarts who don’t understand Agile often say something like “But Agile is not for the Enterprise.” Here is a factual answer: “The Enterprise is a colossal spaceship from the 80’s flown by people with bad taste: Highly advanced, but purely fictional”. Don’t make the common mistake of confusing the size of a project with complexity or predictability!

imageAgile takes a pragmatic approach to life by acknowledging that when we first encounter a project (or topic) it is the point when we understand the very least about it. This is called the “Cone of Uncertainty”. What tends to happen in non-Agile environments is that people try to estimate the size of a problem or project at the funnel end the very point when they are least qualified to make an accurate estimation. This is true for example of security reviews. A security consultant typically is given an overview, an RFP or high-level description and asked to estimate the amount of time and therefore cost a project will take. They are asked to estimate the time and cost to perform a function such as a code review based on nothing more than a high-level description of the application or in some cases basic information like the LOC. In reality what happens (and this maybe a dirty little truth about the industry but I can tell you that its the norm) is that consultants will simply cut back on the scope or depth of analysis to match their initial estimation. Instead of getting an analysis of the things that need analyzing you end up getting an analysis of the things that can be analyzed in the amount of time that was guessed. This is actually why the concept of Threat Modeling is powerful. It allows an analyst to understand the system and isolate the areas of importance that warrant further detailed investigation.

Another common Agile concept is ‘Plan for Today And Worry About the Future Tomorrow’ – Most people try to plan for the future and layout elaborate timelines that stretch into the distance. Most are based on what-if scenarios. What-if “X” happens or what-if “Y” happens ? The reality is most people fail with this approach. Most plans are nothing more than guessing games. Security assessments and architecture reviews usually do exactly this, guess what will need to be done. Agile promotes worrying about real tangible problems that we face today and not getting side-tracked into thinking about issues that may or may not occur tomorrow. Don’t be fooled into thinking that this means ignoring architecture and scale. It just means keeping a solid eye on reality and not on fiction.

imageAnd for people who think that accurate estimation is complex and really tough try this. Choose a city about an hour away, then choose a city a few hours away and then choose a city in the middle of the country and then one of the other side. Get a team of people to estimate the time it will take to travel to each location using relative measurements ie if the city one hour away is one then how many units would the next one be? We did this exercise in Seattle with Tacoma, Portland, San Francisco, LA, Las Vegas and Miami and were able to estimate the distance from Seattle to Miami within 100 miles! That kind of result is repeatable and predictable. Most people spend way too much time trying to make perfect estimations when in reality accurate approximations using comparative techniques are all that’s needed.

image

The Agile manifesto http://www.agilemanifesto.org lays out a set of principles in a particularly meaningful way and one such principle is that Agile values ‘Individuals and Interactions over Process and Tools’.  Another way to say that is that partnerships drive results. In my experience very true partnerships between security specialists and developers exist. Instead we have lots of CYA process and “gotcha” type traps built and operated. Security people must partner with developers and encourage them to partner back.

The Agile manifesto talks about ‘Working Software over Comprehensive Documentation” & about ‘Customer collaboration over Contract Negotiation”’ – I will always remember when I was audited by a PCI firm that shall remain nameless (to protect the stupid). I had some code that protected a token passed on URL parameter. It was cryptographically secure (from replay, tampering, viewing etc) but I failed the audit as the token wasn’t passed over SSL. I was caught on a technicality. This was a case where a secure system (working software) didn’t meet a checklist (comprehensive documentation). As Forest Gump would say “Stupid is as stupid does”.

Finally (for this post anyways) Agile promotes the mind set of always working on the highest priority thing in small increments to deliver the greatest value while embracing change. I believe that by adopting the way we manage backlogs would help security teams groom what’s important and always be working on what’s the most important thing to be working on at that time.  In Agile we maintain what is called a Product Backlog, a fancy name for a list of things we want to do. When we understand enough about each item on the backlog (usually to estimate the effort to take on an item) we rank them and work from the top of the pile. We spend time and effort refining the backlog, an activity called Backlog grooming. Compare that to the way a typical security assessment is done today, procedurally following a long list of pre-determined things. By spending more time on the important topics as we define and understand them would allow us to be more effective at reducing real risk.

I hope the series has been useful.

Share on TwitterSubmit to reddit

Crazy Idea #8 – Embrace Design Driven Security

By , September 6, 2010

This post is #8 in a series 10 Crazy Ideas That Might Just Change the State of the Security Industry.

image When Jason Fried of 37 Signals spoke at Web 2.0, most for the media picked up on a great meme proposing that web site owners should think of themselves as software curators. Instead of trying to pack in as many features as possible, it’s is the ‘collection’ of features that create an experience and what ultimately matters. During the talk he spoke about design driven software and used a few great analogies, one using a clear water bottle to explain why it’s easy to assess the quality of the design of a physical objects and then went on to discuss why software is so relatively hard. I recommend the video here and a talk by Ryan Singer the 37 Signals UX person here.

End users of most software are simply confused about security warnings and therefore generally ignore them. Security features such as authentication systems are privacy settings are complex and in general seem to be designed by and for developers. FaceBook had 4,000 comments in a week for privacy features that it claimed already existed.

Most security software is also nothing more than a hodge-podge of every possible feature every possible security person can think other users might want want. Security people have long ridiculed the desire to have a “shiny red security button” including myself many many times. The truth is that security is way too complicated for the majority of people and it has to be made easy. That wil only come by embracing Design Driven Security.

Share on TwitterSubmit to reddit

Panorama Theme by Themocracy