1
0
mirror of https://github.com/quay/quay.git synced 2026-01-27 18:42:52 +03:00
Commit Graph

15 Commits

Author SHA1 Message Date
Oleg Bulatov
84fa795ae7 chore: fix isort config and remove isort: skip_file (#2196)
* chore: pass config to isort as it doesn't always detect it

* chore: mark package "test" as local, not stdlib

* chore: remove "isort: skip_file"

* chore: fix app in test_load_security_information

* chore: fix app in test_notification

* chore: fix app in test_index_report
2023-09-21 11:46:03 -04:00
Syed Ahmed
54fcfd14f9 secscan: Cache clair vuln reports (PROJQUAY-6057) (#2245)
uses modelcache to for caching clair security report responses
2023-09-20 20:33:41 +00:00
Kenny Lee Sin Cheong
5f63b3a7bb chore: drop deprecated tables and remove unused code (PROJQUAY-522) (#2089)
* chore: drop deprecated tables and remove unused code

* isort imports

* migration: check for table existence before drop
2023-08-25 12:17:24 -04:00
Kenny Lee Sin Cheong
0ea4826956 secscan: garbage collect manifests (#1663)
Garbage collect manifests no longer referenced in Quay from the
security scanner service.

Also moved quota related code from data/registry_model/ to data/model/
to avoid circular dependencies.
2023-07-06 11:59:47 -04:00
Brandon Caton
9eb4fb6aa4 Revert workqueue refactor (#1456)
Currently the prometheus and GC workers are not running correctly.
Reverting the following commits:
- 4e1a985e70
- dac183a1ef
- 68a0d9eaf0
- af1aacea08
- f334b80098
2022-07-22 13:11:39 -04:00
Oleg Bulatov
4e1a985e70 Initialize model.config on its import (PROJQUAY-4006) (#1412)
* Initialize model.config on its import

* Initialze registry_model and secscan_model on import

Co-authored-by: Dave O'Connor <1656866+HammerMeetNail@users.noreply.github.com>
2022-07-12 01:15:30 +02:00
Kenny Lee Sin Cheong
5471d3cbcb secscan: deprecate support for Clair V2 (PROJQUAY-2837) (#951)
Removes read support for Clair V2, along with the need to package
jwtproxy with Quay.

TODO: Drop deprecate image api + image table, remove image data model.
2022-05-31 10:15:54 -04:00
Kenny Lee Sin Cheong
9ac30007f9 secscan: cleanup secscan interface (PROJQUAY-3501) (#1284) 2022-04-25 14:24:08 -04:00
Kenny Lee Sin Cheong
7d0f318baa secscan: update the secscan model interface (PROJQUAY-3501) (#1254)
Add index_manifests as part of secscan interface. index_manifests is
a superset of perform_indexing, but also indexes a batch of recent manifests.
2022-04-19 13:39:51 -04:00
Kenny Lee Sin Cheong
79e9778576 secscan: handle proxy model fallback to noop v2 (PROJQUAY-2289) (#847)
Handles the case where a V2 scanner is not configured (noop
implementation) and the proxy model tries to load security information
that has not been indexed in V4 yet. In such case, the noop
implementation of the V2 scanner should return a COULD_NOT_LOAD
status (instead of None, to comply to the secscan model interface),
and ignore the fallback to V2, and finally just return the V4
status (NOT_YET_INDEXED)
2021-07-23 12:09:00 -04:00
Alec Merdler
a4390c3785 implement notification system for security scanner v4 (#557) 2020-10-01 12:27:45 -07:00
Joseph Schorr
0e628b1569 Deprecate Image rows and move to in-memory synthesized legacy images [Python 3] (#442)
* Change verbs to use a DerivedStorageForManifest table instead of DerivedStorageForImage

This allows us to deprecate the DerivedStorageForImage table.

Fixes https://issues.redhat.com/browse/PROJQUAY-519

* Change uploaded blob tracking to use its own table and deprecate
RepositoryTag

* Start recording the compressed layers size and config media type on the
manifest row in the database

NOTE: This change includes a database migration which will *lock* the
manifest table

* Change tag API to return the layers size from the manifest

* Remove unused code

* Add new config_media_type field to OCI types

* Fix secscan V2 test for us no longer writing temp images

* Remove unused uploading field

* Switch registry model to use synthetic legacy images

Legacy images are now (with exception of the V2 security model) read from the *manifest* and sythensized in memory. The legacy image IDs are generated realtime based on the hashids library. This change also further deprecates a bunch of our Image APIs, reducing them to only returning the image IDs, and emptying out the remaining metadata (to avoid the requirement of us loading the information for the manifest from storage).

This has been tested with our full clients test suite with success.

* Add a backfill worker for manifest layers compressed sizes

* Change image tracks into manifest tracks now that we no longer have
manifest-less tags

* Add back in the missing method

* Add missing joins to reduce extra queries

* Remove unnecessary join when looking up legacy images

* Remove extra hidden filter on tag queries

* Further DB improvements

* Delete all Verbs, as they were deprecated

* Add back missing parameter in manifest data type

* Fix join to return None for the robot if not defined on mirror config

* switch to using secscan_v4_model for all indexing and remove most of secscan_v2_model code

* Add a missing join

* Remove files accidentally re-added due to rebase

* Add back hashids lib

* Rebase fixes

* Fix broken test

* Remove unused GPG signer now that ACI conversion is removed

* Remove duplicated repomirrorworker

* Remove unused notification code for secscan. We'll re-add it once Clair
V4 security notifications are ready to go

* Fix formatting

* Stop writing Image rows when creating manifests

* Stop writing empty layer blobs for manifests

As these blobs are shared, we don't need to write ManifestBlob rows
for them

* Remove further unused code

* Add doc comment to _build_blob_map

* Add unit test for synthetic V1 IDs

* Remove unused import

* Add an invalid value test to synthetic ID decode tests

* Add manifest backfill worker back in

Seems to have been removed at some point

* Add a test for cached active tags

* Rename test_shared to not conflict with another same-named test file

Pytest doesn't like having two test modules with the same name

* Have manifestbackfillworker also copy over the config_media_type if present

Co-authored-by: alecmerdler <alecmerdler@gmail.com>
2020-07-28 13:03:10 -04:00
Alec Merdler
11eae32950 fix secscan model to work when only using Clair v2 (#362) 2020-04-30 14:24:08 -07:00
Alec Merdler
531b97c4f9 implement Clair v4 client and set up model splitting (#259) 2020-03-31 11:32:56 -07:00
Joseph Schorr
d9d6083ad6 Place all security scanner access behind a new data model interface
This is in preparation for the beginning of support for the new API for ClairCore (V4)

Fixes https://issues.redhat.com/browse/PROJQUAY-177
2020-01-29 13:02:14 -05:00