Martin Bartosch writes:
> CRL issuance can be automated quite easily, see
>
> http://wiki.openxpki.org/index.php/Best_Practices/Housekeeping/Automatic_CRL_issuance
> http://wiki.openxpki.org/index.php/Manual/Reference/Administration_tools#openxpkicmd
Parallel to the development of openxpkicmd I've developed a stand-alone
CRL-generation perl script some weeks ago, see below:
1. it uses the OpenXPKI API to generate a new CRL.
2. it converts the resulting CRL from PEM format into DER format
(used by Cisco routers)
3. it copies the generated CRL to a backup (ca2) server,
this requires SSH keys pre-installed on ca1 and ca2 machine.
Three comments:
(1) it would be more comfortable if OpenXPKI could generate the DER
format itself as an configuration option.
(2) it would be most comfortable if OpenXPKI could run in two
instances (two application servers on two different machines) with
an active-active-database installation, each OpenXPKI instance could
generate it's local machine CRL.
(3) It'd be great if my CRL user could have restricted credentials.
I've already tried to strip down the workflow rights together with
a specific designed CRL role but this didn't work yet, I didn't
get workflow conditions right suited.
Greetings
-Achim
#!/usr/bin/perl
# gencrl 1.0 (C)opyright Joachim Astel 2010
use English;
use strict;
use warnings;
use OpenXPKI::Client;
our %config = (
server_dir => "/",
config_dir => "/etc/openxpki",
var_dir => "/var/openxpki",
config_file => "/etc/openxpki/config.xml",
socket_file => "/var/run/openxpki/openxpki.socket",
debug => 1,
);
my $SLAVEHOST = "ca2";
my $DEBUG = 1;
my $cli = OpenXPKI::Client->new(
{
SOCKETFILE => $config{socket_file},
}
);
die unless defined $cli;
$cli->init_session();
die unless $cli->get_communication_state();
# see auth.xml
my $response = $cli->send_receive_service_msg('GET_AUTHENTICATION_STACK',
{
AUTHENTICATION_STACK => 'Operator',
}
);
# see auth.xml
$response = $cli->send_receive_service_msg('GET_PASSWD_LOGIN',
{
# User CRL with role "RA Operator"
'LOGIN' => 'crl',
'PASSWD' => 'passwd_for_user_crl',
},
);
print "Login: ", $response->{SERVICE_MSG}, "\n" if $DEBUG;
die unless $response->{SERVICE_MSG} eq 'SERVICE_READY';
$response = $cli->send_receive_command_msg('create_workflow_instance',
{
WORKFLOW => 'I18N_OPENXPKI_WF_TYPE_CRL_ISSUANCE',
},
);
die unless $response->{SERVICE_MSG} eq 'COMMAND';
print "CRL-Issuance Workflow-ID: ", $response->{PARAMS}->{WORKFLOW}->{ID}, "\n"
if $DEBUG;
$cli->send_service_msg ("LOGOUT");
print "OK\n" if $DEBUG;
##
# copy of CRL to slave system:
##
system "openssl crl -inform PEM -in /etc/ssl/SubCA/crl/crl.pem -outform DER
-out /srv/www/scep/htdocs/crl/subca.crl";
system "scp -q /etc/ssl/SubCA/crl/crl.pem
$SLAVEHOST:/etc/ssl/SubCA/crl/crl.pem";
system "scp -q /srv/www/scep/htdocs/crl/subca.crl
$SLAVEHOST:/srv/www/scep/htdocs/crl/subca.crl";
system "openssl crl -inform PEM -in /home/crl/crl/rootCA.crl -outform DER -out
/srv/www/scep/htdocs/crl/rootca.crl";
system "scp -q /home/crl/crl/rootCA.crl $SLAVEHOST:/home/crl/crl/rootCA.crl";
system "scp -q /srv/www/scep/htdocs/crl/rootca.crl
$SLAVEHOST:/srv/www/scep/htdocs/crl/rootca.crl";
exit 0;
--
Joachim Astel | [email protected] | OpenXPKI + OpenCA-OCSPD + OpenCA-Tools
------------------------------------------------------------------------------
_______________________________________________
OpenXPKI-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openxpki-users