keynote: security: i think we can win – app sec usa

speaker: Bill Cheswik

  • the sci fi authors of the 50’s didn’t come close to reality
  • Advanced persistent threats aren’t advanced. Buffer overflow, etc are known
  • the order of things is to make something new work and then figure out security – predicts security problems in Obamacare data handling
  • UI is sill evolving. touch is only a decade old
  • Old Microsoft menus are too slow. Can’t get faster at them like with UNIX. [lesson: support multiple levels of skill]
  • prefers “grapes to raisins” instead of “apples and oranges”
  • You don’t have to be a mechanic to use a car. But now adding a computer to your car. CAN bus “it just works” can be hacked by bad mp3 files. [Eek!]

Current state of affairs

  • The fact that we do banking and shopping (money) online shos the internet is working,
  • The current state of affairs is still lousy
  • Certain thing needs to work regardless of “what grandma does wih the keyboard”. It isn’t grandmas fault. She shouldn’t be ABLE to do something wrong.
  • We are all “grandma” at some point
  • Checklists , virus checking, strong user passwords and user education aren’t enough to solve bad engineering.
  • A virus checker finds evil software on a machine. It’s too late at that point.
  • Shared and dynamic libraries meant to save memory when we were memory constrained to share common OS binaries. We aren’t memory constrained anymore. Don’t need these binaries considered trusted as side effect of this anymore.

What does victory look like

  • OS that can’t be changed or subverted regardless of app or user action
  • Apps can’t tained OS can limit to signed and approved apps

Metrics

  • People want a number. But what is it measured in? Lines of code? Connectivity to Internet. (reference “an attack surface metric”)

    Metric 1 – setuid

  • Kernels talk to the world. Programs talk to the kernel. The diagram is usually shown th eother way
  • Quick way to rate UNIX system security: look for setuid programs as root that aren’t needed. Why need etra holes at the bottom of the boat.
  • Considers this # (5 in this case) to be a measure. [one is su though which seems like a door to anything]

Metric 2 – number of network services available to outside

  • Again, more than you think

Metric 3 – how muc will someone pay for a zero day exploit

  • Adobe Reader and MAc are low. iOS tops list with Firefox and Chrome blelow it
  • This is a factor of how security it is (how hard to find an issue) plus how desirable he platform is to find an error in
  • Predicts Android will have more issues because open source and hard to have displine when too many people finger in it.

Keep it small

  • Keep software simple/li>
  • Google’s Go language uses this small/fast is better principle

What works

  • CPU speed is a tool
  • Could use ores as separate machines with separate cache and memory
  • Personal responsibility for the code. Such a Kunth’s personal checks for finding a bug. [I actually did this at work. I wanted to prove i was possible to fix a certain issue reliabily. I offered my teammates $1 for each issue they found in that space. It cost me exactly $1.]
  • Literate programming.
  • Software”annealing” – just fix bugs and don’t make other changes for a long time. This is why sendmail and other old programs are stable
  • Strong type checking. Pascal style, not C
  • Virtual machines where line is between kernal and hardware
  • If you have other controls, a 4 digit PIN is fine

Excuses

    li>People write buggy code. Too many requirements. Too much change

  • Governance is a big concern
  • Still have DDOS
  • We have home field advantage
  • Believe we can win

Reference to Dean Kamen for doing security well in products – insulin pumps and wheelchairs [and segways]

Tool:
CertPatrol on Firefox – see what certs used

My take on this:
Good start to the conference. This situation is part of why my mother’s computer is a Chromebook. You can’t install software. If you mess up, you can easily reimage and not lose data or settngs. It’s not perfect, but it is closer.

blogging from app security usa with my ipad

Presuming the internet holds out, I’ll be blogging from the App Security USA conference for the next two days. Scott and I tried this at The Server Side Java Symposium a few years ago. I have a newer iPad (air) now with keyboard so it will be interesting to see how the iPad blogging experience differs.

Adding a link
I didn’t realize right away that Safari now shows you only the domain name unless ou click on the location bar to see the real link.

Typing
New keyboard. Need to get used to it. I seem to have to press harder on the keys than I like.

WordPress

  • The visual view isn’t working for me in the iPad WordPress browser editor. Since I have a real keyboard, at east I can type HTML to make it happen in text view.
  • As with last time, two finger scroll helped.
  • Additionally, control arrows helped with end of line and end of text area

Case/stand
I have the Kensington keyboard and folio. The idea is that the iPad screen is propped up at a nice angle as you type. That works. The problem is that my lap isn’t the most stable surface for this to be sitting on. It mostly works. However twice so far (within the first two hours),the iPad slipped out an started to fall. Luckily, the folio is magnet supported so nothing bad happened. And Safari considered my catching it to be a delete message and prompted me for whether I want to delete or cancel. This seems like an accident waiting to happen so I’ll make sure to save often! And try to get to sessions early enough to get a table seat.

Caps lock
The keyboard is very clear on when caps lock is on. There is a red light. I think I’m accidentally turning on the iPad caps lock at times though as sometimes caps lock appears “backwards” on the keyboard

