Bound the number and length of payload.egress_allowlist entries
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 66/100
Research direction
Start with server/orcaster_server/env_names.py, especially validate_payload_egress_allowlist and the existing task_env limits; then trace the listed task, control-op and worker command routes. Check the related tests and document the limits in docs/operator-manual.md and the Unreleased changelog. Done when the specified boundaries and error details are covered, existing stored tasks still poll, and the routes and docs meet the acceptance criteria.
Written by the indexing model from the issue text.
Description
Problem
payload.task_env has limits: at most TASK_ENV_MAX_ENTRIES (256) entries and TASK_ENV_NAME_MAX_LEN (128) characters per entry (server/orcaster_server/env_names.py:22-23, :183-184).
payload.egress_allowlist has no limits. validate_payload_egress_allowlist only checks that the value is a list of strings (server/orcaster_server/env_names.py:228-248). It runs on the same routes as the task_env check: creating and forking a task (server/orcaster_server/schemas/tasks.py:331, in AdminCreateTaskRequest), the control-op route (server/orcaster_server/schemas/tasks.py:582, in AdminControlOpRequest) and the worker command route (server/orcaster_server/api/admin_workers.py:174).
So a client can store a task with a very large list or very long entries. The server stores and signs it, and every worker that claims the task must parse it and write it into its egress allow file.
Proposed change
- Add two constants next to the
task_envones inserver/orcaster_server/env_names.py:EGRESS_ALLOWLIST_MAX_ENTRIES, for example 256.EGRESS_ALLOWLIST_ENTRY_MAX_LEN, for example 255 (a 253-character DNS name plus a*.wildcard prefix).
- In
validate_payload_egress_allowlist, after the shape check, reject a list with more entries than the maximum, and any entry longer than the maximum. The error names the field, the index and the limit, never the full value. FastAPI turns theValueErrorinto a 422, as fortask_env. - Keep the check at write time only. Rows already stored are still served and run, as the docstring already says for the shape check.
- Document both limits in
docs/operator-manual.md, next to theegress_allowlistfield (docs/operator-manual.md:138).
Compatibility
This is a contract change on the task creation routes: a request with a list above a limit now gets 422 instead of being stored.
Guard:
- The limits are far above any realistic allowlist, so existing clients and workloads keep working unchanged. Choose the final values with that in mind, and do not go below the examples above.
- Tasks already stored are not re-validated. They are still delivered and run, and the worker is unchanged.
- Forking an old task whose list is above a limit fails with 422 and a clear message. This is the only new failure for existing data.
- The release note states the new limits.
Acceptance criteria
- Test: a list with exactly the maximum number of entries is accepted. One more entry returns 422 on task create, on fork, and on the worker command and control-op routes.
- Test: an entry of exactly the maximum length is accepted. One more character returns 422.
- Test: the 422 detail names
payload.egress_allowlist, the index and the limit, and does not echo the whole entry. - Test: an existing task row with a larger list is still delivered to a worker by the poll.
-
[](strict mode) and an absent field still behave as today. - Existing clients that send allowlists below the limits keep working without changes.
- The limits are documented in
docs/operator-manual.md. - CHANGELOG entry under Unreleased, marked as an API contract change.
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AInvirion/orcaster
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day
-
enhancement good first issue P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug P2 server
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
bug P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
enhancement P3 server
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
All issues in AInvirion/orcaster
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
daniel-ospina/tortoise#15308 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
difficulty:easy prio:low type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NatronGitHub/Natron#2405 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Jstar269/nakagawa-recomp#3746 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day