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

Report API Quirks #3934

Closed
zcrt opened this issue Dec 5, 2024 · 0 comments · Fixed by #3942
Closed

Report API Quirks #3934

zcrt opened this issue Dec 5, 2024 · 0 comments · Fixed by #3942
Assignees
Labels
bug Something isn't working

Comments

@zcrt
Copy link
Contributor

zcrt commented Dec 5, 2024

Describe the bug
The report API as introduced in #3746 behaves unexpectedly in some cases:

  1. GET scheduled aggregate report returns:
{
                "id": "74def394-2217-4af4-b50a-7c256b488f0c",
                "report_name_format": "Maandelijks ${report_type} voor ${oois_count} objecten",
                "subreport_name_format": "",
                "input_recipe": {
                    "query": {
                        "search_string": "",
                        "asc_desc": "desc",
                        "ooi_types": [
                            "IPAddressV6",
                            "IPAddressV4",
                            "Hostname"
                        ],
                        "order_by": "object_type",
                        "scan_level": [
                            1,
                            2,
                            3,
                            4
                        ],
                        "scan_type": [
                            "declared"
                        ]
                    }
                },
                "report_types": [
                    "ipv6-report",
                    "mail-report",
                    "name-server-report",
                    "open-ports-report",
                    "rpki-report",
                    "safe-connections-report",
                    "systems-report",
                    "vulnerability-report",
                    "web-system-report"
                ],
                "cron_expression": "48 10 5 * *"
}

When using that recipe as a POST in another organisation KAT returns:

{"type":"validation_error","errors":[{"code":"blank","detail":"This field may not be blank.","attr":"subreport_name_format"}]}
  1. When trying the above with something filled in the subreport_name_format (e.g. "Aggregate Organisation Report") the organisations posted to instead create a "Concatenated report" with a different Scheduled for time.
  2. When doing 2) again a new "Concatenated report" is created, even though the id given in the POST is the same as POST-ed before.
  3. When attempting to access the API endpoints in the browser when logged in KAT throws an AssertionError.

To Reproduce
Steps to reproduce the behavior:

  1. Create a scheduled aggregate report
  2. GET it
  3. POST it
  4. Try accessing through the browser when logged in.

Expected behavior
What I am looking for is something like /clone_katalogus_settings/ but instead for reports. This should be doable by GET-ing and POST-ing instead but the above quirks make it difficult.

Screenshots
1,2,3) Image
Image

  1. Image

OpenKAT version
main - 4/5 dec.

@zcrt zcrt added the bug Something isn't working label Dec 5, 2024
@dekkers dekkers self-assigned this Dec 6, 2024
@underdarknl underdarknl added this to KAT Dec 6, 2024
@github-project-automation github-project-automation bot moved this to Incoming features / Need assessment in KAT Dec 6, 2024
@dekkers dekkers moved this from Incoming features / Need assessment to In Progress in KAT Dec 6, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in KAT Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants