When using DynamoDB as a database, it is designed to handle multiple partitions in a single table. Prease refer overview documentation for details about certificate revocation data in DyOCSP.
AttributeName | AttributeType | KeyType |
---|---|---|
ca | S | HASH |
serial | S | RANGE |
This key is not used in DyOCSP, but it is useful for managing revocation information.
AttributeName | AttributeType | KeyType |
---|---|---|
ca | S | HASH |
DyOCSP uses this global secondary index for utilizing the Scan API.
AttributeName | AttributeType | Description |
---|---|---|
ca | S | CA Name |
serial | S | Serial Number |
rev_type | S | Revocation Type |
exp_date | S | Expiration Date |
rev_date | S | Revoked Date |
crl_reason | S | CRL Reason |
These attributes are required, and since DyOCSP only requires mandatory attributes, any other attributes necessary for the management of private CAs may be attached.
Since the creation of a table involves a lot of configuration, only the necessary parts will be explained. The instructions will be illustrated with an image of the AWS console.
Set up keys of table as follows.
Set up global secondary index as follows.
The following IAM policy will suffice for DyOCSP:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:Scan"
],
"Resource": "arn:aws:dynamodb:your-region:your-aws-id:table/ca_db"
}
]
}
The following certificates are used here as an example.
server.crt
-----BEGIN CERTIFICATE-----
MIIDKTCCAhGgAwIBAgIRAMlxjbANYP+VoiqGiu9zV+swDQYJKoZIhvcNAQELBQAw
ADAeFw0yMzA5MTUwMTA5MDdaFw0zMzA5MTIwMTA5MDdaMBkxFzAVBgNVBAgMDkV4
YW1wbGUgU2VydmVyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr1jH
ZPXQwmInM+Z504gW7zM552wDlF2OQngxY7qv07CfOCuwL01bPoh8bDrUdqpLCky3
H9cYXIb+K0Eqr/1sBayV6w+T+wOXdN3uV6Xra2AvXvMmeLytFw2mQQexUMtbePzi
YWmc+1qQlJMtIDgYsnqXC1AgR8IILOT9jeXAu3eWYx5odrJ0ZhZAKQX8fm/dzYYN
g9tY9Ma7u2VAbEdH2Rq6ca3whw0ZYIJZZ6rLb+r5/z9oOXMWip3erSlVvD0qpVpz
IEjme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uwvrpQ6Lt4WsoDJR3LXaL2EIALblUhEl4mT99hdpKi4PUMgyG+AV1Gg4dcaZV7
YL4VMDKwq+SXFyzIFC7V6Nf/8VR0ISST8lfx8JYHf11y+e/AcX67mdNDhJCW+MdA
kUXvZkRRUeJenS7N0dmBpgw=
-----END PRIVATE KEY-----
Create an item indicating that the certificate is currently valid, as follows: This item is represented in JSON format:
{
"ca": {
"S": "example-ca"
},
"serial": {
"S": "C9718DB00D60FF95A22A868AEF7357EB"
},
"rev_type": {
"S": "V"
},
"exp_date": {
"S": "330912010907Z"
},
"rev_date": {
"S": ""
},
"crl_reason": {
"S": ""
}
}
Create a configuration file for DynamoDB:
dyocsp.yml
version: 0.1
log:
level: "info"
format: "pretty"
responder:
ca: "example-ca"
responder_certificate: "ocsp.crt"
responder_key: "ocsp.key"
issuer_certificate: "example-ca.crt"
cache:
interval: 30
delay: 8
db:
dynamodb:
region: "your-region"
table_name: "ca_db"
ca_gsi: "ca-index"
retry_max_attempts: 2
timeout: 120
http:
addr: "localhost"
port: 9080
- First, set the authentication information.
export AWS_ACCESS_KEY_ID=your-key-id
export AWS_SECRET_ACCESS_KEY=your-secret-access-key
or
aws configure set aws_access_key_id dummyaccesskey
aws configure set aws_secret_access_key dummysecretkey
- Second, run
dyocsp
.
dyocsp -c dyocsp.yml
- Test OCSP Request.
openssl ocsp -CAfile example-ca.crt -issuer example-ca.crt -cert server.crt -no_nonce -url http://localhost:9080
To update an item indicating that the certificate is currently revoked:
This item is represented in JSON format:
{
"ca": {
"S": "example-ca"
},
"serial": {
"S": "C9718DB00D60FF95A22A868AEF7357EB"
},
"crl_reason": {
"S": "unspecified"
},
"exp_date": {
"S": "330912010907Z"
},
"rev_date": {
"S": "231012010907Z"
},
"rev_type": {
"S": "R"
}