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

fix(tools): update configuration file paths and directory structure #224

Merged
merged 5 commits into from
Nov 13, 2024

Conversation

psyray
Copy link
Contributor

@psyray psyray commented Nov 7, 2024

Fixes #223

  • Modified the directory structure and file paths for configuration files (theHarvester, GAU, Amass) in the Docker setup and application code.
  • Updated the amass configuration file path to be more organized under a dedicated directory.
  • Adjusted symbolic links and file handling logic to align with the new directory structure.
  • Enhanced the update_config function to accommodate the new file naming conventions.
  • GAU need upgrade to specify a custom config file, and others tools are minor upgrade (mainly project discovery tool)
  • Fix theHarvester bug that prevent run (RuntimeWarning: Enable tracemalloc to get the object allocation traceback laramies/theHarvester#1857)

Todo

  • Tests updated tools

Summary by Sourcery

Update configuration file paths and directory structure for tools in the Docker setup and application code. Fix a bug in theHarvester and enhance configuration handling to support new file naming conventions.

Bug Fixes:

  • Fix theHarvester bug that prevented it from running by updating its configuration handling.

Enhancements:

  • Enhance the update_config function to support new file naming conventions.

Build:

  • Update Dockerfile to reflect new configuration file paths and directory structure for tools like theHarvester, GAU, and Amass.

- Modified the directory structure and file paths for configuration files in the Docker setup and application code.
- Updated the amass configuration file path to be more organized under a dedicated directory.
- Adjusted symbolic links and file handling logic to align with the new directory structure.
- Enhanced the update_config function to accommodate the new file naming conventions.
Copy link
Contributor

sourcery-ai bot commented Nov 7, 2024

Reviewer's Guide by Sourcery

This PR reorganizes the configuration file structure for several security tools (theHarvester, GAU, and Amass) and updates their versions. The implementation involves updating file paths in the Docker setup, modifying symbolic links, and enhancing the configuration handling code to support the new directory structure. The changes also include version upgrades for various project discovery tools and a fix for a theHarvester bug.

Class diagram for updated configuration handling

classDiagram
    class ConfigHandler {
        +update_config(request, tool_name, display_name, file_name='config', file_extension='.yaml')
    }

    class AmassConfig {
        +config_path: Path
    }

    class GauConfig {
        +config_path: Path
    }

    class TheHarvesterConfig {
        +config_path: Path
    }

    ConfigHandler --> AmassConfig : uses
    ConfigHandler --> GauConfig : uses
    ConfigHandler --> TheHarvesterConfig : uses

    note for ConfigHandler "Handles updating of configuration files for different tools"
    note for AmassConfig "Updated path to amass/config.ini"
    note for GauConfig "Updated path to gau/config.toml"
    note for TheHarvesterConfig "Updated path to theHarvester/api-keys.yaml"
Loading

File-Level Changes

Change Details Files
Reorganized configuration file directory structure and paths
  • Created dedicated config directories for each tool under ~/.config/
  • Updated file paths for amass config from amass.ini to amass/config.ini
  • Moved GAU config from .gau.toml to gau/config.toml
  • Updated symbolic link handling for tool configurations
docker/celery/Dockerfile
web/reNgine/tasks.py
web/scanEngine/views.py
web/api/views.py
Updated security tool versions and dependencies
  • Upgraded multiple projectdiscovery tools (httpx, subfinder, nuclei, etc.)
  • Updated GAU to version 2.2.4
  • Updated other security tools like dalfox and katana
docker/celery/Dockerfile
Enhanced configuration handling in application code
  • Modified update_config function to support new file naming conventions
  • Updated theHarvester command parameters to fix running issues
  • Adjusted GAU command to use the new config file location
web/reNgine/tasks.py
web/scanEngine/views.py
web/scanEngine/static/scanEngine/js/custom_tools.js

Assessment against linked issues

Issue Objective Addressed Explanation
#223 Fix 500 server error when adding configuration files for Amass, theHarvester, and Gau tools
#223 Ensure config.ini files are located in the correct directory structure and are accessible

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@psyray psyray self-assigned this Nov 7, 2024
@psyray psyray added the bug Something isn't working label Nov 7, 2024
- Updated the path and usage of the GAU configuration file across multiple files to ensure consistency and correct file referencing.
- Modified the command map in tasks.py to include the GAU configuration file path.
- Adjusted the Dockerfile to copy the GAU configuration file to the correct location and removed unnecessary symbolic link creation.
- Updated file path references in views.py and scanEngine/views.py to align with the new GAU configuration file path.
The changes standardize the casing of the ID and name attributes for the theHarvester configuration text area across JavaScript, HTML, and Python files. This involves updating the ID from theharvester_config_text_area to theHarvester_config_text_area to ensure consistency and improve code readability.
- Updated several Go-based tool dependencies to their latest versions in the Celery Dockerfile.
- Modified the command in tasks.py to remove github-code sources for theHarvester due to this bug.
laramies/theHarvester#1857
- Adjusted the column layout in the form_engine.html template to improve UI responsiveness.
@psyray psyray linked an issue Nov 8, 2024 that may be closed by this pull request
3 tasks
@psyray psyray changed the title refactor: update configuration file paths and directory structure fix(tools): update configuration file paths and directory structure Nov 8, 2024
@psyray
Copy link
Contributor Author

psyray commented Nov 8, 2024

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @psyray - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Please complete the testing of updated tools and verify all new config paths are working as expected before merging this PR
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Corrected the reference for the s3scanner installation in the Celery Dockerfile to fix a typo in the commit hash.
@psyray psyray marked this pull request as ready for review November 13, 2024 17:45
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @psyray - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@AnonymousWP AnonymousWP merged commit e6bf5c5 into release/2.1.1 Nov 13, 2024
13 checks passed
@AnonymousWP AnonymousWP deleted the hotfix/amass-config branch November 13, 2024 20:07
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
None yet
Development

Successfully merging this pull request may close these issues.

bug(scope): Config.ini File Not Found(Amass, theHarvester, Gau)
2 participants