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 support to retrieve password using the PAS Web Services SDK #75

Merged
merged 5 commits into from
Nov 25, 2024

Conversation

JtMotoX
Copy link
Contributor

@JtMotoX JtMotoX commented Nov 14, 2024

Desired Outcome

Allow retrieving passwords using the cyberark_account module which uses the PAS Web Services SDK.

Implemented Changes

Added a 'retrieve' option to the state parameter.

- name: Retrieve account and password
  cyberark.pas.cyberark_account:
    identified_by: "address,username"
    safe: "Domain_Admins"
    address: "prod.cyberark.local"
    username: "admin"
    state: retrieve
    cyberark_session: "{{ cyberark_session }}"
  register: retrieveaccount

Example output (notice the password value is returned in the result):

ok: [localhost] => {
    "retrieve_account": {
        "attempts": 1,
        "changed": false,
        "failed": false,
        "result": {
            "address": "...",
            "categoryModificationTime": ...,
            "createdTime": ...,
            "id": "...",
            "name": "...",
            "password": "...",
            "platformAccountProperties": {},
            "platformId": "...",
            "safeName": "...",
            "secretManagement": {
                "automaticManagementEnabled": ...,
                "lastModifiedTime": ...
            },
            "secretType": "...",
            "userName": "..."
        },
        "status_code": 200
    }
}

Connected Issue/Story

CyberArk Enhancement Request Article Number: 000038582

Definition of Done

At least 1 todo must be completed in the sections below for the PR to be
merged.

Changelog

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a
    CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code
    changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR
  • A follow-up issue to update official docs has been filed here: [insert issue ID]
  • This PR does not require updating any documentation

Behavior

  • This PR changes product behavior and has been reviewed by a PO, or
  • These changes are part of a larger initiative that will be reviewed later, or
  • No behavior was changed with this PR

Security

  • Security architect has reviewed the changes in this PR,
  • These changes are part of a larger initiative with a separate security review, or
  • There are no security aspects to these changes

JtMotoX and others added 3 commits November 18, 2024 15:40
* update docs to provide details to update password only in vault

* update version

* update task id in docs

* update task id in docs

* update changelog

---------

Co-authored-by: Jonathan Fair <[email protected]>
@JtMotoX JtMotoX force-pushed the feature/pas-retrieval branch from 5bb7fcc to 19e3de2 Compare November 18, 2024 23:41
@JtMotoX JtMotoX marked this pull request as draft November 18, 2024 23:41
@JtMotoX JtMotoX marked this pull request as ready for review November 18, 2024 23:44
Copy link
Member

@infamousjoeg infamousjoeg left a comment

Choose a reason for hiding this comment

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

I approve these changes. However, I think it’s important to note to the final person who will merge this PR into the main code base that this is an implementation of a REST API Retrieval of a Password directly from the Vault. Technically, this is a sound contribution. Security-wise, I leave it up to future reviewers.

@JtMotoX
Copy link
Contributor Author

JtMotoX commented Nov 22, 2024 via email

Copy link
Contributor

@cyberark-bizdev cyberark-bizdev left a comment

Choose a reason for hiding this comment

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

Approved

@cyberark-bizdev cyberark-bizdev merged commit 98da5d5 into cyberark:master Nov 25, 2024
cyberark-bizdev added a commit that referenced this pull request Nov 25, 2024
@JtMotoX JtMotoX deleted the feature/pas-retrieval branch November 25, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants