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

Nettacker code base major refactoring #863

Merged
merged 21 commits into from
Aug 24, 2024

Conversation

arkid15r
Copy link
Collaborator

@arkid15r arkid15r commented Aug 8, 2024

This is a refactor of existing Nettacker code I've been working on this spring/summer.

The (incomplete) list of changes:

  • add pre-commit checks
  • apply OOP approach to the application architecture
  • consolidate common modules logic into a base class
  • extract YAML parsing logic into a separate module
  • fix some typos
  • get rid of (not all) misused try/except blocks
  • migrate to poetry, remove requirements.* files
  • re-design configuration module
  • re-design logging module
  • split application logic into classes
  • use pathlib for path related manipulations
  • use context-based naming for variables, modules, directories, etc
  • use module level imports (vs function level)
  • use the base class for specific protocol libraries

This is a refactor of existing Nettacker code I've been working on recently. The (incomplete) list of changes:

          - add pre-commit checks
          - apply OOP approach to the application architecture
          - consolidate common modules logic into a base class
          - extract YAML parsing logic into a separate module
          - fix some typos
          - get rid of (not all) misused try/except blocks
          - migrate to poetry, remove requirements.* files
          - re-design configuration module
          - re-design logging module
          - split application logic into classes
          - use `pathlib` for path related manipulations
          - use context-based naming for variables, modules, directories, etc
          - use module level imports (vs function level)
          - use the base class for specific protocol libraries
src/nettacker/core/lib/socket.py Fixed Show fixed Hide fixed
src/nettacker/core/lib/ssh.py Fixed Show fixed Hide fixed
src/nettacker/logger.py Fixed Show fixed Hide fixed
return None

try:
socket_connection = ssl.wrap_socket(socket_connection)

Check failure

Code scanning / CodeQL

Default version of SSL/TLS may be insecure High

Call to deprecated method ssl.wrap_socket does not specify a protocol, which may result in an insecure default being used.
nettacker/core/lib/ssh.py Dismissed Show dismissed Hide dismissed
nettacker/logger.py Dismissed Show dismissed Hide dismissed
@Ali-Razmjoo Ali-Razmjoo self-requested a review August 11, 2024 23:20
@securestep9 securestep9 merged commit 477d520 into OWASP:master Aug 24, 2024
7 of 11 checks passed
@arkid15r arkid15r deleted the code-base-refactoring branch August 24, 2024 23:41
@arkid15r arkid15r mentioned this pull request Sep 1, 2024
8 tasks
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