Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

job-list: limit size of job constraint #5669

Closed
chu11 opened this issue Jan 9, 2024 · 0 comments · Fixed by #5681
Closed

job-list: limit size of job constraint #5669

chu11 opened this issue Jan 9, 2024 · 0 comments · Fixed by #5681
Assignees

Comments

@chu11
Copy link
Member

chu11 commented Jan 9, 2024

As @grondo notes in #5656, "very large" constraints might have the ability to hang (or minimally slow down) the job-list service.

We may wish to put a limit on the size of job constraints to limit this.

Without thinking about this that much, perhaps a cap on the length of an operator array might be worthwhile. 32 or 64? i.e.

{ "and": [ { "userid": [ ... ]}, { "name": [ ...] }, ... ] }`

If we say there's a cap of 32, the max length of the values array for "and" would be 32, and the max of "userid" and "name" would also be 32.

Also we'd probably need a "recursive" limit too, without thinking about it much ... 8 or 16?

@chu11 chu11 self-assigned this Jan 11, 2024
chu11 added a commit to chu11/flux-core that referenced this issue Jan 13, 2024
Problem: Job-list constraints are not limited in their size.  A nefarious
user could cause a DoS of the job-list service by sending an extremely
large constraint request.

Solution: Set a reasonable max on constraint sizes.  The maximum length
a constraint array can be is 256 elements and the maximum recursive depth
(via and/or/not operators) is set to 16.

Add unit tests.

Fixes flux-framework#5669
chu11 added a commit to chu11/flux-core that referenced this issue Jan 13, 2024
Problem: Job-list constraints are not limited in their size.  A nefarious
user could cause a DoS of the job-list service by sending an extremely
large constraint request.

Solution: Set a reasonable max on constraint sizes.  The maximum length
a constraint array can be is 256 elements and the maximum recursive depth
(via and/or/not operators) is set to 16.

Add unit tests.

Fixes flux-framework#5669
chu11 added a commit to chu11/flux-core that referenced this issue Feb 1, 2024
Problem: Currently the max number of comparisons that can be
done in a job-list constraint match is hard coded to 100 thousand.
There may be circumstances where we'd like that number to be higher
or lower.

Support configuration of this maximum via a new job-list.max_comparisons
configuration.

Fixes flux-framework#5669
chu11 added a commit to chu11/flux-core that referenced this issue Feb 2, 2024
Problem: Job-list constraints are not limited in their size.  A nefarious
user could cause a DoS of the job-list service by sending an extremely
large constraint request.

Solution: To limit constraints, introduce the concept of constraint
comparisons.  All comparison "checks", such as seeing if a job was submitted
by a specific user, are counted.  When the maximum number of comparisons is
reached, an error is returned to the user.  The user can try again by
limiting the number of jobs they are searching through, such as only
searching active vs inactive jobs or if jobs were submitted since a certain time,

For the time being, hard code the maximum number of comparisons to 100
thousand.

Fixes flux-framework#5669
chu11 added a commit to chu11/flux-core that referenced this issue Mar 20, 2024
Problem: Job-list constraints are not limited in their size.  A nefarious
user could cause a DoS of the job-list service by sending an extremely
large constraint request.

Solution: To limit constraints, introduce the concept of constraint
comparisons.  All comparison "checks", such as seeing if a job was submitted
by a specific user, are counted.  When the maximum number of comparisons is
reached, an error is returned to the user.  The user can try again by
limiting the number of jobs they are searching through, such as only
searching active vs inactive jobs or if jobs were submitted since a certain time,

For the time being, hard code the maximum number of comparisons to 100
thousand.

Fixes flux-framework#5669
chu11 added a commit to chu11/flux-core that referenced this issue Mar 20, 2024
Problem: Job-list constraints are not limited in their size.  A nefarious
user could cause a DoS of the job-list service by sending an extremely
large constraint request.

Solution: To limit constraints, introduce the concept of constraint
comparisons.  All comparison "checks", such as seeing if a job was submitted
by a specific user, are counted.  When the maximum number of comparisons is
reached, an error is returned to the user.  The user can try again by
limiting the number of jobs they are searching through, such as only
searching active vs inactive jobs or if jobs were submitted since a certain time,

For the time being, hard code the maximum number of comparisons to 100
thousand.

Fixes flux-framework#5669
chu11 added a commit to chu11/flux-core that referenced this issue Apr 8, 2024
Problem: Job-list constraints are not limited in their size.  A nefarious
user could cause a DoS of the job-list service by sending an extremely
large constraint request.

Solution: To limit constraints, introduce the concept of constraint
comparisons.  All comparison "checks", such as seeing if a job was submitted
by a specific user, are counted.  When the maximum number of comparisons is
reached, an error is returned to the user.  The user can try again by
limiting the number of jobs they are searching through, such as only
searching active vs inactive jobs or if jobs were submitted since a certain time.

For the time being, hard code the maximum number of comparisons to 100
thousand.

Fixes flux-framework#5669
chu11 added a commit to chu11/flux-core that referenced this issue Apr 8, 2024
Problem: Job-list constraints are not limited in their size.  A nefarious
user could cause a DoS of the job-list service by sending an extremely
large constraint request.

Solution: To limit constraints, introduce the concept of constraint
comparisons.  All comparison "checks", such as seeing if a job was submitted
by a specific user, are counted.  When the maximum number of comparisons is
reached, an error is returned to the user.  The user can try again by
limiting the number of jobs they are searching through, such as only
searching active vs inactive jobs or if jobs were submitted since a certain time.

For the time being, hard code the maximum number of comparisons to 100
thousand.

Fixes flux-framework#5669
chu11 added a commit to chu11/flux-core that referenced this issue Apr 17, 2024
Problem: Job-list constraints are not limited in their size.  A nefarious
user could cause a DoS of the job-list service by sending an extremely
large constraint request.

Solution: To limit constraints, introduce the concept of constraint
comparisons.  All comparison "checks", such as seeing if a job was submitted
by a specific user, are counted.  When the maximum number of comparisons is
reached, an error is returned to the user.  The user can try again by
limiting the number of jobs they are searching through, such as only
searching active vs inactive jobs or if jobs were submitted since a certain time.

For the time being, hard code the maximum number of comparisons to 100
thousand.

Fixes flux-framework#5669
chu11 added a commit to chu11/flux-core that referenced this issue Apr 18, 2024
Problem: Job-list constraints are not limited in their size.  A nefarious
user could cause a DoS of the job-list service by sending an extremely
large constraint request.

Solution: To limit constraints, introduce the concept of constraint
comparisons.  All comparison "checks", such as seeing if a job was submitted
by a specific user, are counted.  When the maximum number of comparisons is
reached, an error is returned to the user.  The user can try again by
limiting the number of jobs they are searching through, such as only
searching active vs inactive jobs or if jobs were submitted since a certain time.

For the time being, hard code the maximum number of comparisons to 100
thousand.

Fixes flux-framework#5669
chu11 added a commit to chu11/flux-core that referenced this issue Apr 18, 2024
Problem: Job-list constraints are not limited in their size.  A nefarious
user could cause a DoS of the job-list service by sending an extremely
large constraint request.

Solution: To limit constraints, introduce the concept of constraint
comparisons.  All comparison "checks", such as seeing if a job was submitted
by a specific user, are counted.  When the maximum number of comparisons is
reached, an error is returned to the user.  The user can try again by
limiting the number of jobs they are searching through, such as only
searching active vs inactive jobs or if jobs were submitted since a certain time.

For the time being, hard code the maximum number of comparisons to 100
thousand.

Fixes flux-framework#5669
chu11 added a commit to chu11/flux-core that referenced this issue Apr 19, 2024
Problem: Job-list constraints are not limited in their size.  A nefarious
user could cause a DoS of the job-list service by sending an extremely
large constraint request.

Solution: To limit constraints, introduce the concept of constraint
comparisons.  All comparison "checks", such as seeing if a job was submitted
by a specific user, are counted.  When the maximum number of comparisons is
reached, an error is returned to the user.  The user can try again by
limiting the number of jobs they are searching through, such as only
searching active vs inactive jobs or if jobs were submitted since a certain time.

For the time being, hard code the maximum number of comparisons to 100
thousand.

Fixes flux-framework#5669
@mergify mergify bot closed this as completed in #5681 Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant