Compare commits

...

13 Commits

Author SHA1 Message Date
Cesar Francisco San Nicolas Martinez
c437a37be7 Merge pull request #13171 from infamousjoeg/cyberark-ccp-branding-webserviceid
Cyberark ccp branding webserviceid
2022-11-08 18:42:27 +01:00
Cesar Francisco San Nicolas Martinez
b59cee97d8 Merge branch 'test_cyberark' into cyberark-ccp-branding-webserviceid 2022-11-08 18:42:10 +01:00
Cesar Francisco San Nicolas Martinez
9ca554ce75 Merge pull request #13172 from infamousjoeg/fix-12846-conjur-versioning
Add proper declaration of secret version if present
2022-11-08 18:41:20 +01:00
Cesar Francisco San Nicolas Martinez
81e20c727d Merge pull request #13170 from infamousjoeg/conjur-cloud-and-branding
Conjur cloud and branding
2022-11-08 18:40:46 +01:00
Joe Garcia
f3482f4038 Removed final reference to CyberArk Conjur Secret Lookup 2022-10-28 12:42:02 -04:00
Joe Garcia
878035c13b Fixed webservice_id check to string 2022-10-26 12:45:59 -04:00
Joe Garcia
2cc971a43f default to AIMWebService if no val provided 2022-10-26 12:41:15 -04:00
Joe Garcia
9d77c54612 Remove references to AIM everywhere 2022-10-26 12:32:12 -04:00
Joe Garcia
546fabbb97 Update references across the board 2022-10-26 12:28:50 -04:00
Joe Garcia
ef651a3a21 Add Web Service ID & update branding 2022-10-26 11:54:09 -04:00
Joe Garcia
68862d5085 rm base64 import to pass lint 2022-10-26 11:14:14 -04:00
Joe Garcia
66c7d5e9be Fixes #13119 #13120 Cloud support & update brand 2022-10-26 10:25:19 -04:00
Joe Garcia
4a7335676d Add proper declaration of secret version if present 2022-10-17 14:43:16 -05:00
8 changed files with 33 additions and 24 deletions

View File

