6861 Commits

Author SHA1 Message Date
dandds
17149efa09
Merge pull request #1167 from dod-ccpo/crl-test-bugfix
CRL test should skip JSON cache.
2019-11-06 12:00:05 -05:00
graham-dds
6bc1e0ba9a Ensure environment names are sorted when rendered 2019-11-06 11:53:31 -05:00
dandds
7ac29eff56 CRL test should skip JSON cache. 2019-11-06 06:08:48 -05:00
leigh-mil
7b96a05f95
Merge pull request #1154 from dod-ccpo/add-env-roles-to-app-members-table
Add env role to the app members table and truncate long env names
2019-11-05 15:58:25 -05:00
leigh-mil
da516554c2 Add env role to the app members table and truncate long env names 2019-11-05 11:46:33 -05:00
leigh-mil
6569bbd135
Merge pull request #1165 from dod-ccpo/ccpo-users-order
Sort ccpo users
2019-11-05 10:43:15 -05:00
dandds
d5bc49a7b9
Merge pull request #1156 from dod-ccpo/crl-issuer-cache
CRL Issuer Cache
2019-11-05 09:59:43 -05:00
leigh-mil
35b2718e18 Sort ccpo users by last name 2019-11-05 09:48:54 -05:00
leigh-mil
9e6e19fb90
Merge pull request #1153 from dod-ccpo/fix-save-button-text
Fix Save button text
2019-11-05 06:14:59 -05:00
Jay R. Newlin (PromptWorks)
5c366c2993
Merge pull request #1158 from dod-ccpo/ghost-refactor
Tests "refactored" to remove extraneous clicks
2019-11-04 16:57:46 -05:00
richard-dds
daa0f81dd5
Merge pull request #1149 from dod-ccpo/lgtm-fixes
LGTM Fixes
2019-11-04 15:35:03 -05:00
dandds
3e0b7b1c5f CD sets image for Kubernetes CRLs CronJob.
This ensures that the CronJon responsible for updating CRLs is using the
most up-to-date image. Previously, it used the "latest" tag. Since the
K8s Docker environment caches image tags, "latest" would not always be
up-to-date.
2019-11-04 08:44:21 -05:00
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
Jay R. Newlin (PromptWorks)
fee7a1f85d Tests "refactored" to remove extraneous clicks 2019-11-01 16:08:05 -04:00
Jay R. Newlin (PromptWorks)
e64f5cb96a
Merge pull request #1155 from dod-ccpo/ghost-inspector-to-github
Ghost Inspector to GitHub
2019-11-01 15:59:42 -04:00
dandds
56f0119814
Merge pull request #1157 from dod-ccpo/quick-fixes
Fix secrets baseline and type hint error.
2019-11-01 15:38:34 -04:00
Jay R. Newlin (PromptWorks)
288999c77f Removing erroreous .DS_Store 2019-11-01 15:12:39 -04:00
dandds
87a2da68dc Fix secrets baseline and type hint error.
- detect-secrets was previously bumped to 0.13 but the baseline file was
  not updated.
- mypy objects to the way the Azure Subscription type was defined. Since
  the module is encapsulated for dependency injection, we can either
  declare it as a generic or remove the type hint. I did the latter,
  since I don't know that we gain anything by the former.
