[Bug] Perpetual Warnings on TAXII Server Response due to Pagination Issues in mitreattack-python
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the navigation-layer reference example and trace the ToSvg call that uses source='taxii'. Then inspect the linked cti-taxii-client code at taxii2client/v20/init.py and determine where per_request=1 is introduced. Done means the example no longer produces perpetual pagination warnings when querying MITRE's TAXII 2.0 server.
Written by the indexing model from the issue text.
Description
Bug Description
When you run the following code (as provided in our reference documentation here):
from mitreattack.navlayers import Layer
from mitreattack.navlayers import ToSvg, SVGConfig
lay = Layer()
lay.from_file("path/to/layer/file.json")
# Using taxii server for template
t = ToSvg(domain=lay.layer.domain, source='taxii')
t.to_svg(layerInit=lay, filepath="demo.svg")
#Using local stix data for template
The following warnings are reported ad infinitum (in a perpetual loop):
[taxii2client.v20] [WARNING ] [2023-08-28 12:44:57,819] TAXII Server Response did not include 'Content-Range' header - results could be incomplete.
[taxii2client.v20] [WARNING ] [2023-08-28 12:44:57,820] TAXII Server Response with different amount of objects! Setting per_request=1
[taxii2client.v20] [WARNING ] [2023-08-28 12:45:00,746] TAXII Server Response did not include 'Content-Range' header - results could be incomplete.
[taxii2client.v20] [WARNING ] [2023-08-28 12:45:00,747] TAXII Server Response with different amount of objects! Setting per_request=1
[taxii2client.v20] [WARNING ] [2023-08-28 12:45:05,395] TAXII Server Response did not include 'Content-Range' header - results could be incomplete.
[taxii2client.v20] [WARNING ] [2023-08-28 12:45:05,396] TAXII Server Response with different amount of objects! Setting per_request=1
Context
The error stems from MITRE's TAXII 2.0 server not being fully compliant with the TAXII 2.0 spec; specifically in that it omits the Content-Range header in HTTP responses. The mitreattack-python code uses a third party library (provided by OASIS) to interface with the TAXII server: cti-taxii-client. This is not maintained by us. You can actually see how those warnings are being logged here. This discrepancy is due to our TAXII 2.0 server implementation not supporting pagination.
However, it’s unusual that the mitreattack-python API is setting pagination on these downstream requests (as observed by the per_request=1 string in the above logs), so we’re investigating that.
Possible Solution
- Implement pagination on the TAXII 2.0 server. This is unlikely given the age and projected lifespan of the server.
- Identify the source of where
per_request=1is getting set and either unset it or set it to zero to effectively disable pagination.
- Dominant language
- HTML
- Stars
- 743
- Forks
- 176
- PR merge metrics
- No merged PRs in 30d
Contributor 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 mitre-attack/mitreattack-python
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
mitre-attack/mitreattack-python#207 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
mitre-attack/mitreattack-python#188 · 1 comment ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
mitre-attack/mitreattack-python#183 · 2 comments · 1 reaction ·
-
[Request] OWL export Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
All issues in mitre-attack/mitreattack-python
Similar issues
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100