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

Extension for a new privilege escalation credential field for targets in GMP #1535

Merged

Conversation

jhelmold
Copy link
Member

@jhelmold jhelmold commented May 25, 2021

What:
Extension for a new privilege escalation credential field for
targets in GMP. This step concerns the creation, modification and
the loading from the DB of targets.

Why:
A customer requested this new functionality

How did you test it:

Checklist:

for the creation and modification of targets.

In file gmp.c:
  Extended the structs create_target_data_t and
  modify_target_data_t and the enum client_state_t. Adjusted the
  functions gmp_xml_handle_start_element and
  gmp_xml_handle_end_element. Adjusted the function call of
  modify_target and create_target in gmp_xml_handle_end_element.

In file manage_sql.c:
  Extended the functions create_target and modify_target with the
  new field ssh_elevate_credential and added the required
  functionality.
@jhelmold jhelmold changed the title Extension for a new previlige escalation credential field in GMP (creation and modification of targets) Extension for a new previlige escalation credential field in GMP May 25, 2021
Added documentation of the parameter ssh_elevate_credential at the
call of create_target.
Added documentation of the parameter ssh_elevate_credential_id at
the call of modify_target.
@jhelmold jhelmold force-pushed the extend_gmp_for_escalation_credential branch from 2eececd to a40fa21 Compare May 25, 2021 13:16
in file gmp.c:
  Added the necessary data structures and code to get the new
  credential to the function handle_get_targets().

in manage_sql.c:
  Extended the TARGET_ITERATOR_COLUMNS and
  TARGET_ITERATOR_FILTER_COLUMNS for the new credential.
  Added the functions target_iterator_ssh_elevate_credential(),
  target_iterator_ssh_elevate_trash() and
  target_ssh_elevate_credential().
@jhelmold jhelmold changed the title Extension for a new previlige escalation credential field in GMP Extension for a new privilege escalation credential field for targets in GMP May 27, 2021
@timopollmeier timopollmeier marked this pull request as ready for review May 27, 2021 10:03
@timopollmeier timopollmeier requested a review from a team as a code owner May 27, 2021 10:03
Copy link
Member

@timopollmeier timopollmeier left a comment

Choose a reason for hiding this comment

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

I think there should be checks in the create_target and modify_target commands that reject
the SSH elevate credential if the main SSH credential is not defined.
Besides that I've found a few small mistakes in the whitespaces that I've added suggestion
comments for.

src/gmp.c Outdated Show resolved Hide resolved
src/gmp.c Outdated Show resolved Hide resolved
src/gmp.c Outdated Show resolved Hide resolved
src/manage_sql.c Show resolved Hide resolved
src/manage_sql.c Show resolved Hide resolved
src/manage_sql.c Show resolved Hide resolved
@jhelmold jhelmold force-pushed the extend_gmp_for_escalation_credential branch from 480b42c to 605b24c Compare May 28, 2021 09:15
src/manage.h Outdated Show resolved Hide resolved
src/manage_sql.c Show resolved Hide resolved
src/manage_sql.c Show resolved Hide resolved
src/manage_sql.c Show resolved Hide resolved
jhelmold and others added 4 commits May 28, 2021 12:07
in manage_sql.c:
  Added a check, if there is a ssh_credential when a
  ssh_elevate_credential is given, in the functions
  create_target() und modify_target(). If there is
  no ssh_credential an error code is returned.

in gmp.c:
  Added the according error messages to the error messages
  sections behind the call of create_target() and
  modify_target().
in manage_sql.c:
  Adjusted and added the documentation of the return
  values concerned by the new SSH Elevate Credential in
  the Doxygen-comments of the functions create_target()
  and modify_target().
@timopollmeier timopollmeier merged commit d7990db into greenbone:master May 28, 2021
timopollmeier added a commit that referenced this pull request Jun 2, 2021
Extension for a new privilege escalation credential field for targets in GMP (backport #1535)
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