2019-11-01 15:06:30 -04:00
Jay R. Newlin (PromptWorks)
8c7a5e7e5f Update README with reference to exported Ghost Inspector tests 2019-10-31 16:32:23 -04:00
leigh-mil
d142fa974a Update Form mixin so that you can enable the save button for a form on render 2019-10-31 16:21:32 -04:00
Jay R. Newlin (PromptWorks)
fbe0963071 First export of test steps from Ghost Inspector 2019-10-31 16:04:29 -04:00
richard-dds
e3c9105270 Fix some LGTM errors 2019-10-31 13:46:04 -04:00
tomdds
52de1471e0
Merge pull request #1144 from dod-ccpo/azure-integration
Azure Integration
2019-10-31 13:07:11 -04:00
leigh-mil
f3dcca8368 use 'text=' in the SaveButton kwargs and add in a default for the save button text 2019-10-31 10:48:26 -04:00
tomdds
d0746a3bf6 Cleanup imports and formatting in azure testing code 2019-10-30 16:43:59 -04:00
tomdds
3e7a720ffb Post-rebase fixes 2019-10-30 16:43:59 -04:00
tomdds
63ea7db390 Rudimentary tests to validate mocking 2019-10-30 16:43:59 -04:00
tomdds
99e306e602 First pass at mocking and testing azure integration 2019-10-30 16:43:59 -04:00
tomdds
1a92cd35d1 Extract service principal resolution to private method
Also made root creds a property
2019-10-30 16:43:59 -04:00
tomdds
41633417d8 Add Azure Libraries 2019-10-30 16:43:59 -04:00
dandds
06dc193c28 WIP: can add new app/SP 2019-10-30 16:43:59 -04:00
tomdds
608f988b71 First pass at process of adding admin to azure 2019-10-30 16:43:59 -04:00
tomdds
15ff4a01f1 Add Azure Graph API 2019-10-30 16:43:59 -04:00
tomdds
5cd20c650a Draft of Azure create_environment 2019-10-30 16:43:59 -04:00
dandds
06239c94ba
Merge pull request #1145 from dod-ccpo/bugfix/disallow-resent-invite-with-invalid-date
Allow submit buttons to be valid on initial render
2019-10-30 16:15:13 -04:00
dandds
b5a2e6e929
Merge pull request #1141 from dod-ccpo/consolidate-ci
Consolidate CI
2019-10-30 16:06:46 -04:00
dandds
b7c5b5ef7f
Merge pull request #1150 from dod-ccpo/remove-dispatch-environment-baseline
Remove the Celery schedule for the environment baseline task.
2019-10-30 16:05:55 -04:00
richard-dds
6910916cd8
Merge pull request #1148 from dod-ccpo/remove-aws-uploader
Remove AwsUploader
2019-10-30 15:48:09 -04:00
leigh-mil
48a90b5177
Merge pull request #1152 from dod-ccpo/env-processing-label-bugfix
Remove baseline_info column from environments table
2019-10-30 15:47:58 -04:00
leigh-mil
e64900245d Remove baseline_info column from environments table 2019-10-30 14:46:33 -04:00
richard-dds
f4e72e7173
Merge pull request #1151 from dod-ccpo/fix-suspend-migration
Fix "disabled environment role status" migration
2019-10-30 14:46:10 -04:00
richard-dds
308bad2fc8 Fix "disabled environment role status" migration 2019-10-30 14:31:27 -04:00
dandds
969293f5b2 Remove the Celery schedule for the environment baseline task. 2019-10-30 13:03:11 -04:00
dandds
23c4ba32eb CI/CD uses Docker containers exclusively and removes CircleCI Orbs.
The CircleCI Orbs were useful for getting started, but now that we only
have to deploy to one provider our pipeline should be tailored to
efficiently push to just that environment. This inlines all the relevant
pieces from the Orbs we were relying on as bash/sh commands instead.

This builds the Docker images upfront. Since we have a multi-stage
Dockerfile, it builds the first stage as a separate image and then
proceeds to build the complete image. This is done so that the first
stage (called "builder") can be used for testing. It retains executables
like pipenv that we need to install development dependencies needed for
tests.

Other notes:
- CircleCI does not persist Docker images between jobs. As a
  work-around, we use the CircleCI caching mechanism to create a named
  cache with *.tar copies of the images. Subsequent jobs use the cache
  and load the images.
- Both the test and integration-tests jobs need to make minor
  modifications to the container to run correctly. The test job needs to
  install the development Python dependencies, and the integration-tests
  job needs to rebuild the JS bundle so that it uses the mock uploader
  (the container is build to use the Azure uploader by default).
- The test and integration-tests jobs run in parallel.
- This adjusts the Dockerfile so that the TZ environment variable is set
  for both stages of the build.
2019-10-30 12:04:21 -04:00
richard-dds
36dc66504c
Merge pull request #1147 from dod-ccpo/disable-user
Implement EnvironmentRoles.disable
2019-10-30 11:35:39 -04:00
richard-dds
1746c297d1 Use deterministic "mock-test" CSP in CI 2019-10-29 16:19:53 -04:00
richard-dds
910d31df30 Remove AwsUploader 2019-10-29 16:02:48 -04:00
richard-dds
d1e6533824 Implement EnvironmentRoles.disable 2019-10-29 15:57:57 -04:00
richard-dds
ec44d4a560
Merge pull request #1143 from dod-ccpo/consolidate-csp-interface
Simplify CloudProviderInterface and remove AWS impl.
2019-10-29 13:47:14 -04:00
dandds
3456f37396
Merge pull request #1142 from dod-ccpo/bugfix/revoke-deleted-user
Bugfix: Invited but disabled portfolio member shouldn't be able to reactivate self
2019-10-29 11:53:58 -04:00