@@ -9,10 +9,16 @@ aim_inputs = {
'fields': [ 'fields': [
{ {
'id': 'url', 'id': 'url',
'label': _('CyberArk AIM URL'), 'label': _('CyberArk CCP URL'),
'type': 'string', 'type': 'string',
'format': 'url', 'format': 'url',
}, },
{
'id': 'webservice_id',
'label': _('Web Service ID'),
'type': 'string',
'help_text': _('The CCP Web Service ID. Leave blank to default to AIMWebService.'),
},
{ {
'id': 'app_id', 'id': 'app_id',
'label': _('Application ID'), 'label': _('Application ID'),
@@ -64,10 +70,13 @@ def aim_backend(**kwargs):
client_cert = kwargs.get('client_cert', None) client_cert = kwargs.get('client_cert', None)
client_key = kwargs.get('client_key', None) client_key = kwargs.get('client_key', None)
verify = kwargs['verify'] verify = kwargs['verify']
webservice_id = kwargs['webservice_id']
app_id = kwargs['app_id'] app_id = kwargs['app_id']
object_query = kwargs['object_query'] object_query = kwargs['object_query']
object_query_format = kwargs['object_query_format'] object_query_format = kwargs['object_query_format']
reason = kwargs.get('reason', None) reason = kwargs.get('reason', None)
if webservice_id == '':
webservice_id = 'AIMWebService'
query_params = { query_params = {
'AppId': app_id, 'AppId': app_id,
@@ -78,7 +87,7 @@ def aim_backend(**kwargs):
query_params['reason'] = reason query_params['reason'] = reason
request_qs = '?' + urlencode(query_params, quote_via=quote) request_qs = '?' + urlencode(query_params, quote_via=quote)
request_url = urljoin(url, '/'.join(['AIMWebService', 'api', 'Accounts'])) request_url = urljoin(url, '/'.join([webservice_id, 'api', 'Accounts']))
with CertFiles(client_cert, client_key) as cert: with CertFiles(client_cert, client_key) as cert:
res = requests.get( res = requests.get(
@@ -92,4 +101,4 @@ def aim_backend(**kwargs):
return res.json()['Content'] return res.json()['Content']
aim_plugin = CredentialPlugin('CyberArk AIM Central Credential Provider Lookup', inputs=aim_inputs, backend=aim_backend) aim_plugin = CredentialPlugin('CyberArk Central Credential Provider Lookup', inputs=aim_inputs, backend=aim_backend)

View File

@@ -1,6 +1,5 @@
from .plugin import CredentialPlugin, CertFiles, raise_for_status from .plugin import CredentialPlugin, CertFiles, raise_for_status
import base64
from urllib.parse import urljoin, quote from urllib.parse import urljoin, quote
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
@@ -61,7 +60,7 @@ def conjur_backend(**kwargs):
cacert = kwargs.get('cacert', None) cacert = kwargs.get('cacert', None)
auth_kwargs = { auth_kwargs = {
'headers': {'Content-Type': 'text/plain'}, 'headers': {'Content-Type': 'text/plain', 'Accept-Encoding': 'base64'},
'data': api_key, 'data': api_key,
'allow_redirects': False, 'allow_redirects': False,
} }
@@ -69,9 +68,9 @@ def conjur_backend(**kwargs):
with CertFiles(cacert) as cert: with CertFiles(cacert) as cert:
# https://www.conjur.org/api.html#authentication-authenticate-post # https://www.conjur.org/api.html#authentication-authenticate-post
auth_kwargs['verify'] = cert auth_kwargs['verify'] = cert
resp = requests.post(urljoin(url, '/'.join(['authn', account, username, 'authenticate'])), **auth_kwargs) resp = requests.post(urljoin(url, '/'.join(['api', 'authn', account, username, 'authenticate'])), **auth_kwargs)
raise_for_status(resp) raise_for_status(resp)
token = base64.b64encode(resp.content).decode('utf-8') token = resp.content.decode('utf-8')
lookup_kwargs = { lookup_kwargs = {
'headers': {'Authorization': 'Token token="{}"'.format(token)}, 'headers': {'Authorization': 'Token token="{}"'.format(token)},
@@ -79,9 +78,10 @@ def conjur_backend(**kwargs):
} }
# https://www.conjur.org/api.html#secrets-retrieve-a-secret-get # https://www.conjur.org/api.html#secrets-retrieve-a-secret-get
path = urljoin(url, '/'.join(['secrets', account, 'variable', secret_path])) path = urljoin(url, '/'.join(['api', 'secrets', account, 'variable', secret_path]))
if version: if version:
path = '?'.join([path, version]) ver = "version={}".format(version)
path = '?'.join([path, ver])
with CertFiles(cacert) as cert: with CertFiles(cacert) as cert:
lookup_kwargs['verify'] = cert lookup_kwargs['verify'] = cert
@@ -90,4 +90,4 @@ def conjur_backend(**kwargs):
return resp.text return resp.text
conjur_plugin = CredentialPlugin('CyberArk Conjur Secret Lookup', inputs=conjur_inputs, backend=conjur_backend) conjur_plugin = CredentialPlugin('CyberArk Conjur Secrets Manager Lookup', inputs=conjur_inputs, backend=conjur_backend)

View File

@@ -282,7 +282,7 @@ const mockInputSources = {
summary_fields: { summary_fields: {
source_credential: { source_credential: {
id: 20, id: 20,
name: 'CyberArk Conjur Secret Lookup', name: 'CyberArk Conjur Secrets Manager Lookup',
description: '', description: '',
kind: 'conjur', kind: 'conjur',
cloud: false, cloud: false,
@@ -301,7 +301,7 @@ const mockInputSources = {
summary_fields: { summary_fields: {
source_credential: { source_credential: {
id: 20, id: 20,
name: 'CyberArk Conjur Secret Lookup', name: 'CyberArk Conjur Secrets Manager Lookup',
description: '', description: '',
kind: 'conjur', kind: 'conjur',
cloud: false, cloud: false,

View File

@@ -36,14 +36,14 @@ const mockCredentialTypeDetail = {
url: '/api/v2/credential_types/20/', url: '/api/v2/credential_types/20/',
related: { related: {
named_url: named_url:
'/api/v2/credential_types/CyberArk Conjur Secret Lookup+external/', '/api/v2/credential_types/CyberArk Conjur Secrets Manager Lookup+external/',
credentials: '/api/v2/credential_types/20/credentials/', credentials: '/api/v2/credential_types/20/credentials/',
activity_stream: '/api/v2/credential_types/20/activity_stream/', activity_stream: '/api/v2/credential_types/20/activity_stream/',
}, },
summary_fields: { user_capabilities: { edit: false, delete: false } }, summary_fields: { user_capabilities: { edit: false, delete: false } },
created: '2020-05-18T21:53:35.398260Z', created: '2020-05-18T21:53:35.398260Z',
modified: '2020-05-18T21:54:05.451444Z', modified: '2020-05-18T21:54:05.451444Z',
name: 'CyberArk Conjur Secret Lookup', name: 'CyberArk Conjur Secrets Manager Lookup',
description: '', description: '',
kind: 'external', kind: 'external',
namespace: 'conjur', namespace: 'conjur',

View File

@@ -465,7 +465,7 @@
}, },
"created": "2020-05-18T21:53:35.370730Z", "created": "2020-05-18T21:53:35.370730Z",
"modified": "2020-05-18T21:54:05.436400Z", "modified": "2020-05-18T21:54:05.436400Z",
"name": "CyberArk AIM Central Credential Provider Lookup", "name": "CyberArk Central Credential Provider Lookup",
"description": "", "description": "",
"kind": "external", "kind": "external",
"namespace": "aim", "namespace": "aim",
@@ -546,7 +546,7 @@
}, },
"created": "2020-05-18T21:53:35.398260Z", "created": "2020-05-18T21:53:35.398260Z",
"modified": "2020-05-18T21:54:05.451444Z", "modified": "2020-05-18T21:54:05.451444Z",
"name": "CyberArk Conjur Secret Lookup", "name": "CyberArk Conjur Secrets Manager Lookup",
"description": "", "description": "",
"kind": "external", "kind": "external",
"namespace": "conjur", "namespace": "conjur",

View File

@@ -3,7 +3,7 @@
"type": "credential", "type": "credential",
"url": "/api/v2/credentials/1/", "url": "/api/v2/credentials/1/",
"related": { "related": {
"named_url": "/api/v2/credentials/CyberArk Conjur Secret Lookup++CyberArk Conjur Secret Lookup+external++/", "named_url": "/api/v2/credentials/CyberArk Conjur Secrets Manager Lookup+external++/",
"created_by": "/api/v2/users/1/", "created_by": "/api/v2/users/1/",
"modified_by": "/api/v2/users/1/", "modified_by": "/api/v2/users/1/",
"activity_stream": "/api/v2/credentials/1/activity_stream/", "activity_stream": "/api/v2/credentials/1/activity_stream/",
@@ -19,7 +19,7 @@
"summary_fields": { "summary_fields": {
"credential_type": { "credential_type": {
"id": 20, "id": 20,
"name": "CyberArk Conjur Secret Lookup", "name": "CyberArk Conjur Secrets Manager Lookup",
"description": "" "description": ""
}, },
"created_by": { "created_by": {
@@ -69,7 +69,7 @@
}, },
"created": "2020-05-19T12:51:36.956029Z", "created": "2020-05-19T12:51:36.956029Z",
"modified": "2020-05-19T12:51:36.956086Z", "modified": "2020-05-19T12:51:36.956086Z",
"name": "CyberArk Conjur Secret Lookup", "name": "CyberArk Conjur Secrets Manager Lookup",
"description": "", "description": "",
"organization": null, "organization": null,
"credential_type": 20, "credential_type": 20,

View File

@@ -52,7 +52,7 @@ options:
- The credential type being created. - The credential type being created.
- Can be a built-in credential type such as "Machine", or a custom credential type such as "My Credential Type" - Can be a built-in credential type such as "Machine", or a custom credential type such as "My Credential Type"
- Choices include Amazon Web Services, Ansible Galaxy/Automation Hub API Token, Centrify Vault Credential Provider Lookup, - Choices include Amazon Web Services, Ansible Galaxy/Automation Hub API Token, Centrify Vault Credential Provider Lookup,
Container Registry, CyberArk AIM Central Credential Provider Lookup, CyberArk Conjur Secret Lookup, Google Compute Engine, Container Registry, CyberArk Central Credential Provider Lookup, CyberArk Conjur Secret Lookup, Google Compute Engine,
GitHub Personal Access Token, GitLab Personal Access Token, GPG Public Key, HashiCorp Vault Secret Lookup, HashiCorp Vault Signed SSH, GitHub Personal Access Token, GitLab Personal Access Token, GPG Public Key, HashiCorp Vault Secret Lookup, HashiCorp Vault Signed SSH,
Insights, Machine, Microsoft Azure Key Vault, Microsoft Azure Resource Manager, Network, OpenShift or Kubernetes API Insights, Machine, Microsoft Azure Key Vault, Microsoft Azure Resource Manager, Network, OpenShift or Kubernetes API
Bearer Token, OpenStack, Red Hat Ansible Automation Platform, Red Hat Satellite 6, Red Hat Virtualization, Source Control, Bearer Token, OpenStack, Red Hat Ansible Automation Platform, Red Hat Satellite 6, Red Hat Virtualization, Source Control,

View File

@@ -14,7 +14,7 @@
credential: credential:
description: Credential for Testing Source description: Credential for Testing Source
name: "{{ src_cred_name }}" name: "{{ src_cred_name }}"
credential_type: CyberArk AIM Central Credential Provider Lookup credential_type: CyberArk Central Credential Provider Lookup
inputs: inputs:
url: "https://cyberark.example.com" url: "https://cyberark.example.com"
app_id: "My-App-ID" app_id: "My-App-ID"
@@ -58,7 +58,7 @@
credential: credential:
description: Credential for Testing Source Change description: Credential for Testing Source Change
name: "{{ src_cred_name }}-2" name: "{{ src_cred_name }}-2"
credential_type: CyberArk AIM Central Credential Provider Lookup credential_type: CyberArk Central Credential Provider Lookup
inputs: inputs:
url: "https://cyberark-prod.example.com" url: "https://cyberark-prod.example.com"
app_id: "My-App-ID" app_id: "My-App-ID"
@@ -92,7 +92,7 @@
credential: credential:
name: "{{ src_cred_name }}" name: "{{ src_cred_name }}"
organization: Default organization: Default
credential_type: CyberArk AIM Central Credential Provider Lookup credential_type: CyberArk Central Credential Provider Lookup
state: absent state: absent
register: result register: result
@@ -100,7 +100,7 @@
credential: credential:
name: "{{ src_cred_name }}-2" name: "{{ src_cred_name }}-2"
organization: Default organization: Default
credential_type: CyberArk AIM Central Credential Provider Lookup credential_type: CyberArk Central Credential Provider Lookup
state: absent state: absent
register: result register: result