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

adding empty draft of security module, integrated after the search #838

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

arcuri82
Copy link
Collaborator

@arcuri82 arcuri82 commented Nov 9, 2023

No description provided.

@arcuri82 arcuri82 requested a review from onurd86 November 10, 2023 09:03
@onurd86
Copy link
Contributor

onurd86 commented Nov 13, 2023

solution = securityRest.applySecurityPhase()

I executed Evomaster with the parameter --security true. I checked the generated unit test file. That file is empty since the method call "solution = securityRest.applySecurityPhase()" overrides the set of solutions with an empty set.

when(config.problemType){
EMConfig.ProblemType.REST -> {
val securityRest = injector.getInstance(SecurityRest::class.java)
solution = securityRest.applySecurityPhase()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line:

solution = securityRest.applySecurityPhase()

overrides the variable solution, which contains the set of tests other than security tests.

class SecurityRest {

fun applySecurityPhase() : Solution<RestIndividual>{

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume generators for Security tests are going to be written as classes and they will be called in this method. Is that accurate? As example, if I want to test one of the generated endpoints for SQL injection vulnerabilities, where should I implement this test?


bind(SecurityRest::class.java)
.asEagerSingleton()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bind(SecurityRest::class.java)
.asEagerSingleton()

These two lines appear 3 times in different classes. I guess code duplication is inevitable in this case.

Copy link
Contributor

@onurd86 onurd86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not see any issues other than the solution which contains all other tests being overridden by an empty set.

To test writing a simple security test, we can provide 'OR 1=1" as an input for a simple API and see the response. The response should not contain any database results.

@arcuri82 arcuri82 merged commit c2cf7c3 into master Nov 15, 2023
8 checks passed
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 this pull request may close these issues.

2 participants