Archive

Archive for the ‘certifikat’ Category

The Nerd Herd – Avsnitt 44 – PKI

May 22nd, 2013 Comments off

I en bunker långt under Normalms gator finns “The Nerd Herd” studion, där produceras det varje vecka tunga teknikprogram med erkända experter!

Tillsammans med Johan Persson, Michael Anderberg och Fredrik ”DXter” Jonsson försöker vi under detta avsnitt ge våra synpunkter och tankar om och kring PKI i och PKI relaterade frågor och funderingar…

Avsnittet kan laddas ner här… (Du kan även prenumerera på showen i iTunes och gPodder – ge gärna en positiv review också, så att fler kan hitta showen, tack!)

Du kan givetvis följa The Nerd Herd på http://thenerdherdse.wordpress.com, DXter på hans blogg http://poweradmin.se

/Hasain

Certificate Selection & Certificate Friendly Name Tool

November 4th, 2011 Comments off

The certificate selection user interface in Windows supports filtering logic to provide a simplified user experience when an application presents multiple certificates. But some applications are not designed to use filtering logic (developers not aware of functionality…) or uses filters that does not provide efficient reduction of the number of certificates presented to the user making it almost impossible for a user to know witch certificate to choose unless opening the certificate and looking at the details of template name, EKU, etc.

This is particularly true when all certificates has been automatically enrolled using the same user DN/CN attribute based on the users Active Directory user object attributes. In addition to that, Autoenrollment does not support variations in certificate subject name unless using some third party policy module installed on the Active Directory Certificates Services.

Knowing that the certificate selection UI supports certificate friendly names. Setting the certificate friendly name to include information about the certificate template can simplify the users task to select the correct certificate.

Friendly names are properties in the X.509 certificate store in Windows that can be set at any time after the certificate has been created/installed in the store.

One way to set the friendly name is through the certificate MMC SnapIn. Alternatively certutil.exe can be used in the following way:

Create a text file containing the following information:

[Version]
Signature = “$Windows NT$”
[Properties]
11 = “{text}My Friendly Name”

Save the file as friendlyname.inf

Determine the serialnumber of the certificate where the friendly name should be changed.

Run the following command at a command-line:
certutil –repairstore –user my {SerialNumber} FriendlyName.inf

Automating the friendly name can be achieved by either automating/scripting the steps above alternatively by creating a tool that enumerates all certificates in the personal store and assign the friendly name.

A proof of concept CertFN.exe tool was created to automate the above. The tool receives a parameter for the template name to use when filtering the user store, it then sets the friendly name based on the schema “Template Name – Certificate Subject Name”

  CertFN - Certificate Friendly Name Tool download:(39.3 KiB, 4,340)

  CertFN - Certificate Friendly Name Tool - The Powershell Edition download:(1.1 KiB, 5,573)

Public Key Infrastructure at Microsoft – 2008 R2 Edition

October 3rd, 2011 Comments off

Microsoft IT has released an updated version of the “Public Key Infrastructure at Microsoft” whitepaper found at http://www.microsoft.com/download/en/details.aspx?id=27581 or here Public Key Infrastructure at Microsoft 1750_PKI_TWP

The update deals with changes to the Microsoft internal PKI structure as part of the Windows Server 2008 R2 migration. There are many good “lessons learned and best practicess” outlined by Microsoft IT as a result of the migration/upgrade process that was performed.

Some of my favorites are the way they use CRL Overlap to provide higher availablity of CRLs and the simplified two tier structure together with Cross Forest Enrollment and the discussions about virtualisation of CAs

Some of the highlighted features in the document are:

Windows Server 2008:

  • Improved enrollment capabilities that enable delegated enrollment agents to be assigned on a per-template basis
  • Enhanced performance monitoring with the addition of new performance counters
  • Scalable, high-speed revocation status response services that combine CRLs and integrated Online Responder services
  • Support for Cryptography Next Generation (CNG) to enable the use of Suite B algorithms
  • Enhanced service monitoring with the introduction of the Windows Server 2008 AD CS Management Pack for Microsoft Operations Manager 2005
  • More detailed server administration with restricted certificate managers
  • Failover cluster support

