Which cryp­to card to use with FreeB­SD (ssh/gpg)

The recent secu­ri­ty inci­dent trig­gered a dis­cus­sion how to secure ssh/gpg keys.

One way I want to focus on here (because it is the way I want to use at home), is to store the keys on a cryp­to card. I did some research for suit­able cryp­to cards and found one which is called Feit­ian PKI Smart­card, and one which is called OpenPGP card. The OpenPGP card also exists in a USB ver­sion (basi­cal­ly a small ver­sion of the card is already inte­grat­ed into a small USB card reader).

The Feit­ian card is report­ed to be able to han­dle RSA keys upto 2048 bits. They do not seem to han­dle DSA (or ECDSA) keys. The smart­card quick starter guide they have  (the Tun­ing smart­card file sys­tem part) tells how to change the para­me­ters of the card to store upto 9 keys on it.

The spec of the OpenPGP card tells that it sup­ports RSA keys upto 3072 bits, but there are reports that it is able to han­dle RSA keys upto 4096 bits (you need to have at least GPG 2.0.18 to han­dle that big keys on the cryp­to card). It looks to me like the card is not han­dle DSA (or ECDSA) cards. There are only slots for upto 3 keys on it.

If I go this way, I would also need a card read­er. It seems a class 3 one (hard­ware PIN pad and dis­play) would be the most “future-proof” way to go ahead. I found a Rein­er SCT cyber­Jack sec­oder card read­er, which is believed to be sup­port­ed by Open­SC and seems to be a good bal­ance between cost and fea­tures of the Rein­er SCT card readers.

If any­one read­ing this can sug­gest a bet­ter cryp­to card (keys upto 4096 bits, more than 3 slots, and/or DSA/ECDSA  sup­port), or a bet­ter card read­er, or has any prac­ti­cal expe­ri­ence with any of those com­po­nents on FreeB­SD, please add a comment.

ICS on the Sam­sung Galaxy Tab 10.1

Last week I had a look if there are some news for an offi­cial update of the Galaxy Tab 10.1 to ICS. To my sur­prise there is one at least in Italy. The one I found to down­load was marked more or less for the Euro­pean mar­ket. Well… that was good enough for me and the night from Fri­day to Sat­ur­day I have spend to update the Tab by hand (unfor­tu­nate­ly this includes a fac­to­ry reset, no smooth migra­tion from an old ver­sion, but at least I still have root access).

What I noticed so far:

  • OpenGL ES speed improved from 4.2 to 6.6 FPS.
  • I had some lock-ups so far, I do not know if this may be relat­ed to some restored data (app data and e.g. Bluetooth/WLAN con­fig restored with Tita­ni­um­Back­up) or to bugs (Dalvik cache and cache par­ti­tion where clean, fac­to­ry reset was done too pri­or to restor­ing from the back­up). I had to press the pow­er but­ton for some sec­onds to ini­ti­ate a reboot. Most of the time it helped to wait a minute before enter­ing the PIN for the SIM. One time it did not help at all, the only way to get it work­ing was to take my WLAN Access Point (AP) offline, start the Tab, enter the PIN, and to restart the AP. At that point I had GPS and WLAN in the Tab acti­vat­ed, in the lock-ups before I did not have GPS active. I had some­thing sim­i­lar like this with my Nexus S when it got ICS, some­how this resolved itself. Update 2012-08-14: I googled a bit, there was a bug in ICS 4.0.3 relat­ed to WLAN, but I have 4.0.4 on the Tab, so this may not be this. I also got the freeze with­out WLAN but with the mobile data con­nec­tion active. 2nd update 2012-08-14: If I dis­able account sync­ing with the mobile data con­nec­tion it does not freeze. I have not yet tried this with the WLAN con­nec­tion. Update 2012-08-16: The syn­chro­niza­tion of the cal­en­dar data caused the prob­lem. Delet­ing all data for any app with cal­en­dar in the name and re-syncing fixed the prob­lem. No freeze since I did this yesterday.
  • When I open/close a fold­er (much missed fea­ture in Android 3.x), the Tab speaks with me (some­thing like “Fold­er XXX opened” in the con­fig­ured lan­guage… that is a bit annoying).
  • I like the default back­ground image.
  • Update 2012-08-14: The bat­tery icon does stay green even when the bat­tery is near­ly empty. 🙁

I was not able to test the Email APP yet, I am wait­ing for a warranty-replacement of the PSU of my serv­er at home (Murphy’s law: Your PSU will break when you just start­ed a big ren­o­va­tion of your kitchen and do not have time to take care about it, and when you get time a lot of peo­ple from the PSU-manufacturer which take care about warranty-replacements are in holiday).

I also need to check the mobile data con­nec­tiv­i­ty (qual­i­ty and speed), but I would expect that it is not worse than before. Update 2012-08-14: The down­load speed test shows sim­i­lar results than before, the upload speed test is slow­er, but this may be the mobile net­work here where I test­ed. At least I can con­firm that it works, mod­u­lo the prob­lem of the freezes described above.

