Skip to content

afalahi/ErmeticGraphQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

ErmeticGraphQL

ErmeticGraphQL is a PowerShell module that provides a set of cmdlets for interacting with the Ermetic GraphQL API. It allows you to automate various operations related to user role assignments, folders, and more in the Ermetic platform.

Table of Contents

Introduction

The ErmeticGraphQL PowerShell module provides cmdlets for interacting with ErmeticGraphQL. It allows you to retrieve information about Cloud Providers, Findings, and user assignments. You can also configure and update the Ermetic connection settings.

Installation

You can install the ErmeticGraphQL module from the PowerShell Gallery using the following command:

Install-Module -Name ErmeticGraphQL

Prerequisites

  • PowerShell 5.1 or later.
  • Ermetic API credentials and access to the Ermetic platform.

Getting Started

  1. Import the ErmeticGraphQL module:

    Import-Module -Name ErmeticGraphQL
  2. Set up the module configuration with your Ermetic API token and URI:

    Set-ErmeticConfig -Token "your_api_token" -Uri "https://api.ermetic.com"

    Replace "your_api_token" with your actual Ermetic API token.

  3. Start using the ErmeticGraphQL cmdlets to interact with the Ermetic platform.

Available Cmdlets

The ErmeticGraphQL module provides the following cmdlets:

  • Set-ErmeticConfig: Sets the Ermetic module configurations with new values for the Token and URI.
  • Update-ErmeticConfig: Updates the Ermetic module configurations with new values for the token and URI.
  • Get-ErmeticAwsAccounts: Retrieves All, Valid, or Invalid AWS Account and their connection status.
  • Get-ErmeticUsersAssignments: Retrieves user assignments for all users in the Ermetic platform.

Set-ErmeticConfig

Connects to the ErmeticGraphQL API with the provided access token.

Set-ErmeticConfig -Token 'your-access-token' -Uri "https://us.app.ermetic.com/api/graph"

Parameters

-Token

Type: string
Parameter Sets: (All)
Aliases:

Require: True
Position: Named
Default Value: None
Accept pipeline input: False
Accept wildcard characters: False

-Uri

Filters the AWS accounts based on their status.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Update-ErmeticConfig

Updates the Ermetic module configurations with new values for the token and URI.

# Only update the token
Update-ErmeticConfig -Token 'new-token'

# Only update the url
Update-ErmeticConfig -Uri 'https://new-uri.com'

# Update both token and url
Update-ErmeticConfig -Token 'new-token' -Uri 'https://new-uri.com'

Parameters

-Token

Type: string
Parameter Sets: (All)
Aliases:

Require: False
Position: Named
Default Value: None
Accept pipeline input: False
Accept wildcard characters: False

-Uri

Filters the AWS accounts based on their status.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Get-ErmeticAwsAccounts

Retrieves All, Valid, or Invalid AWS Account and their connection status. This Cmdlet returns a custom object unless specified with -NoOutPut Parameter

# Retrieve all AWS accounts
Get-ErmeticAwsAccounts

# Retrieve only valid AWS accounts
Get-ErmeticAwsAccounts -Filter 'Valid'

# Retrieve only invalid AWS accounts
Get-ErmeticAwsAccounts -Filter 'Invalid'

# Export the results to a CSV file
Get-ErmeticAwsAccounts -CSV -Filter 'Valid'

Parameters

-CSV

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Require: False
Position: Named
Default Value: None
Accept pipeline input: False
Accept wildcard characters: False

-Filter

Filters the AWS accounts based on their status.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: All
Accepted Values: All, Valid, Invalid
Accept pipeline input: False
Accept wildcard characters: False

Get-ErmeticUserAssignments

Retrieves all user assignments from Ermetic in csv or json format, or returns PSCustomObject.

# Retrieve user assignments and return as PSCustomObject
Get-ErmeticUserAssignments

# Retrieve user assignments and export the results to a CSV file
Get-ErmeticUserAssignments -CSV

# Retrieve user assignments and export the results to a JSON file
Get-ErmeticUserAssignments -JSON

Parameters

-CSV

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-JSON

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

You can find detailed usage examples and parameters for each cmdlet in their respective help documentation. Use the Get-Help cmdlet followed by the cmdlet name to view the help documentation.

Contributing

Contributions to the ErmeticGraphQL module are welcome! If you encounter any issues, have suggestions, or want to contribute improvements, please create an issue or submit a pull request on the GitHub repository.

License

This project is licensed under the Apache License.

Acknowledgements

The ErmeticGraphQL module is developed and maintained by [Ali Falahi].


About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published