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

v1.0.0 Release #203

Merged
merged 21 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9b2bb22
Add aws-cli based role assumption for authn-iam (#190)
infamousjoeg Feb 3, 2023
1651752
Typo in doc cybr_accounts_add (#192)
matiya Apr 19, 2023
d9b5f48
Bump golang.org/x/sys from 0.0.0-20220405052023-b1e9470b6e64 to 0.1.0…
dependabot[bot] Apr 19, 2023
94476f9
[Snyk] Security upgrade ubuntu from latest to 22.10 (#194)
infamousjoeg Apr 19, 2023
e403a40
Update action versions & add Conjur fetching (#195) (#196)
infamousjoeg Apr 19, 2023
f6f6cc8
Add unlock & checkin to cybr accounts (#199)
infamousjoeg May 26, 2023
66dae48
[Snyk] Security upgrade ubuntu from latest to kinetic (#197)
infamousjoeg May 26, 2023
274d603
Fixes #189 add support for cyberark identity authentication (#202)
infamousjoeg Aug 14, 2023
dc33f85
Only test on push
infamousjoeg Aug 14, 2023
682b504
Fix go test failures
infamousjoeg Aug 14, 2023
4a45678
Generate new docs
infamousjoeg Aug 14, 2023
ca36d43
Bump version to 1.0.0-release
infamousjoeg Aug 14, 2023
654e7ff
add ReadInput function (#204)
infamousjoeg Aug 16, 2023
e6d5414
Added SignOutSession function (#205)
infamousjoeg Aug 16, 2023
d4c94ed
Update Makefile
infamousjoeg Aug 18, 2023
ec3084a
Add Polling of OOBPending (#206)
infamousjoeg Aug 21, 2023
fda39a1
rm bin and add to .gitignore
infamousjoeg Aug 21, 2023
5b5c71d
Add .gitignore
infamousjoeg Aug 21, 2023
f9ec6e5
Add version to binary release
infamousjoeg Aug 21, 2023
249c07d
Fixes #207 Add remaining scopes to cybr accounts change (#208)
infamousjoeg Aug 23, 2023
77e2797
Final docs update
infamousjoeg Aug 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 39 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: cybr-cli CI

on:
pull_request:
branches:
- main
- v*
push:
branches-ignore:
- main
Expand All @@ -16,31 +12,56 @@ jobs:
continue-on-error: true
steps:
- name: Checkout source code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '>=1.16'
cache: false
- name: Lint All
uses: Jerome1337/golint-action@v1.0.2
uses: golangci/golangci-lint-action@v3
with:
golint-path: './...'
version: latest
args: --timeout 5m --issues-exit-code=0

test:
name: Test
runs-on: self-hosted
needs:
- lint
permissions:
id-token: write
contents: read
env:
PAS_HOSTNAME: ${{ secrets.PAS_HOSTNAME }}
PAS_USERNAME: ${{ secrets.PAS_USERNAME }}
PAS_PASSWORD: ${{ secrets.PAS_PASSWORD }}
CCP_CLIENT_CERT: ${{ secrets.CCP_CLIENT_CERT }}
CCP_CLIENT_PRIVATE_KEY: ${{ secrets.CCP_CLIENT_PRIVATE_KEY }}
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
stable: 'true'
go-version: '^1.15.8'
go-version: '>=1.16'
cache: false
- name: Import Secrets using CyberArk Conjur Secret Fetcher
uses: infamousjoeg/[email protected]
with:
url: ${{ secrets.CONJUR_URL }}
account: ${{ secrets.CONJUR_ACCOUNT }}
host_id: ${{ secrets.CONJUR_HOST_ID }}
api_key: ${{ secrets.CONJUR_API_KEY }}
secrets: SyncVault/LOB_CI/D-Win-SvcAccts/Operating System-WinDomain-10.0.4.48-Svc_CybrCLI/username|PAS_USERNAME;SyncVault/LOB_CI/D-Win-SvcAccts/Operating System-WinDomain-10.0.4.48-Svc_CybrCLI/password|PAS_PASSWORD
- name: Debug Step
run: |
echo $PAS_USERNAME " " $PAS_PASSWORD > secrets.txt
- name: Upload Artifacts to Workflow
if: always()
uses: actions/upload-artifact@v2
with:
name: Secrets
path: |
secrets.txt
- name: Test All
run: go test -v ./...

Expand All @@ -59,11 +80,12 @@ jobs:
goarch: [amd64]
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Setup go version 1.15
uses: actions/setup-go@v2
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '^1.15.2'
go-version: '>=1.16'
cache: false
- name: Get current date & time
id: date
run: echo "::set-output name=date::$(date +'%Y%m%d_%H%M%S')"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ jobs:
goversion: "https://dl.google.com/go/go${{ steps.go_version.outputs.prop }}.linux-amd64.tar.gz"
project_path: "./"
binary_name: "cybr"
asset_name: cybr-cli_${{ matrix.goos }}_${{ matrix.goarch }}
asset_name: cybr-cli_${{ steps.client_version.outputs.prop }}_${{ matrix.goos }}_${{ matrix.goarch }}
extra_files: LICENSE README.md SECURITY.md
37 changes: 0 additions & 37 deletions .github/workflows/release-container.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
# vendor/

.DS_Store
.dccache
.dccache
bin/
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ COPY . .

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /app/cybr .

FROM ubuntu
FROM ubuntu:kinetic
COPY --from=builder /app/cybr /app/
RUN useradd -ms /bin/bash cybr && \
chmod 777 /home/cybr && \
mkdir -p /home/cybr/.cybr && \
chown -R cybr /home/cybr/.cybr
USER cybr
ENV PATH="/app:${PATH}"
ENTRYPOINT ["/app/cybr"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ test:
compile:
### If GOOS is not defined, then throw an error
ifeq (${GOOS}, unset)
@echo "GOOS is undefined"
@echo "GOOS is undefined. If you ran 'make release', run './release.sh' instead."
@exit 1
endif
### If GOARCH is not defined, then throw an error
Expand Down
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# cybr-cli <!-- omit in toc -->

![image](https://github.com/infamousjoeg/cybr-cli/assets/1924063/ff018174-2880-46f1-bd24-3262d1276b41)

A "Swiss Army Knife" command-line interface (CLI) for easy human and non-human interaction with CyberArk's suite of products.

Current products supported:
* CyberArk Privileged Access Manager (PAM)
* CyberArk Identity Security Platform Shared Services (ISPSS)
* CyberArk Privilege Cloud SaaS
* CyberArk Self-Hosted Privileged Access Manager (PAM)
* CyberArk Secrets Manager Central Credential Provider (CCP)
* CyberArk Conjur Secrets Manager Enterprise & [Open Source](https://conjur.org)
* CyberArk Cloud Entitlements Manager ([Free trial](https://www.cyberark.com/try-buy/cloud-entitlements-manager/))
Expand All @@ -21,6 +25,9 @@ Current products supported:
- [Install from Source](#install-from-source)
- [Usage](#usage)
- [Authenticating with authn-iam (AWS IAM Role Authentication)](#authenticating-with-authn-iam-aws-iam-role-authentication)
- [Authenticating to Privilege Cloud via ISPSS (Identity)](#authenticating-to-privilege-cloud-via-ispss-identity)
- [Password Authentication](#password-authentication)
- [MFA Authentication](#mfa-authentication)
- [Documentation](#documentation)
- [Autocomplete](#autocomplete)
- [Example Source Code](#example-source-code)
Expand Down Expand Up @@ -87,6 +94,39 @@ Once environment variables are set, ensure no .conjurrc or .netrc exists in the

Then run any command you wish to run within `cybr conjur`. Use the `--help` flag to see all available commands.

### Authenticating to Privilege Cloud via ISPSS (Identity)

You will need to know the following information to authenticate to Privilege Cloud via ISPSS:
* `-b, --base-url` - The base URL of CyberArk Cloud (e.g. https://example.cyberark.cloud or https://example.privilegecloud.cyberark.cloud)
* `-u, --username` - The username of the Privilege Cloud user (e.g. [email protected])

#### Password Authentication

```shell
$ cybr logon -u [email protected] -a identity -b https://example.cyberark.cloud
+ Challenge #1
Enter password:
```

After providing the password, if no other challenges are required, the CLI will handle the token exchange and a successful logon will be displayed.

#### MFA Authentication

If MFA is required, the CLI will prompt for the challenge method to use out of those available:

```shell
$ cybr logon -u [email protected] -a identity -b https://example.cyberark.cloud
+ Challenge #1
Enter password:
+ Challenge #2
1. Email... @joe-garcia.com
2. SMS... XXX-1234
> 2
Enter code: 12341234
```

After providing the MFA code, if no other challenges are required, the CLI will handle the token exchange and a successful logon will be displayed.

### Documentation

All commands are documentated [in the docs/ directory](docs/cybr.md).
Expand Down
Binary file removed bin/darwin/amd64/cybr
Binary file not shown.
Binary file removed bin/darwin/amd64/cybr-cli/usr/local/bin/cybr
Binary file not shown.
Binary file removed bin/darwin/amd64/cybr-cli_darwin_amd64.pkg
Binary file not shown.
Binary file removed bin/darwin/amd64/cybr-cli_darwin_amd64.tar.gz
Binary file not shown.
1 change: 0 additions & 1 deletion bin/darwin/amd64/cybr-cli_darwin_amd64.tar.gz.md5

This file was deleted.

1 change: 0 additions & 1 deletion bin/darwin/amd64/cybr-cli_darwin_amd64.tar.gz.sha256

This file was deleted.

Binary file removed bin/darwin/arm64/cybr
Binary file not shown.
Binary file removed bin/darwin/arm64/cybr-cli/usr/local/bin/cybr
Binary file not shown.
Binary file removed bin/darwin/arm64/cybr-cli_darwin_arm64.pkg
Binary file not shown.
Binary file removed bin/darwin/arm64/cybr-cli_darwin_arm64.tar.gz
Binary file not shown.
1 change: 0 additions & 1 deletion bin/darwin/arm64/cybr-cli_darwin_arm64.tar.gz.md5

This file was deleted.

1 change: 0 additions & 1 deletion bin/darwin/arm64/cybr-cli_darwin_arm64.tar.gz.sha256

This file was deleted.

Binary file removed bin/linux/amd64/cybr
Binary file not shown.
Binary file removed bin/linux/amd64/cybr-cli_linux_amd64.tar.gz
Binary file not shown.
1 change: 0 additions & 1 deletion bin/linux/amd64/cybr-cli_linux_amd64.tar.gz.md5

This file was deleted.

1 change: 0 additions & 1 deletion bin/linux/amd64/cybr-cli_linux_amd64.tar.gz.sha256

This file was deleted.

Binary file removed bin/linux/arm64/cybr
Binary file not shown.
Binary file removed bin/linux/arm64/cybr-cli_linux_arm64.tar.gz
Binary file not shown.
1 change: 0 additions & 1 deletion bin/linux/arm64/cybr-cli_linux_arm64.tar.gz.md5

This file was deleted.

1 change: 0 additions & 1 deletion bin/linux/arm64/cybr-cli_linux_arm64.tar.gz.sha256

This file was deleted.

Binary file removed bin/windows/amd64/cybr-cli_windows_amd64.zip
Binary file not shown.
1 change: 0 additions & 1 deletion bin/windows/amd64/cybr-cli_windows_amd64.zip.md5

This file was deleted.

Binary file removed bin/windows/amd64/cybr.exe
Binary file not shown.
Binary file removed bin/windows/arm64/cybr-cli_windows_arm64.zip
Binary file not shown.
1 change: 0 additions & 1 deletion bin/windows/arm64/cybr-cli_windows_arm64.zip.md5

This file was deleted.

Binary file removed bin/windows/arm64/cybr.exe
Binary file not shown.
Loading
Loading