atst/.gitignore
dandds 0b5acde4c4 Stream-parse CRLs for caching file locations.
AT-AT needs to maintain a key-value CRL cache where each key is the DER
byte-string of the issuer and the value is a dictionary of the CRL file
path and expiration. This way when it checks a client certificate, it
can load the correct CRL by comparing the issuers. This is preferable to
loading all of the CRLs in-memory. However, it still requires that AT-AT
load and parse each CRL when the application boots. Because of the size
of the CRLs and their parsed, in-memory size, this leads to the
application spiking to use nearly 900MB of memory (resting usage is
around 50MB).

This change introduces a small function to ad-hoc parse the CRL and
obtain the information in the CRL we need: the issuer and the
expiration. It does this by reading the CRL byte-by-byte until it
reaches the ASN1 sequence that corresponds to the issuer, and then looks
ahead to find the nextUpdate field (i.e., the expiration date). The
CRLCache class uses this function to build its cache and JSON-serializes
the cache to disk. If another AT-AT application process finds the
serialized version, it will load that copy instead of rebuilding it. It
also entails a change to the function signature for the init method of
CRLCache: now it expects the CRL directory as its second argument,
instead of a list of locations.

The Python script invoked by `script/sync-crls` will rebuild the
location cache each time it's run. This means that when the Kubernetes
CronJob for CRLs runs, it will refresh the cache each time. When a new
application container boots, it will get the refreshed cache.

This also adds a nightly CircleCI job to sync the CRLs and test that the
ad-hoc parsing function returns the same result as a proper parsing
using the Python cryptography library. This provides extra insurance
that the function is returning correct results on real data.
2019-11-04 08:36:03 -05:00

76 lines
975 B
Plaintext

# Node modules get installed here
node_modules/
# sass and webassets output artifacts
scss/assets
scss/variables.scss
scss/variables.scss.map
.sass-cache/
.webassets-cache
# Python virtual env
.venv/
.pytest_cache/
__pycache__
# Compiled python bytecode files
*.pyc
.cache/
# static/fonts for now, since it is just symlink
static/fonts
# font files originate from a node module
static/fonts/*
static/assets
static/assets/*
# buildinfo files
static/buildinfo.*
# local log files
log/*
config/dev.ini
# CRLs
/crl
/crls
/crl-tmp
*.bk
crl_locations.json
# test CA config
ssl/client-certs/*.srl
# uploads
/uploads
# python coverage output
.coverage
# je coverage output
coverage
# BrowserStack
browserstacklocal
# decompiled CircleCI yaml
local-ci.yml
# python config
.python-version
# configuration files
override.ini
atst-overrides.ini
# binary file created by celery beat
celerybeat-schedule
# templates created for JS tests
js/test_templates
.mypy_cache/