Windows Server 2008 R2:

  • Cross-forest enrollment capability that allows for consolidation of existing hardware
  • Databaseless CA feature to avoid storing unnecessary certificate records
  • Best Practice Analyzer for improved configuration practices
  • Web-based certificate enrollment protocol to allow enrollment over the Internet

 

IPSec StrongCRLCheck does not work on Windows Server 2008 R2-based RRAS

September 15th, 2011 Comments off

SYMPTOMS:

  • You install the Routing and Remote Access Service (RRAS) role on a server that is running Windows Server 2008 R2.
  • You configure the server to accept Layer Two Tunneling Protocol with IPsec (L2TP/IPsec) connections.
  • You run the Netsh ipsec dynamic set config property=strongcrlcheck value=2 command to configure the StrongCRLCheck setting on the server.
  • You revoke a certificate on a client computer. The certificate is used to make L2TP/IPsec connections to the RRAS server.
  • You establish an L2TP/IPsec connection from the client computer to the server.
  • The connection to the RRAS server is successful. However, you expect that the client computer cannot connect to the server.
The issue occurs because the Remote Access Service (RAS) ignores the StrongCRLCheck setting!
To correct this you need a hot fix and a new registry key as instructed by KB2351254 http://support.microsoft.com/kb/2351254

FIM CM 2010 links from Microsoft Donwloads

July 13th, 2011 Comments off

Är det svårt, dyrt eller ren slarv?

March 1st, 2010 Comments off

Kunde inte låta bli att notera texten nedan på ett informationsblad som beskriver hur man gjorde för att ansluta till ett trådlöst WIFI nät. Det som drog min blick extra mycket var notisen på bladet som syns på bilden nedan.

  

Jag blir riktigt fundersam när jag ser sådana beskrivningar där vi lär våra användare ett felaktigt beteende. Vad tror vi kommer att hända om samma användare får ett liknande fel när han eller hon surfar till sin internetbank eller företagets webbmail mm.

/Hasain

Ännu en spik i kistan för mjuka cert

August 22nd, 2008 Comments off

Många har ställt frågan om mjuka cert går att exportera i Windows trotts att man flaggat den privata nyckeln som icke exporterbar och svaret har alltid varit JA, det går bra att läsa av den privata nyckeln även i ett sådant fall då den bara skyddas av systemanrop i Windows.

Nu finns det ett fungerande verktyg för att exportera privata nycklar med tillhörande certifikat från ett Windows system oavsett olika flaggor om export. Verktyget heter Jailbreak och finns att ladda ner från isecpartners.

Observera att verktyget klassas som trojan/trojan loader av de flesta antivirus!

Bankärenden med certifikat men utan smartkort eller en kombinerad OTP har aldrig varit ett alternativ för mig 😉

/Hasain

Categories: certifikat, export, Mjuka Certifikat Tags:

Smart Card Logon med certifikat utan EKU i Windows 2003

November 28th, 2007 Comments off

Windows Vista och Windows Server 2008 har som bekant gjort det möjligt att använda certifikat för Smart Card Logon utan kraven på UPN och EKU i certifikaten. Denna möjlighet har nu kommit till Windows Server 2003, inte fullt så felxibelt som i Vista / 2008 med en bra början.

För en tid sedan så blev jag inblandad i ett projekt med fokus på smartkort, vi har sedan dess genomfört en massa olika tester av kort, läsare, csp:er och en massa kobinationer av utgivare och verktyg för att kunna hantera olika kombinationer.

Att använda sig av en extern CA för smart card logon var en av de tester som vi hade på vår lista, med utgångspunkten i KB:n på http://support.microsoft.com/kb/281245 så kunnde vi konstatera att det inte var så flexibelt som man önskade sig men efter lite sökande så hittade jag följande KB på http://support.microsoft.com/kb/936358, en patch till Windows Server 2003 som tar bort kravet på EKU! 

Efter att ha ringt supporten och fått patchen så var det tid att installera och testa den, sagt och gjort fixades en lämplig DC med CA och en Vista klient. Testerna visade dock inga av de förväntade resultaten så efter lite bollande kunnde jag konstatera att det bara var kravet på EKU som slopades och att kravet på en UPN i certifikatet fanns kvar! Det blev inte riktigt vågen men nästan, en bra början som sagt….