Web­Sphere 7: solu­tion to “pass­word is not set” while there is a pass­word set

I googled a lot regard­ing the error mes­sage “pass­word is not set” when test­ing a data­source in Web­Sphere (7.0.0.21), but I did not find a solu­tion. A co-worker final­ly found a solu­tion (by accident?).

Prob­lem case

While hav­ing the appli­ca­tion JVMs run­ning, I cre­at­ed a new JAAS-J2C authen­ti­ca­tor (in my case the same login but a dif­fer­ent pass­word), and changed the data­source to use the new authen­ti­ca­tor. I saved the con­fig and syn­chro­nized it. The files config/cells/cell­name/nodes/node­name/resources.xml and config/cells/cell­name/security.xml showed that the changes arrived on the node. Test­ing the data­source con­nec­tiv­i­ty fails now with:

DSRA8201W: Data­Source Con­fig­u­ra­tion: DSRA8040I: Failed to con­nect to the Data­Source.  Encoun­tered java.sql.SQLException: The appli­ca­tion serv­er reject­ed the con­nec­tion. (Pass­word is not set.)DSRA0010E: SQL State = 08004, Error Code = ‑99,999.

Restart­ing the appli­ca­tion JVMs does not help.

Solu­tion

After stop­ping every­thing (appli­ca­tion JVMs, nodeagent and deploy­ment man­ag­er) and start­ing every­thing again, the con­nec­tion test of the data­source works direct­ly as expected.

I have not test­ed if it is enough to just stop all appli­ca­tion JVMs on one node and the cor­re­spding nodeagent, or if I real­ly have to stop the deploy­ment man­ag­er too.

Strange per­for­mance prob­lem with the IBM HTTP Serv­er (mod­i­fied apache)

Recent­ly we had a strange per­for­mance prob­lem at work. A web appli­ca­tion was hav­ing slow response times from time to time and users com­plained. We did not see an uncom­mon CPU/mem/swap usage on any involved machine. I gen­er­at­ed heat-maps from per­for­mance mea­sure­ments and there where no obvi­ous traces of slow behav­ior. We did not find any rea­son why the appli­ca­tion should be slow for clients, but obvi­ous­ly it was.

Then some­one men­tioned two recent apache DoS prob­lems. Num­ber one – the cook­ie hash issue – did not seem to be the cause, we did not see a huge CPU or mem­o­ry con­sump­tion which we would expect to see with such an attack. The sec­ond one – the slow reads prob­lem (no max con­nec­tion dura­tion time­out in apache, can be exploit­ed by a small receive win­dow for TCP) – looked like it could be an issue. The slow read DoS prob­lem can be detect­ed by look­ing at the server-status page.

What you would see on the server-status page are a lot of work­er threads in the ‘W’ (write data) state. This is sup­posed to be an indi­ca­tion of slow reads. We did see this.

As our site is behind a reverse proxy with some kind of IDS/IPS fea­ture, we took the reverse proxy out of the pic­ture to get a bet­ter view of who is doing what (we do not have X‑Forwarded-For configured).

At this point we noticed still a lot of con­nec­tion in the ‘W’ state from the rev-proxy. This was strange, it was not sup­posed to do this. After restart­ing the rev-proxy (while the clients went direct­ly to the web­servers) we had those ‘W’ entries still in the server-status. This was get­ting real­ly strange. And to add to this, the dura­tion of the ‘W’ state from the rev-proxy tells that this state is active since sev­er­al thou­sand sec­onds. Ugh. WTF?

Ok, next step: killing the offend­ers. First I ver­i­fied in the list of con­nec­tions in the server-status (extended-status is acti­vat­ed) that all work­er threads with the rev-proxy con­nec­tion of a giv­en PID are in this strange state and no client request is active. Then I killed this par­tic­u­lar PID. I want­ed to do this until I do not have those strange con­nec­tions any­more. Unfor­tu­nate­ly I arrived at PIDs which were list­ed in the server-status (even after a refresh), but not avail­able in the OS. That is bad. Very bad.

So the next step was to move all clients away from one web­serv­er, and then to reboot this web­serv­er com­plete­ly to be sure the entire sys­tem is in a known good state for future mon­i­tor­ing (the big ham­mer approach).

As we did not know if this strange state was due to some kind of mis-administration of the sys­tem or not, we decid­ed to have the rev-proxy again in front of the web­serv­er and to mon­i­tor the systems.

We sur­vived about one and a half day. After that all work­er threads on all web­servers where in this state. DoS. At this point we where sure there was some­thing mali­cious going on (some days lat­er our man­age­ment showed us a mail from a com­pa­ny which offered secu­ri­ty con­sult­ing 2 months before to make sure we do not get hit by a DDoS dur­ing the hol­i­day sea­son… a coincidence?).

