1
0
mirror of https://github.com/quay/quay.git synced 2025-04-18 10:44:06 +03:00

113 Commits

Author SHA1 Message Date
Sunandadadi
0e002a4e09
modelcard: Setting model card feature to false by default (#3744)
modelcard: Setting model card feature to false on quay.io
2025-03-27 10:05:19 -04:00
Kenny Lee Sin Cheong
5f8ca041e7
ui: implement change to render modelcard stored in layers (PROJQUAY-8642) (#3692)
* ui: implement change to render modelcard stored in layers (PROJQUAY-8412)

When a manifest has certain annotations or artifactTypes, render the
applicable modelcard markdown in a new tags detail tab.

* removing untar when fetching model card

* removing extra api calls

* Add modelcar check tests

---------

Co-authored-by: bcaton <bcaton@redhat.com>
2025-03-05 19:14:22 +00:00
Ivan Bazulic
4c5b2d50c5
ui: Expand support for customized footer links (PROJQUAY-5648) (#3556)
* ui: Expand support for customized footer links (PROJQUAY-5648)
Previous iteration only allowed changes to the terms of service. With this push, all footer links should be customizable through the `FOOTER_LINKS` object. Example:

~~~
FOOTER_LINKS:
  TERMS_OF_SERVICE_URL: "some_url"
  PRIVACY_POLICY_URL: "some_url"
  SECURITY_URL: "some_url"
  ABOUT_URL: "some_url"
~~~

Missing entries will not be printed out in the UI.

* Fixes to parsing of config object

* Add type annotation
2025-02-07 10:07:55 -05:00
Marcus Kok
4bd036b6c5
storage: add namespace filter to direct download responses (PROJQUAY-8147) (#3363)
* add namespace filter to direct download responses
2024-10-28 13:09:54 -04:00
Syed Ahmed
78e9a3b6b8
nginx: revert #3098 (PROJQUAY-7573) (#3129)
reverting this change because we won't use keepalive with gunicorn workers
2024-08-09 16:36:08 -04:00
Ivan Bazulic
62e42f8f54
storage: Disable pushes on registry (PROJQUAY-6870) (#2755)
* storage: Disable pushes on registry (PROJQUAY-6870)

The current read-only option for Quay is not sometimes feasible, since it requires an insert of the service key and other manual config changes. For instance, if you want to just recalculate quota on the registry, but would like to allow all registry operations (including UI) without the possibility of pushes until recalculation is done, setting the whole registry `read-only` cannot be done since it makes the database read only as well.

This PR introduces a new flag called `DISABLE_PUSHES` which allows all registry operations to continue (changing tags, repo editing, robot account creation/deletion, user creation etc.) but will disable pushes of new images to the registry (i.e. backend storage will not change). If a registry already contains the image and a new tag is simply being added, that operation should succeed.

The following message would appear in the logs:

~~~
gunicorn-registry stdout | 2024-03-13 20:19:49,414 [369] [DEBUG] [endpoints.v2] sending response: b'{"errors":[{"code":"METHOD NOT ALLOWED","detail":{},"message":"Pushes to the registry are currently disabled. Please contact the administrator for more information."}]}\n'
gunicorn-registry stdout | 2024-03-13 20:19:49,414 [369] [INFO] [gunicorn.access] 172.17.0.1 - - [13/Mar/2024:20:19:49 +0000] "PUT /v2/ibazulic/mariadb/manifests/sha256:c4694ba424e0259694a5117bbb510d67340051f0bdb7f9fa8033941a2d66e53e HTTP/1.1" 405 169 "-" "skopeo/1.9.3"
nginx stdout | 172.17.0.1 (-) - - [13/Mar/2024:20:19:49 +0000] "PUT /v2/ibazulic/mariadb/manifests/sha256:c4694ba424e0259694a5117bbb510d67340051f0bdb7f9fa8033941a2d66e53e HTTP/1.1" 405 169 "-" "skopeo/1.9.3" (0.002 3813 0.002)
~~~

The flag defaults to `False` (pushes enabled), unless set otherwise.

* Removed constraint on storage replication when pushes are disabled

* Rebase

* Fix isort sorting

* Fix isort sorting #2

* Removed constraint on storage replication when pushes are disabled

* Rebase

* Remove constraint on storage replication worker

* Fix linting on config.py
2024-08-07 15:40:10 -04:00
Sunandadadi
912ce8c814
nginx: increasing keepalive timeout for manifests endpoint (PROJQUAY-7573) (#3098)
* nginx: increasing keepalive timeout for manifests endpoint (PROJQUAY-7573)

* nginx: increasing keepalive timeout for manifests endpoint (PROJQUAY-7573)

* fixing datatype

* changing MANIFESTS_ENDPOINT_KEEPALIVE_TIMEOUT to 60s

* add config param in schema

* fix formating

* set default to 0
2024-08-01 15:39:44 -04:00
Kenny Lee Sin Cheong
edf159007e
config: enable the referrers api by default (PROJQUAY-7499) (#3048) 2024-07-18 15:16:07 +00:00
Brandon Caton
854046d904
ui: adding message that registry wide autoprune has been enabled (PROJQUAY-7452) (#3042)
adding message that registry wide autoprune has been enabled
2024-07-17 13:55:56 -04:00
Sunandadadi
13f6cd590c
featureflag: add feature flag for image expiry trigger (PROJQUAY-7460) (#3007)
* feature flag: add feature flag for image expiry trigger (PROJQUAY-7460)

* add FEATURE_IMAGE_EXPIRY_TRIGGER to CLIENT_WHITELIST

* minor fix

* setting IMAGE_EXPIRY_TRIGGER to true for testing

* fixing config.json
2024-07-08 17:43:14 -04:00
Brandon Caton
7ef664a646
autoprune: Registry level autopruning (PROJQUAY-7392) (#2950)
Allows for adding a default autopruning policy that will be applied to all namespaces.
2024-06-26 16:43:31 -04:00
Brandon Caton
e4f05583c1
oauth: allowing to assign token to user (PROJQUAY-7074) (#2869)
Allow organization administrators to assign Oauth token to another user.
2024-06-25 09:23:51 -04:00
Daniel Messer
a5ab170773
cache: handle cache value size limit in memcached (PROJQUAY-7239) (#2914)
* handle cache value size limit in memcached
* only print cache value for redis in debug logs on redis errors

---------

Signed-off-by: dmesser <dmesser@redhat.com>
2024-06-24 10:26:53 +02:00
Daniel Messer
99d571a4a6
logs: allow without strict logging (PROJQUAY-7116) (#2846)
* allow to disable strict logging in general

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

* add strict logging exceptions for log kinds during reads

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

* add strict logging exceptions for log kinds during reads

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

* formatting

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

---------

Signed-off-by: dmesser <dmesser@redhat.com>
2024-06-17 21:17:39 +02:00
Ivan Bazulic
6392ca972a
secscan: Fix Slack notification creation on initial index (PROJQUAY-7037) (#2923)
* secscan: Fix Slack notification creation on initial index (PROJQUAY-7037)
This fixes the Slack and e-mail notifications when images are indexed on initial push, where `tags` information was missing. If an image is a manifest child, instead of the tag, we provide a full SHA digest to the client.
Also adds the ability to filter security vulnerabilites depending on their severity. If the `NOTIFICATION_MIN_SEVERITY_ON_NEW_INDEX` is not set in the `config.yaml` file, we will automatically create notifications only for vulnerabilities marked "high" or "critical". This variable can take values defined here:

3248a72da6/util/secscan/__init__.py (L1)

Example:

```
NOTIFICATION_MIN_SEVERITY_ON_NEW_INDEX: Medium
```

* Removed superfulous debug statements

* Add default to config.yaml, remove extra comment

* Fix isort sorting

* Update vulnerability_found.html

* Update vulnerability_found.html

* Isort formatting fix

* Update vulnerability_found.html
2024-06-12 09:51:11 -04:00
Kenny Lee Sin Cheong
4546163e83
registry: implements the OCI 1.1 referrers API (PROJQUAY-7280) (#2597)
* registry: implements the OCI 1.1 referrers API

Migrations:
- Adds a subject column for lookup
- Adds a subject_backfilled column to track status of the backfilling
of existing manifests
- Adds a manifest_json column making use of postgres' JSONB support,
for future use.

Manifestsubjectbackfillworker: Indexes existing manifests for possible
existing subject field.

* Deprecate IGNORE_UNKNOWN_MEDIATYPES

* Cleanup
2024-06-07 13:28:13 -04:00
Brandon Caton
0de7f6f5de
quota: adding VERIFY_QUOTA config option (PROJQUAY-6945) (#2798)
Adding VERIFY_QUOTA config option.
2024-03-28 09:44:53 -04:00
Brandon Caton
d2a1fedab4
quota: refactor, tests, and optimizations (PROJQUAY-6735) (#2712)
Adds the following changes:
- Additional logging
- Moving checks before expensive DB calls
- Additional tests
2024-03-06 09:06:38 -05:00
Brandon Caton
4f0db4b90f
quota: feature flagging quota edit/view/enforce (PROJQUAY-6734) (#2709)
feature flagging quota edit/view/enforce functionality
2024-03-05 13:10:18 -05:00
Brandon Caton
b641538bad
ui: removing repo settings and build UI feature flags (PROJQUAY-6617) (#2680)
Removing repo settings and build UI feature flags since they should be enabled by default.
2024-02-19 09:19:10 -05:00
Kenny Lee Sin Cheong
e91b9e4543
registry: allow pushing manifests with artifactType and subject fields (PROJQUAY-6673) (#2659)
Allow manifests to be pushed with a artifactType and subject fields.
2024-02-12 13:32:43 -05:00
Daniel Messer
e8ff33e728
logs: add failure logging for login, push, pull and delete events (PROJQUAY-5411) (#1903)
* add login failure logging

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

* move failure logging into credential validation

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

* more precise tracking of affected users

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

* fix indent

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

* differentiate robots with wrong credentials

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

* don't audit failures by default

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

* discrete failure tracking for logins, push, pulls and deletes

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

* refine log metadata

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

* login failure log visualization

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

* properly use data model

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

* fix unit test bug

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

* track non-existing repos differently

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

* log view visualization of failed pushes and pulls

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

* ensure all tests are conducted with failure logging

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

* additional unicode protection

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

* python black formatting

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

* add cypress test data

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

* add safety checks for ascii conversion attempts

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

* adjusting unit test with correct error message

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

* update to alembic head

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

* add standard oauth token metadata in audit

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

* update alembic head

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

* correct field name

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

* formatting

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

* bump alembic head

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

* refactor auth logging imports

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

* bump alembic head

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

* formatting

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

* restore module

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

* pre-commit fixes

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

* adding missing default

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

* bump alembic head

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

* update test data

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

* refactoring to save db calls

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

* fix unit tests

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

* handle unicode conversion errors on email look up

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

* bump alembic head

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

* proper debug logging and conditional db calls

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

* omit wildcard import

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

* re-add import

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

---------

Signed-off-by: dmesser <dmesser@redhat.com>
2024-01-16 16:46:20 +01:00
Brandon Caton
ac221a601d
ui: implementing build history page (PROJQUAY-6293) (#2523)
implementing build history page
2023-12-13 16:03:04 -05:00
Michaela Lang
0dfa72d036
user(robots): disallow robot login and create 2nd (PROJQUAY-5968) (#2483)
* Fixed typo, added ROBOTS_WHITELIST as without the ROBOTS_DISALLOW does not make sense

* added ROBOTS_WHITELIST default to config.py
2023-12-05 17:31:08 +01:00
Oleg Bulatov
1fa6ed5dfd
secscan: enable gc for manifests by default (PROJQUAY-4126) (#2485) 2023-11-14 19:06:12 +00:00
Syed Ahmed
27f1699b72
ui: Add delay after write operations (PROJQUAY-6146) (#2400)
This is useful for cases where reads and writes are
going to different DBs and there is a replication lag
between them
2023-10-12 12:45:16 -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
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
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
Ivan Bazulic
d7864ed4ee
ui: Add custom TOS support (PROJQUAY-5648) (#1973)
* ui: Add custom TOS support
Enable adding of a custom TOS in the Quay footer for on-premise installations via the optional `TERMS_OF_SERVICE` config flag.
If the flag is not defined, the TOS field will not be visible on Quay rendering. Also changes the behaviour of the discovery endpoint to include custom terms of service instead of pointing to Quay.io terms of service for all installations.

* Fix formatting errors

* Fix TOS page for Quay.io deployments

* Change TOS variable name to TERMS_OF_SERVICE_URL for better clarity

* Removed reference to Quay.io from the discovery endpoint description
2023-06-19 11:44:52 -04:00
Sunandadadi
230fd24f3d
Util: Reading new UI feedback form url from config parameter (PROJQUAY-5463) (#1902)
* Util: Reading feedback form url from config parameter (PROJQUAY-5463)

* updating form link for quay plugin
2023-05-24 10:43:25 -04:00
Brandon Caton
9a7239e874
config: updating quota defaults (PROJQUAY-5546) (#1901)
Updating the options introduced by quota.
QUOTA_TOTAL_DELAY_SECONDS: increasing to accommodate most deployments
QUOTA_BACKFILL: Should run when quota is enabled to prevent having to do two deployments
RESET_CHILD_MANIFEST_EXPIRATION: New option should be opt in
PERMANENTLY_DELETE_TAGS: New option should be opt-in
2023-05-23 16:43:30 -04:00
Daniel Messer
41cd8330d0
logs: add audit log events for login/logout to Quay (PROJQUAY-2344) (#1866)
* add auditing of login and logout events

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

* python black formatting

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

* correctly identify username during

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

* revert change to existing code

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

* remove superfluous ip tracking

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

* beautify login messages

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

* remove unused import

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

* move alembic patch to head

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

* correctly log target namespace for robots

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

* python black formatting

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

* login event detection refinement

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

* add missing visualization

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

* enrich login event data

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

* make login auditing configurable

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

* make update-testdata

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

---------

Signed-off-by: dmesser <dmesser@redhat.com>
2023-05-17 11:22:35 +02:00
Brandon Caton
e6f2dc3354
quota: excluding robots from quota total (PROJQUAY-5469) (#1871)
Adding quotatotalworker to config services / excluding robots from quota total
2023-05-10 14:54:57 -04:00
Marcus Kok
0a1c7fb22e
marketplace: add reconciler (PROJQUAY-5320) (#1817)
marketplace: add reconciler (PROJQUAY-5320)
* check RH marketplace after stripe for private repo creation / changing visibility
* add reconciliation worker that creates RH subscriptions in marketplace for pre-existing stripe customers
2023-05-08 09:48:17 -04:00
Brandon Caton
a2c379d47c
quota: Include blob deduplication in totals (PROJQUAY-3942) (#1751)
Allows for only unique blobs are counted at the namespace and repository level. Calculation includes manifest list sizes.
Add's the following internal configurations that default to true:
QUOTA_INVALIDATE_TOTALS: Invalidates calculated totals when FEATURE_QUOTA_MANAGEMENT is set to false
RESET_CHILD_MANIFEST_EXPIRATION: Resets the expiry for child manifests on push of the manifest list for immediate GC eligibility
PERMANENTLY_DELETE_TAGS: Enables features related to the permanent deletion of tags outside the configured time machine window
2023-05-01 16:40:01 -04:00
Marcus Kok
c3fc3a82ab
secscan: send notifications for new indexes (PROJQUAY-4659) (#1813)
On new pushes, allow notifications being sent to user if vulnerabilities are found.
2023-03-29 13:17:52 -04:00
Ivan Bazulic
ff66a93eb7
repomirror: Add default value for REPO_MIRROR_ROLLBACKto config (PROJQUAY-4296) (#1786)
We forgot to add the default value to `config.py` when we enabled this change. This PR adds the default value along with the flag description.
2023-03-14 14:50:49 -04:00
Daniel Messer
34a6e5fea8
config: clean upload folder by default (PROJQUAY-4395) (#1731)
If quay doesn't clean up temporary files under `uploads` folder by default, that means it is very possible for customer to pay more money for storage usage.  A lot of  important customers are money-sensitive,  so it doesn't make sense to set CLEAN_BLOB_UPLOAD_FOLDER as false by default.
2023-02-02 16:43:43 +01:00
Kenny Lee Sin Cheong
80fdb92462
secscan: add config to limit manifests with layer size too large to index (PROJQUAY-4957) (#1733)
Also removes deprecated Clair v2 configs.
2023-01-31 15:50:16 -05:00
Kenny Lee Sin Cheong
6e8e2d2fe7
chore: remove deprecated appr code (PROJQUAY-4992) (#1718) 2023-01-24 10:11:04 +01:00
Brandon Caton
b8cf8932cf
ui: Repository settings feature flag (PROJQUAY-4565) (#1677)
Adds feature flag to restrict the repository settings feature.
2022-12-15 16:26:44 -05:00
Kenny Lee Sin Cheong
b128936b50
users: fix behavior when using ldap and restricted user whitelist is set (PROJQUAY-4767) (#1640) 2022-11-23 15:22:15 -05:00
Kenny Lee Sin Cheong
c84067a4d6
users: add restricted users' filter (PROJQUAY-1245) (#1551)
- Similar to LDAP_SUPERUSER_FILTER, add a specific filter to define
restricted users, based on the LDAP_USER_FILTER
- restrict writes on restricted users' own namespace. Normal
permissions applies on organization membership
- add global readonly superuser GLOBAL_READONLY_SUPER_USERS (PROJQUAY-2604)
- Removes RESTRICTED_USER_INCLUDE_ROBOTS, FEATURE_RESTRICTED_READ_ONLY_USERS
2022-10-28 13:38:37 -04:00
Brandon Caton
6bbfdf5e78
config: Remove whitespace from config (PROJQUAY-4666) (#1596)
White space in the mediatype config is preventing conftest policies containing data from being pushed.
2022-10-27 11:18:26 -04:00
Marcus Kok
ff8043dd85
config: Add conftest mediatypes to default Quay configuration (PROJQUAY-4614) (#1567)
Allow conftest policies to be stored on Quay

Co-authored-by: Marcus Kok <mkok@redhat.com>
2022-10-14 15:47:47 -04:00
Sunandadadi
4ebad4dcd8
Config: Updating Cosign SBOM Media Types on Quay (PROJQUAY-4591) (#1554)
* Config: Updating Cosign SBOM Media Types on Quay

* Added Layer types for SBOM and mime types for hacbs

* Minor ordering

* Adding syft mime type

* Removing mimetypes for HACBS
2022-10-11 14:59:13 -04:00
Kenny Lee Sin Cheong
2b3c3cc584
api: feature to limit org creation to superusers (PROJQUAY-1245) (#1516)
* api: feature to limit org creation to superusers

Introduces the following configuration flags:

FEATURE_SUPERUSERS_ORG_CREATION_ONLY:
    Limit org creation to superusers only

FEATURE_SUPERUSERS_FULL_ACCESS:
    Grant superusers read/write access to registry content in all namespaces

FEATURE_RESTRICTED_USERS:
    Users considered as restricted are not anle to create organization

RESTRICTED_USERS_WHITELIST:
    Whitelist for FEATURE_RESTRICTED_USERS

RESTRICTED_USER_INCLUDE_ROBOTS:
    Whether or not to include the user namespace's robots

RESTRICTED_USER_READ_ONLY:
    Only allow read-only operations for restricted users

* Revert superuser repositorylist endpoint
2022-09-23 09:41:23 -04:00
Sunandadadi
5f1fdbc59f
ui: Support on Old UI to switch to New UI (PROJQUAY-4124) (#1504)
* Support on Old UI to switch to New UI
2022-08-31 10:33:53 -04:00
Harish Govindarajulu
1c8f5df6e2
Add Feature flag to whitelist users from recaptcha check(PROJQUAY-3697) (#1454)
Signed-off-by: harishsurf <hgovinda@redhat.com>
2022-07-22 16:18:45 -04:00