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

feat(engine_dast): new dast scanning engine. #140

Open
wants to merge 76 commits into
base: trunk
Choose a base branch
from

Conversation

russbelln
Copy link
Collaborator

@russbelln russbelln commented May 7, 2024

Description

  • Add new dast scanning engine
  • Add the Nuclei tool as driven adapter of the new engine

Checklist:

  • The pull request is complete according to the guide of contributing of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Copy link

sonarcloud bot commented May 30, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
D Security Rating on New Code (required ≥ C)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@russbelln russbelln changed the title Feature/engine dast nu feat(engine dast) Sep 5, 2024
@russbelln russbelln changed the title feat(engine dast) feat(engine dast): new dast scanning engine Sep 5, 2024
@russbelln russbelln changed the title feat(engine dast): new dast scanning engine feat(engine_dast): new dast scanning engine Sep 5, 2024
@russbelln russbelln changed the title feat(engine_dast): new dast scanning engine feat(engine_dast): new dast scanning engine. Sep 5, 2024
Solve comments and improve engine dast unit test
Copy link

sonarcloud bot commented Oct 16, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
D Security Rating on New Code (required ≥ C)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Copy link
Contributor

Choose a reason for hiding this comment

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

Update the file example_remote_config_local/engine_core/ConfigTool.json with the EXTRA_TOOLS property in the ENGINE_DAST block

Copy link
Contributor

Choose a reason for hiding this comment

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

Delete .gitkeep files where it is not needed

"MESSAGE_INFO_DAST": "If you have doubts, visit https://forum.example",
"NUCLEI": {
"VERSION": "2.3.296",
"EXCLUSIONS_PATH": "/engine_dast/Exclusions.json",
Copy link
Contributor

Choose a reason for hiding this comment

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

delete EXCLUSIONS_PATH, it not used

class ConfigTool:
def __init__(self, json_data, tool):
self.version = json_data[tool].get("VERSION")
self.exclusions_path = json_data[tool].get("EXCLUSIONS_PATH")
Copy link
Contributor

Choose a reason for hiding this comment

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

delete exclusions_path, it not used


def check_install_tool(self) -> any:
command = "nuclei --version"
result = subprocess.run(command, capture_output=True, shell=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

check the installation with subprocess.run( ["nuclei", "./trivy"] and handle the response with the return code.

return 0

def run_install(self):
download = subprocess.run(
Copy link
Contributor

Choose a reason for hiding this comment

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

download with requests.get and release according to platform.system()

logger.error(f"Error downloading {self.TOOL} binary")
return -1

unzip = subprocess.run(
Copy link
Contributor

Choose a reason for hiding this comment

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

instead use Utils.unzip_file

logger.error(f"Error Unzipping {self.TOOL} binary")
return -1

make_exe = subprocess.run(
Copy link
Contributor

Choose a reason for hiding this comment

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

run it only with unix operating systems

Copy link
Contributor

@Gaviria9601 Gaviria9601 left a comment

Choose a reason for hiding this comment

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

Review new comments



def generate_file_from_tool(tool, result_list, rules_doc):
if tool.lower() == "nuclei":
Copy link
Contributor

Choose a reason for hiding this comment

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

nuclei not it necesary. If this is for JWT, use a generic format or SARIF to send to defect dojo

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.

3 participants