Next step, ver­i­fi­ca­tion of miss­ing secu­ri­ty patch­es (unfor­tu­nate­ly it is not us who decides which patch­es we apply to the sys­tems). What we noticed is, that the rev-proxy is miss­ing a patch for a DoS prob­lem, and for the web­servers a new fix­pack was sched­uled to be released not far in the future (as of this writ­ing: it is avail­able now).

Since we applied the DoS fix for the rev-proxy, we do not have a prob­lem any­more. This is not real­ly con­clu­sive, as we do not real­ly know if this fixed the prob­lem or if the attack­er stopped attack­ing us.

From read­ing what the DoS patch fix­es, we would assume we should see some con­tin­u­ous traf­fic going on between the rev-rpoxy and the web­serv­er, but there was noth­ing when we observed the strange state.

We are still not allowed to apply patch­es as we think we should do, but at least we have a bet­ter mon­i­tor­ing in place to watch out for this par­tic­u­lar prob­lem (acti­vate the extend­ed sta­tus in apache/IHS, look for lines with state ‘W’ and a long dura­tion (col­umn ‘SS’), raise an alert if the dura­tion is high­er than the max. possible/expected/desired dura­tion for all pos­si­ble URLs).

A phoronix bench­mark cre­ates a huge bench­mark­ing discussion

The recent Phoronix bench­mark which com­pared a release can­di­date of FreeB­SD 9 with Ora­cle Lin­ux Serv­er 6.1 cre­at­ed a huge dis­cus­sion in the FreeB­SD mail­inglists. The rea­son was that some peo­ple think the num­bers pre­sent­ed there give a wrong pic­ture of FreeB­SD. Part­ly because not all bench­mark num­bers are pre­sent­ed in the most promi­nent page (as linked above), but only at a dif­fer­ent place. This gives the impres­sion that FreeB­SD is infe­ri­or in this bench­mark while it just puts the focus (for a rea­son, accord­ing to some peo­ple) on a dif­fer­ent part of the bench­mark (to be more spe­cif­ic, blog­bench is doing disk reads and writes in par­al­lel, FreeB­SD gives high­er pri­or­i­ty to writes than to reads, FreeB­SD 9 out­per­forms OLS 6.1 in the writes while OLS 6.1 shines with the reads, and only the reads are pre­sent­ed on the first page). Oth­er com­plaints are that it is told that the default install was used (in this case UFS as the FS), when it was not (ZFS as the FS).

The author of the Phoronix arti­cle par­tic­i­pat­ed in parts of the dis­cus­sion and asked for spe­cif­ic improve­ment sug­ges­tions. A FreeB­SD com­mit­ter seems to be already work­ing to get some issues resolved. What I do not like per­son­al­ly, is that the arti­cle is not updat­ed with a remark that some things pre­sent­ed do not reflect the real­i­ty and a retest is necessary.

As there was much talk in the thread but not much obvi­ous activ­i­ty from our side to resolve some issues, I start­ed to improve the FreeB­SD wiki page about bench­mark­ing so that we are able to point to it in case some­one wants to bench­mark FreeB­SD. Oth­ers already chimed in and improved some things too. It is far from per­fect, some more eyes – and more impor­tant­ly some more fin­gers which add con­tent – are need­ed. Please go to the wiki page and try to help out (if you are afraid to write some­thing in the wiki, please at least tell your sug­ges­tions on a FreeB­SD mail­inglist so that oth­ers can improve the wiki page).

What we need too, is a wiki page about FreeB­SD tun­ing (a first step would be to take the man-page and con­vert it into a wiki page, then to improve it, and then to feed back the changes to the man-page while keep­ing the wiki page to be able to cross ref­er­ence parts from the bench­mark­ing page).

I already told about this in the thread about the Phoronix bench­mark: every­one is wel­come to improve the sit­u­a­tion. Do not talk, write some­thing. No mat­ter if it is an improve­ment to the bench­mark­ing page, tun­ing advise, or a tool which inspects the sys­tem and sug­gests some tun­ing. If you want to help in the wiki, cre­ate a First­name­Last­name account and ask a FreeB­SD comit­ter for write access.

A while ago (IIRC we have to think in months or even years) there was some frame­work for auto­mat­ic FreeB­SD bench­mark­ing. Unfor­tu­nate­ly the author run out of time. The frame­work was able to install a FreeB­SD sys­tem on a machine, run some spec­i­fied bench­mark (not much bench­marks where inte­grat­ed), and then install anoth­er FreeB­SD ver­sion to run the same bench­mark, or to rein­stall the same ver­sion to run anoth­er bench­mark. IIRC there was also some DB behind which col­lect­ed the results and maybe there was even some way to com­pare them. It would be nice if some­one could get some time to talk with the author to get the frame­work and set it up some­where, so that we have a con­trolled envi­ron­ment where we can do our own bench­marks in an auto­mat­ic and repeat­able fash­ion with sev­er­al FreeB­SD versions.

Exit mobile version
%%footer%%