Vill du se detta live och eller diskutera det så kommer jag att visa det under Windows Server 2008 Summiten den 5:e december, vi ses där 🙂

 

/Hasain

Categories: certifikat, CSP, EKU, PKI, Smart Card, UPN Tags:

Utfärda certifikat med anpassat subject och alternative subject name

October 16th, 2007 Comments off

När man installerar en SBS server så får man med ett self-signed certifikat med flera CN i subject-fältet, detta är ganska praktiskt om man har en server som man vill nå med https och olika namn utan den berömda certifikat varningen.

Om du själv vill skapa ett sådant certifikat med hjälp av din Windows 2003 baserade CA så kan du göra det genom att följa denna instruktion:

  1. Tala om för CA tjänsten att det är OK att ändra Subject och Alternative Subject Name i ett cert request genom att köra följande kommandon på din CA server:
    1. certutil.exe -setreg policy\EditFlags +EDITF_ATTRIBUTESUBJECTALTNAME2
    2. certutil.exe -setreg ca\CRLFlags +CRLF_ALLOW_REQUEST_ATTRIBUTE_SUBJECT
  2. Starta om Certsvc tjänsten så att inställningarna tas i bruk
  3. Skapa ett certifikat begärna (cert request), eller använd exempelvis den som kommer från IIS:ens certifikat guide
    • Om du vill skapa en egen request  baserad på en bef. mall så kan du använda följande steg
      1. Spara ner filen req.txt (kolla attachements) till din lokala disk
      2. ändra i den så CertificateTemplate pekar på den mall du vill utgå ifrån
      3. kör:  certreq.exe -new req.txt cert-req.txt
  4. kör följande kommando för att ändra subject-fältet så att den innehåller flera CN=
    • certreq.exe -attrib "CN:localhost\nCN:www.test.com" -submit cert-req.txt new.cer
  5. Installera certifikatet och koppla den till det nyckelpar som skapats genom att köra: certreq.exe -accept new.cer
  6. Kör certmgr.msc och titta under private så hittar du det nya certifikatet och kan exportera den tillsammans med nycklarna

/Hasain

Utöka giltighetstiden på en V1 mall i Windows 2003

October 16th, 2007 Comments off

En av föredelarna med att köra sin CA på en Windows Server 2003 Ent. Edition är att kunna utfärda certifikat med anpassade inställningar genom att kunna utnyttja v2 certifikat mallar. De flesta som jag har varit i kontakt med vill ha v2 mallar för att utöka giltighetstiden på ett certifikat.

Om man nu inte har en Windows server 2003 Ent. Edition men vill gärna få exempelvis ett smart card logon certifikat att gälla i tre eller fyra år så kan man pröva följande:

  1. Använd certtmpl.msc för att skapa en kopia av någon av mallarna som finns i lista, ta exempelvis user mallen och skapa en kopia av den
  2. Justera tiden till önskad inställning, exempelvis 3 år
  3. Använd adsiedit.msc för att plocka fram den nya mallen som finns under Configuration/Services/Public Key Services/Certificate Templates
  4. Leta nu efter pKIExpirationPeriod bland attributen för mallen
  5. kopiera nu värdet av detta attribut, bör linka detta: 00 00 E5 1C BA 84 FB FF
  6. Plocka fram den v1 mall som du vill utöka tiden på
  7. Leta nu efter pKIExpirationPeriod bland attributen för mallen
  8. Editera den och klistra in värden som du kopierade från förra mallen
  9. Nu har du en v1 mall som gäller i 3 år 🙂

Din CA kommer inte att tycka att detta är något fel, mallen är ju en v1 mall med lite längre giltighetstid men glöm nu inte att se till att din CA kan utfärda certifikat som gäller mer än standard tiden på 2 år genom at ändra nycklarna

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CertSvc
\Configuration\ CA xxx
\
ValidityPeriod

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CertSvc
\Configuration\ CA xxx
\
ValidityPeriodUnits

 

Detta bör fungera utan problem i de flesta system…

/Hasain