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

Power shell modules connection manager #3

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

rleon-thales
Copy link
Collaborator

No description provided.

To Domain Module:
Cleaned up params. Removed pipelines. Cleaned up error handling. Added a few params.
Cleaned up params. Removed pipelines. Cleaned up error handling. Added a few params.
Cleaned up params. Removed pipelines. Cleaned up error handling.
Cleaned up params. Removed pipelines. Cleaned up error handling.
-Added new module for ConnMgr-Elastic Search.
-Added new cmdlet ConnMgr-Main - Generate a Connection CSR.
-Made tweaks to $body variables made them [ordered] for easier readability and predictability.
-Tried out adding some enum to variables. Also employing ValidateSet param for parameters that are numbers or have dashes.
-Created Google Connection module
-Found a bug in CMConnCSR cmdlet. Fixed
-Fixed a some typos.
-Created new module for CM to DSM Connections.
-Changed clear-text variable name in Elasticsearch module to bypass warnings. ES Module still has secure method of passing credentials.
-Fixed bug in Info module. Set-CMName was set to POST instead of PATCH.
-was copying copy from module to module and wanted to cleanup indentations on the help data
-also added a few missing examples
-Also fixed some typos.
-Remove private key demo from GCP Connection example
-Found errors in Elasticsearch Module due to using it as template for Loki.
-Added new module for adding Luna HSM Servers
-Cleaned up some code in the Loki module.
-Made some fixes to the Clear-CMRefreshTokens cmdlet to NOT delete web-ui tokens.
-Added "ps_module" label to all tokens generated by the collections.
-Finished Luna HSM Connections (Partitions) module of API Playground
-Added  "Connection not found" error to all Remove-<connection> commands.
-Renamed Module Folder for Connection Manager from:
Connections\
to
ConnectionsMgr\
-New Module: ConnectionMgr: Luna STC Partitions
-New Module: ConnectionMgr: LDAP for CTE
-New Module: ConnectionMgr: OIDC for CTE
-Added Complete Module for Identity Provider Management. /v1/usermgmt/connections/*
-Added overlooked help text in a previous module.
-Updated README
-LDAP and OIDC IdP Module
-Connection Manager Oracle module
-Connection Manager SAP Module
-Updated README.md
-Fixed typos in SAP module.
-Added SCP Module
-Added SMB Module
-Updated README.md
-Connection Manager: Syslog Log Forwarder
-Found minor issue during code review.
-Added Connection Manager: Salesforce Module
-Fixed an example in a previous module.
@@ -0,0 +1,960 @@
#######################################################################################################################
# File: CipherTrustManager-ConnectionMgr-Loki.psm1 #
Copy link
Contributor

@anugram anugram May 16, 2024

Choose a reason for hiding this comment

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

file name need to be fixed... looks like the intention is to implement Loki.

# File: CipherTrustManager-ConnectionMgr-Loki.psm1 #
# Author: Rick Leon, Professional Services #
# Publisher: Thales Group #
# Copyright: (c) 2023 Thales Group. All rights reserved. #
Copy link
Contributor

Choose a reason for hiding this comment

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

Copyright year can be updated

Copy link
Contributor

@anugram anugram May 16, 2024

Choose a reason for hiding this comment

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

I am slightly confused with the purpose and placement of this file. Shouldn't this be inside the folder CipherTrustManager. and also it seems to be a duplicate of ...
/CipherTrustManager/ConnectionsMgr
/CipherTrustManager-ConnectionMgr-LunaHSMConnection.psm1

I am skipping the review of this file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That file shouldn’t be there. we can delete. I didn’t realize it was going to publish that far down. I forgot it was there.

Write-Debug "Start: $($MyInvocation.MyCommand.Name)"

Write-Debug "Getting a List of all LDAP Connections in CM"
$endpoint = $CM_Session.REST_URL + $target_uri
Copy link
Contributor

Choose a reason for hiding this comment

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

$target_uri is set to "/usermgmt/connections"...
there is also an API for listing all external identity providers /auth/id-providers

I am assuming in this module we are just referring to OIDC/LDAP based identities associated with user management tile.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Feels like the /autg/id-prividers section oft he playground only has to do with actually authenticating people. not "managing" the connections themselves.

return "Missing LDAPS Certificate. Please try again."
}
if($root_ca_file){
$root_cas = Get-Content -Path $root_ca_file -raw -ErrorAction Stop
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking aloud here... can we do or do we need to validate the CA cert here to fail fast in case of a bad cert? Before hitting the CM API... I do not even know if we need to do this...just a thought

return $response
}

#Connection Manager - Connections (IdP)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to replace (IdP) with (LDAP)?

.EXAMPLE
PS> New-CMAWSConnection -name MyTestAWSConnection2 -description "This is my Test AWS Connection" -access_key_id abc123abc123 -secret_access_key xyz987xyz987 -assume_role_arn "arn:aws:iam::123456789012:user/johndoe" -assume_role_external_id EXT_ROLE_ID -aws_region us-west-1 -aws_sts_regional_endpoints regional -cloud_name aws-us-gov -metadata "red:stop,:green:go,blue:ocean"
.EXAMPLE
PS> New-CMAWSConnection -name MyTestAWSConnection3 -description "This is my Test AWS Connection" -assume_role_arn "arn:aws:iam::123456789012:user/johndoe" -assume_role_external_id EXT_ROLE_ID -aws_region us-west-1 -aws_sts_regional_endpoints regional -cloud_name aws-us-gov -is_role_anywhere -anywhere_role_arn "arn:aws:iam::123456789012:user/johndoe" -anywhere_role_certfile mongocert.pem -anywhere_role_keyfile mongokey.pem -anywhere_profile_arn "arn:aws:iam::123456789012:user" -anywhere_trust_anchor_arn "arn:aws:iam::123456789012:user/johndoe" -metadata "red:stop,green:go,blue:ocean"
Copy link
Contributor

Choose a reason for hiding this comment

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

someday, we would love to add examples of how you can do the same with secrets in CSM instead of directly passing them as string-based args... someday :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that would definitely be cool

@@ -27,8 +27,8 @@ public enum CM_TokensGrantTypes {
$target_uri = "/auth/tokens"
$target_revoke_uri = "/auth/revoke"
$target_selfdomain_uri = "/auth/self/domains"
$target_authkey_uri = "/auth/auth-key"
$target_authkey_rotation_uri = "/auth/rotate-auth-key"
#$target_authkey_uri = "/auth/auth-key"
Copy link
Contributor

Choose a reason for hiding this comment

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

if we are not gonna need them, can we just remove them?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess. I didn't add those initially, they were already there. I can double check, but yeah... if we don't need them in the module, we could drop them.

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.

None yet

3 participants