upgrading to mavericks – problems including broke eclipse/ant java for jmockit – and how to fix

I didn’t upgrade to Mavericks right away because I was getting FIOS.  If there were internet problems, I wanted to know they were Verizon’s fault and not be in a position where they could claim it was my computer’s problem.  I’ve had Mavericks long enough that I can write about the experience.

The problems describe here:

  • git
  • Eclipse/Java/Ant/JMockIt
  • OpenOffice crashing

How long it took

Not counting the download, the install took 2 hours.  Much of which was Apple saying there were “17 minutes” left.  I left it alone and it didn’t finish though.  I’ve seen reports of significantly faster installs though.

Problem #1 – git

The first problem I ran into was the error message The “git” command requires the command line developer tools.  Not a big deal.  It was a two minute install.  I was just surprised as I was expecting what was installed before the upgrade to  be installed after.

Problem #2 – Java and Eclipse

And now for the meat of this.  Being able to develop again in Eclipse was by no means seemless.

Error: Ant can’t find Java

Exact message: Specified VM install not found: type MacOS X VM, name Java SE 6 (MacOS X Default)

Solution – for each Ant build:

  • Run > External Tools Configuration
  • Run in same JRE as the workspace

Error: JUnit tests don’t run in Eclipse view

When running from Eclipse, I got the stack trace:


java.lang.IllegalStateException: Unable to load Java agent; please add lib/tools.jar from your JDK to the classpath

at mockit.internal.startup.JDK6AgentLoader.getVirtualMachineImplementationFromEmbeddedOnes(JDK6AgentLoader.java:102)

at mockit.internal.startup.JDK6AgentLoader.loadAgent(JDK6AgentLoader.java:74)

at mockit.internal.startup.AgentInitialization.initializeAccordingToJDKVersion(AgentInitialization.java:41)

at mockit.internal.startup.Startup.initializeIfNeeded(Startup.java:271)

at org.junit.runner.Runner.<clinit>(Runner.java:25)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:35)

at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)

at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)

at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)

at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)

at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

java.lang.NoClassDefFoundError: org.junit.runner.Runner

at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)

at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Solution:

First I tried switching creating a new installed JVM of type MacOS X JVM.  That didn’t help directly.  I left it like that since I didn’t want to muck around with my original configuration.  Then I added tools.jar to the installed JRE.

  1. Eclipse > Preferences
  2. Java > Installed JREs
  3. Click target JRE
  4. Edit
  5. Add external jars
  6. Add  /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/lib/tools.jar

Warning: The first time I tried this procedure, Eclipse hung.  I had it to kill it.  When I opened my workspace, I saw “unable to load plugin x” in every single view.  I used Time Machine to restore to before I tried changing the JREs and then re-did that change.  The second time it was successful.

I could have added tools.jar to my classpath for the project instead.  I choose not to because I was hoping updating it in the JVM install would solve the Ant problem (described below) as well.  It didn’t.  I also didn’t want to change the project .classpath as that is shared in Subversion and I didn’t want to make a change that affects others.

This whole exercise felt like a hack until I read the JMockIt instructions.  This leads me to believe I was running with a different JDK before the Mavericks upgrade.

If you are developing on a JDK of version 1.6 or newer on Mac OS X, add <jdkDir>/lib/tools.jar to the classpath, where <jdkDir> is the home directory for your local JDK 1.6 installation.

Error: JUnit tests don’t run from Ant

When running from Ant, every test failed with:

Caused an ERROR</span>
<pre>
null

java.lang.reflect.InvocationTargetException

at java.lang.reflect.Constructor.newInstance(Constructor.java:525)

What I learned:

  • I tried setting JAVA_HOME at the command line to no avail.  I confirmed javac is on the path. (/usr/bin/javac); it was.
  • I tried adding tools.jar to the classpath in launch configuration in Eclipse for running Ant.
  • If I change to fork=”no” in the <junit> task in the Ant script, most of the tests pass.  (Some of them require the JVM be forked which is why it was in the first place.) Showing the problem is when a new JVM is created, it doesn’t inherit the tools.jar from the previous step.
  • If I hard code the classpath entry for tools.jar in the Ant build file, all of the tests pass.

Solution:

If you need to fork the JVM, add the following insider you <junit> task.

<classpath location="/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home/lib/tools222.jar" />

I don’t like this solution.  I also didn’t like the hack for Eclipse so my unease is pretty uniform here.  Luckily Ant doesn’t choke if you include a file (or disk or filesystem) in the classpath that doesn’t exist.  Which means this won’t hurt others working on the same project.

Problem #3 – Open Office crashes when opening a document

The solution was to upgrade from Open Office 3.3.0 to the latest (4)

My favorite new feature

It’s a minor one, but I like the feature to synchronization of “Read Later” between my Mac and iPad.  (I haven’t tried it yet so it may not be that nice in practice.)  Most of the new features are things I don’t need.