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

Implement unit tests for nuclei templates validation #4996

Open
Ice3man543 opened this issue Apr 5, 2024 · 1 comment · May be fixed by #5014
Open

Implement unit tests for nuclei templates validation #4996

Ice3man543 opened this issue Apr 5, 2024 · 1 comment · May be fixed by #5014
Assignees
Labels
Type: Enhancement Most issues will probably ask for additions or changes.

Comments

@Ice3man543
Copy link
Member

Please describe your feature request:

  • Autogeneration of tests
  • Validation using associated tests file
  • Maybe we can follow go convention of having test file like <template_filename>_test.yaml in the same directory? cc @tarunKoyalwar @ehsandeep

Describe the use case of this feature:

@Ice3man543 Ice3man543 added the Type: Enhancement Most issues will probably ask for additions or changes. label Apr 5, 2024
@denandz
Copy link
Contributor

denandz commented Apr 5, 2024

I think what would be helpful is some mechanism that allows template authors to auto-generate tests. For example, if i could run something like:

nuclei -t mytemplate.yaml -u <vulnerabletarget> --autogen-testcases 

And have it spit out HTTP request and response data that can be used to validate the templates without a full vulnerable target, that would be awesome. Template authors could effectively start writing basic mock tests using a single command.

I think the system, for http templates at least, would need some way of hosting a test web server which then used the generated response-data from the known vulnerable service. This would be very basic and wont fully test more complex templates, but it would be a starting point.

@Ice3man543 Ice3man543 self-assigned this Apr 8, 2024
@Ice3man543 Ice3man543 linked a pull request Apr 8, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants