Changeset f216c56


Ignore:
Timestamp:
10/24/2011 01:06:24 AM (13 years ago)
Author:
Bruce Dubbs <bdubbs@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 7.10, 7.4, 7.5, 7.6, 7.6-blfs, 7.6-systemd, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, gnome, kde5-13430, kde5-14269, kde5-14686, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, krejzi/svn, lazarus, lxqt, nosym, perl-modules, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, systemd-11177, systemd-13485, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
778be14
Parents:
599fda8
Message:

Add routine to remove out of date CA certificates.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@8915 af4574ff-66df-0310-9fd7-8a98e5e911e0

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • general/genlib/libxslt.xml

    r599fda8 rf216c56  
    3535    XSLT files.</para>
    3636
    37     &lfs65_checked;
    38     <para>&lfssvn_checked;20101029&lfssvn_checked2;</para>
     37    &lfs70_checked;
    3938
    4039    <bridgehead renderas="sect3">Package Information</bridgehead>
     
    9089
    9190  </sect2>
    92 
    93   <!-- <sect2 role="commands">
    94     <title>Command Explanations</title>
    95 
    96     <para><command>sed -i "s/\$(PYTHON_SITE_PACKAGES)/'&amp;'/"
    97     configure</command>: The quotes around this variable were inadvertently
    98     removed in this release. This command puts the quotes back in so that
    99     the variable is not interpreted as a shell command.</para>
    100 
    101   </sect2> -->
    10291
    10392  <sect2 role="content">
  • introduction/welcome/changelog.xml

    r599fda8 rf216c56  
    4545      <para>October 23rd, 2011</para>
    4646      <itemizedlist>
     47        <listitem>
     48          <para>[bdubbs] - Add routine to remove out of date
     49          CA certificates.</para>
     50        </listitem>
    4751        <listitem>
    4852          <para>[bdubbs] - Update to libxml2-2.7.8.</para>
  • postlfs/security/cacerts.xml

    r599fda8 rf216c56  
    130130   user:</para>
    131131
    132   <screen><userinput>cat > /bin/make-ca.sh &lt;&lt; "EOF"
     132   <screen><userinput>cat > /bin/make-ca.sh &lt;&lt; "EOF"
    133133#!/bin/bash
    134134# Begin make-ca.sh
     
    228228chmod +x /bin/make-ca.sh</userinput></screen>
    229229
     230   <para>Add a short script to remove expired certifictes from a directory.
     231   Again create this script as the <systemitem
     232   class="username">root</systemitem> user:</para>
     233
     234  <screen><userinput>cat > /bin/remove-expired-certs.sh &lt;&lt; "EOF"
     235#!/bin/bash
     236# Begin /bin/remove-expired-certs.sh
     237
     238OPENSSL=/usr/bin/openssl
     239DIR=/etc/ssl/certs
     240
     241if [ $# -gt 0 ]; then
     242  DIR="$1"
     243fi
     244
     245certs=$( find ${DIR} -type f -name "*.pem" -o -name "*.crt" )
     246today=$( date +%Y%m%d )
     247
     248for cert in $certs; do
     249  notafter=$( $OPENSSL x509 -enddate -in "${cert}" -noout )
     250  date=$( echo ${notafter} |  sed 's/^notAfter=//' )
     251
     252  if [ $( date -d "${date}" +%Y%m%d ) -lt ${today} ]; then
     253     echo "${cert} is expired! Removing..."
     254     rm -f "${cert}"
     255  fi
     256done
     257EOF
     258
     259chmod +x /bin/remove-expired-certs.sh</userinput></screen>
     260
    230261   <para>The following commands will fetch the certificates and convert them to
    231262   the correct format.  If desired, a web browser may be used instead of
     
    240271wget --output-document certdata.txt $url &amp;&amp;
    241272unset certhost certdir url               &amp;&amp;
    242 make-ca.sh</userinput></screen>
     273make-ca.sh                               &amp;&amp;
     274remove-expired-certs.sh certs</userinput></screen>
    243275
    244276   <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
    245277
    246 <screen><userinput>install -d ${SSLDIR}/certs        &amp;&amp;
    247 cp -v certs/*.pem ${SSLDIR}/certs &amp;&amp;
    248 c_rehash                          &amp;&amp;
    249 install ca-bundle.crt ${SSLDIR}</userinput></screen>
     278<screen><userinput>SSLDIR=/etc/ssl                                     &amp;&amp;
     279install -d ${SSLDIR}/certs                          &amp;&amp;
     280cp -v certs/*.pem ${SSLDIR}/certs                   &amp;&amp;
     281c_rehash                                            &amp;&amp;
     282install BLFS-ca-bundle*.crt ${SSLDIR}/ca-bundle.crt &amp;&amp;
     283unset SSLDIR</userinput></screen>
    250284
    251285   <para>Finally, clean up the current directory:</para>
     
    264298
    265299      <seglistitem>
    266         <seg>make-ca.sh and make-cert.pl</seg>
     300        <seg>make-ca.sh, make-cert.pl and remove-expired-certs.sh</seg>
    267301        <seg>None</seg>
    268302        <seg>/etc/ssl/certs</seg>
     
    297331        </listitem>
    298332      </varlistentry>
     333
     334      <varlistentry id="remove-expired-certs">
     335        <term><command>remove-expired-certs.sh</command></term>
     336        <listitem>
     337          <para>is a utility <application>perl</application> script that
     338          removed expired certificates fom a directory.  The defaut
     339          directory is <filename class='directory'>/etc/ssl/ceerts</filename>.</para>
     340          <indexterm zone="cacerts remove-expired-certs">
     341            <primary sortas="b-remove-expired-certs">remove-expired-certs</primary>
     342          </indexterm>
     343        </listitem>
     344      </varlistentry>
    299345   </variablelist>
    300346
Note: See TracChangeset for help on using the changeset viewer.