1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00

343 Commits

Author SHA1 Message Date
Antonio Carlos Royo
7f865c9a49 [redhat-3.10] deps: update pbkdf2 to version 3.1.3 (PROJQUAY-9093) (#4116)
* update pbkdf2 to version 3.1.3

* updating registry proxy tests

---------

Co-authored-by: Antonio Carlos Royo <aroyo@aroyo-thinkpadp1gen7.rmtco.csb>
2025-07-07 15:06:55 -03:00
Brandon Caton
1cba8b2af2 ci: fixing app type import (PROJQUAY-8991) (#4038)
ci: fixing app type import (PROJQUAY-8991) (#4021)

ci: fixing app type import
2025-06-11 09:09:36 -04:00
OpenShift Cherrypick Robot
eb6899410d [redhat-3.10] proxycache(permissions): CVE-2025-4374 (PROJQUAY-8892) (#3963)
fixing CVE-2025-4374 by extending the create_repository method to understand if we are requesting a proxy_cache repository added unittests for create_repository when proxy_cache.

Co-authored-by: Michaela Lang <milang@redhat.com>
2025-05-27 15:07:08 -04:00
Brandon Caton
02635f5fcc cherrypick: commit f2417670 from master (PROJQUAY-6895) (#2797)
cherry-picking commit f241767005 from master
2024-03-28 09:34:04 -04:00
OpenShift Cherrypick Robot
30496b29c4 [redhat-3.10] quota: removing repo size from quota verification (PROJQUAY-6637) (#2708)
removing repo size from upload image size during quota verification

Co-authored-by: bcaton <bcaton@redhat.com>
2024-02-27 13:41:24 -05:00
OpenShift Cherrypick Robot
4dd833adf1 [redhat-3.10] fix: pull-through should tolerate missing tag (PROJQUAY-4849) (#2617)
* fix: add a test for the bug (PROJQUAY-4849)

* fix: pull-through should tolerate missing tag (PROJQUAY-4849)

---------

Co-authored-by: Oleg Bulatov <oleg@bulatov.me>
2024-01-18 16:46:48 +01:00
OpenShift Cherrypick Robot
2044413b83 [redhat-3.10] user(robots): disallow robot login and create 2nd (PROJQUAY-5968) (#2541)
* Fixed typo, added ROBOTS_WHITELIST as without the ROBOTS_DISALLOW does not make sense

* added ROBOTS_WHITELIST default to config.py

---------

Co-authored-by: Michaela Lang <milang@redhat.com>
2023-12-05 17:08:28 +00:00
OpenShift Cherrypick Robot
73b36220b3 [redhat-3.10] autoprune: adding audit logs to namespace autoprune policy API (PROJQUAY-6229) (#2538)
Adding audit logs to namespace autoprune policy API

---------

Co-authored-by: bcaton <bcaton@redhat.com>
2023-12-04 14:32:48 -05:00
OpenShift Cherrypick Robot
3f7331794d [redhat-3.10] autoprune: validating input to autoprune policy (PROJQUAY-6230) (#2461)
* validating input to autoprune policy

* adding backend tests

---------

Co-authored-by: bcaton <bcaton@redhat.com>
2023-11-07 20:28:59 +01:00
Brandon Caton
30efa2af76 autoprune: preventing prune of mirror or readonly repos (PROJQUAY-6235) (#2425)
Prevent prune of mirror or readonly repositories even if a auto-prune policy is configured.
2023-10-23 09:31:17 -04:00
Michaela Lang
4719f46c2c federationuser(ldap): adding keepalive settings for LDAP connections (PROJQUAY-5137) (#1975)
* - added env option to select if we want to follow LDAP referrals
- added check on LDAP if the result is a list, it is an LDAP referral

* - change to config.yaml parameter option for enabling/disabling LDAP
  referral lookups
- removed the per/method parameter and moved the referral into the Base
  class

- verified behavior with changing the config.yaml option
  `LDAP_FOLLOW_REFERRALS`

    ```
    $ grep LDAP_FOLLOW_REFERRALS config.yaml
    LDAP_FOLLOW_REFERRALS: 0

    $ ./update_bundle
    secret "quay-config-secret" deleted
    secret/quay-config-secret created
    deployment.apps/quay restarted

    $ oc -n quay logs -f deploy/quay | grep referrals
    gunicorn-web stdout | 2023-05-25 09:41:36,524 [74] [DEBUG] [data.users] LDAPUsers return referrals value 0
    gunicorn-secscan stdout | 2023-05-25 09:41:38,093 [73] [DEBUG] [data.users] LDAPUsers return referrals value 0
    gunicorn-registry stdout | 2023-05-25 09:41:38,410 [72] [DEBUG] [data.users] LDAPUsers return referrals value 0

    $ sed -i -e " s#LDAP_FOLLOW_REFERRALS: 0#LDAP_FOLLOW_REFERRALS: 1#; " config.yaml
    $ grep LDAP_FOLLOW_REFERRALS config.yaml
    LDAP_FOLLOW_REFERRALS: 1

    $ ./update_bundle
    secret "quay-config-secret" deleted
    secret/quay-config-secret created
    deployment.apps/quay restarted

    $ oc -n quay logs -f deploy/quay  | grep referrals
    gunicorn-secscan stdout | 2023-05-25 09:42:22,466 [72] [DEBUG] [data.users] LDAPUsers return referrals value 1
    gunicorn-web stdout | 2023-05-25 09:42:22,496 [73] [DEBUG] [data.users] LDAPUsers return referrals value 1
    gunicorn-registry stdout | 2023-05-25 09:42:23,658 [71] [DEBUG] [data.users] LDAPUsers return referrals value 1
    ```

* reformatted LDAPConnectionBulder call according to PEP

* fixed the formatting change according to pip black

* BREAKING CHANGE: LDAP lookup of robot accounts in the UI for granting
                 permission has been dropped. This impacts Users from LDAP
                 if they have not logged in already (pre provisioning).

the functions:

* _ldap_single_user_search
* _ldap_user_search

have been updated to provide `context` for dropping the LDAP query. As
the functions are used during login as well as during setting
permissions it is mandatory to be able to distinguish the context.

the functions:

* get_nonrobot_user
* find_user_by_email

from the module `data.model.user` have been utilized to identify, if the
user should be looked up in LDAP or not.

* Adding keepalive setting for LDAP connection in complex network
scenarios.

* removed PROJQUAY-5137 (part one) to simplify merging and rollback
-> Revert "BREAKING CHANGE: LDAP lookup of robot accounts in the UI for granting"

This reverts commit 8765093d73.

* fixed black
2023-10-17 17:36:24 +02:00
Brandon Caton
e8a6552cd0 autoprune: updating task status to running (PROJQUAY-6213) (#2413)
updating task status to running
2023-10-17 10:13:05 -04:00
Brandon Caton
fa8aaa328f autoprune: background worker (PROJQUAY-6095) (#2402)
Implementation of the background worker for namespace auto-pruning.

Co-authored-by: Sunanda Dadi <Sunandadadi@users.noreply.github.com>
2023-10-16 16:45:20 -04:00
Marcus Kok
dd96025ff5 user: Support custom LDAP memberOf attribute (PROJQUAY-5928) (#2406)
* user: Support custom LDAP memberOf attribute (PROJQUAY-3235)
* rebase of [PR 1120](https://github.com/quay/quay/pull/1120)

---------

Co-authored-by: Marius Bakke <marius.bakke@usit.uio.no>
2023-10-16 09:33:30 -04:00
Brandon Caton
22c4bbfee5 autoprune: add auto-prune policy endpoints (PROJQUAY-6096) (#2393)
Add's the endpoints to create, update, delete, get, and list organization and user auto-prune policies.
2023-10-10 16:38:46 -04:00
Brandon Caton
0e496b46a5 autoprune: add initial setup for the autoprune feature (PROJQUAY-6094) (#2277)
Adds the auto-prune worker, database models, and feature flag.
2023-10-05 13:37:36 -04:00
Brandon Caton
2a672551fc quota: prevent tag creation on rejected manifest (PROJQUAY-3906) (#2247)
Currently if a new manifest is created that re-uses blobs already existing in the registry but not within the namespace it's possible for that manifest to be blocked if the newly referenced blobs exceed the quota limit. The issue being that the rejection only happens after the manifest has been created and tagged. This change blocks the manifest upload before the creation of the tag and prevents that tag from appearing in the UI and being pullable.

If the manifest upload get's rejected before the tag has been created for a new manifest, a temporary tag is created outside the time machine window so it is immediately available for GC.
2023-10-03 10:30:27 -04:00
Oleg Bulatov
5dbdd37838 chore: add tests for blobupload (#2216) 2023-10-02 11:39:43 -04:00
Brandon Caton
9a9355e5f2 quota: adding indexes to the quota size tables (PROJQUAY-6048) (#2268)
Adding indexes to the quotanamespacesize and quotarepositorysize tables.
2023-10-02 09:09:35 -04:00
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
Michaela Lang
67028af9e2 user(robots): disallow robot login and create (PROJQUAY-5968) (#2155)
* add Postgresql client certificate authentication option

* user(robots): disallow robot login and create PROJQUAY-5968

Add a config flag `ROBOTS_DISALLOW` to turn off Robot login and creation
in Quay for all accounts.

with the Flag set existing Robots cannot login anymore
```
$ podman login -u milang+test2 -p W7B...HQA quay.example.com
Error: logging into "quay.example.com": invalid username/password
```

This behavior will be reported in the logs accordingly
```
gunicorn-registry stdout | 2023-08-24 19:08:01,907 [253] [WARNING] [auth.credentials] Failed to validate credentials for robot milang+test2: Robot account has been disabled. Please contact your administrator.
```

as well as in the UI when creating a Robot Account which will display
the `Robot account has been disabled. Please contact your
administrator.` message.

* Revert "add Postgresql client certificate authentication option"
  need to branch for PR (stupid me)

This reverts commit f8f54eead2.

* fixed error message to proper english and added schema definition for the option
2023-09-20 13:07:41 +02:00
Kenny Lee Sin Cheong
72f7c64ed6 chore: update werkzeug and related package versions (PROJQUAY-5098) (#1982)
* chore: update werkzeug and related package versions (PROJQUAY-5098)

Path converter related change reference: https://github.com/pallets/werkzeug/issues/2506

* Update query count
2023-09-12 11:51:09 -04:00
Marcus Kok
e44783fe19 billing: Assign SKU to org (PROJQUAY-5363) (#1989)
* add migration for orgrhskus table

* add endpoints for managing and listing skus bound to an org

* create checks in billing flow to look for org-bound skus

* refactor RH marketplace api objects to be more usable in tests

* update cypress test db data and exclude it from pre-commit hook formatting
2023-08-25 14:52:54 -04: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
Joseph Crosland
93086fa588 secscan: update error from secscan delete (PROJQUAY-0000) (#2077)
Currently the error message doesn't align with the operation.

Signed-off-by: crozzy <joseph.crosland@gmail.com>
2023-08-09 13:18:58 +02:00
Sunandadadi
a095e1f938 api: Adding ignore timezone flag when parsing datetime (PROJQUAY-5360) (#2027)
* api: Removing parsing of datetime (PROJQUAY-5360)

* added ignoretz flag to date util parser

* added removed extra line
2023-07-31 16:39:53 -04:00
Oleg Bulatov
7a487644e1 chore: use isinstance to check instance type (#2068) 2023-07-31 15:15:25 +00:00
Hank Donnay
50224e2dd1 secscan_model: attempt urldecoding fixed_in_version (PROJQUAY-5886) (#2060)
In Clair 4.7, an API field documented to have version information in no
particular format may URL encode it. This change attempts to decode and
read a known field that contains the "fixed" version. If that fails, the
value will be passed through, as it is now.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
2023-07-26 10:03:35 -05:00
Brandon Caton
c8bc48e326 ui: adding create tag option and generic alerts (PROJQUAY-5290) (#1996)
Adds tag options dropdown and the create tag option. Also adds generic alerts through the useAlerts hook.
2023-07-20 15:04:07 -04:00
Sunandadadi
f56382eeb9 Pagination: Fixing paginate for /api/v1/superuser/logs API (#2006)
* Pagination: Fixing paginate for /api/v1/superuser/logs API

* using offset to fetch next page items

* adding datetime parsing

* using black to format code

* removing use_offset

* Removing redundant declaration
2023-07-11 10:46:47 -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
Kenny Lee Sin Cheong
d47cea46fa database: remove foreign key constraints from deprecated tables (PROJQUAY-4879) (#1348)
* database: remove foreign key constraints from deprecated tables (PROJQUAY-4879)

* database: remove deprecated model tests (PROJQUAY-4879)
2023-06-28 09:37:07 -04:00
Oleg Bulatov
ea49bb53a3 chore: Bump mypy (#1962) 2023-06-28 13:47:32 +02:00
Marcus Kok
e622414280 config: Enable notifications for new indexes by default (PROJQUAY-5682) (#1993)
* config: Set feature flag default for new vulnerability notifications to True
(PROJQUAY-4659)

Change the default from `False` to `True` for
`FEATURE_SECURITY_SCANNING_NOTIFY_ON_NEW_INDEX`.

Since this flag addresses a bug, it should be enabled by default.

* add mock return values for unit tests
2023-06-27 16:01:43 +02:00
Syed Ahmed
2371c4d605 api: allow robot token creation with a pre-defined token (PROJQUAY-5414) (#1972)
* api: allow robot token creation with a pre-defined token (PROJQUAY-5414)

This is for usecases where we want to explicitly create a robot token
with a pre-defined token in case of migration events when we migrate
from one quay to another, we can re-use the same robot token to
avoid resetting it in all places it is used
2023-06-23 15:53:30 -04:00
Brandon Caton
65c1829b82 ui: displaying quota totals on user namespaces (PROJQUAY-5581) (#1953)
User namespaces can now view the quota total.
2023-06-21 09:09:16 -04:00
Daniel Messer
e1e8dc8efb audit: ignore errors due to read-only mode in audit logs (PROJQUAY-5598) (#1928)
* ignore errors due to read-only mode in audit logs

Signed-off-by: dmesser <dmesser@redhat.com>

* remove superfluous ReadOnlyMode handling

Signed-off-by: dmesser <dmesser@redhat.com>

* add debug log messae

Signed-off-by: dmesser <dmesser@redhat.com>

---------

Signed-off-by: dmesser <dmesser@redhat.com>
2023-06-16 12:08:27 +02:00
Kenny Lee Sin Cheong
d48df9b251 chore: deprecate image table support (PROJQUAY-522) (#1841)
Remove code related to deprecated image table
2023-06-14 10:54:54 -04:00
Harish Govindarajulu
3fd695cf86 logs: Add autologin to splunk's connect() to allow retries (PROJQUAY-5621) (#1956)
Signed-off-by: harishsurf <hgovinda@redhat.com>
2023-06-08 13:29:35 -04:00
Marcus Kok
ff68f86c90 data: Fix error getting tag while calculating scan results SLO (#1952)
(PROJQUAY-5600)

Catch exception thrown when looking up tag `lifetime_start_ms` and set
`created_at` property for a manifest to None.

If `created_at` is None, don't calculate indexing SLI for manifest.
2023-06-07 16:24:22 -04:00
Daniel Messer
fbc4d7800d change removed_tag_expiration_s to bigint (#1929)
Signed-off-by: dmesser <dmesser@redhat.com>
2023-06-05 11:03:17 +02:00
Michaela Lang
7ecf97b9fc authentication(LDAP): allow LDAP referrals to not be followed (PROJQUAY-5291) (#1905) 2023-06-02 19:32:18 +02:00
Brandon Caton
e38d70f0cb api: add permanently delete tag usage log (PROJQUAY-5496) (#1887)
Now logging the permanently delete tag as a usage log.
2023-06-02 10:43:14 -04:00
Oleg Bulatov
f5be32d840 logs: ssl_ca_path should be optional (PROJQUAY-4993) (#1913) 2023-06-02 13:42:27 +02:00
Brandon Caton
ba29a40b80 proxy: allowing expiring tags with timemachine set to 0 (PROJQUAY-5558) (#1907)
Adds the following changes:
- Allows remove_tag_from_timemachine to expire tags even if the time machine window is set to 0, immediately marking them for deletion. This allows the quota proxy pruner to expire tags with the same method call. This wasn't required for normal push/pulls as the user would just call the DELETE /tag endpoint.
- Remove hidden = true when expiring tags. For proxy Quay will attempt to lookup the tag referenced by the manifest in order to extend it's lifetime_end_ms. Hiding this tag prevents that logic from running correctly.
2023-05-26 15:04:06 -04:00
Marcus Kok
b911d480cf api: allow manifests to be pulled by digest (PROJQUAY-5467) (#1877)
Add new parameter `allow_hidden` to `lookup_manifest_by_digest` method and set this to true on the manifest v2 endpoint.

Enables manifests to be pulled by digest, and fixes issues with recent versions of conftest being unable to push to quay.
2023-05-26 09:43:27 -04:00
Brandon Caton
6cf0a3531b quota: calculating registry size (PROJQUAY-5476) (#1879)
Allows superusers to trigger a calculation of the deduplicated registry size. A superuser can go to the organization panel of the superuser page and select Calculate to queue a calculation of the registry total. The total will only be calculated when requested. Includes warning to user of increase of database load when running calculation.
2023-05-24 17:10:40 -04:00
Brandon Caton
cf50901159 quota: moving resetting of child manifest temporary tags to delete endpoint (PROJQUAY-5512) (#1894)
Moves the resetting of child manifest temporary tags to happen on deletion instead of on push/pull. Resetting child manifest temporary tags caused issues in other portions of the code like proxy cache where temporary tags were deleted too early.
2023-05-23 09:05:32 -04:00
Harish Govindarajulu
490a6b2ce8 logs: Add SSL cert support and test coverage for splunk logging (PROJQUAY-4993) (#1878)
Signed-off-by: harishsurf <hgovinda@redhat.com>
2023-05-19 16:24:13 -04:00