libZSservicesZSamazonka-secretsmanagerZSamazonka-secretsmanager
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.SecretsManager.ValidateResourcePolicy

Description

Validates that the resource policy does not grant a wide range of IAM principals access to your secret. The JSON request string input and response output displays formatted code with white space and line breaks for better readability. Submit your input as a single line JSON string. A resource-based policy is optional for secrets.

The API performs three checks when validating the secret:

  • Sends a call to Zelkova, an automated reasoning engine, to ensure your Resource Policy does not allow broad access to your secret.
  • Checks for correct syntax in a policy.
  • Verifies the policy does not lock out a caller.

Minimum Permissions

You must have the permissions required to access the following APIs:

  • secretsmanager:PutResourcePolicy
  • secretsmanager:ValidateResourcePolicy
Synopsis

Creating a Request

data ValidateResourcePolicy Source #

See: newValidateResourcePolicy smart constructor.

Constructors

ValidateResourcePolicy' 

Fields

  • secretId :: Maybe Text

    (Optional) The identifier of the secret with the resource-based policy you want to validate. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.

    For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.

  • resourcePolicy :: Text

    A JSON-formatted string constructed according to the grammar and syntax for an Amazon Web Services resource-based policy. The policy in the string identifies who can access or manage this secret and its versions. For information on how to format a JSON parameter for the various command line tool environments, see Using JSON for Parameters in the CLI User Guide.publi

Instances

Instances details
Eq ValidateResourcePolicy Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

Read ValidateResourcePolicy Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

Show ValidateResourcePolicy Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

Generic ValidateResourcePolicy Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

Associated Types

type Rep ValidateResourcePolicy :: Type -> Type #

NFData ValidateResourcePolicy Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

Methods

rnf :: ValidateResourcePolicy -> () #

Hashable ValidateResourcePolicy Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

ToJSON ValidateResourcePolicy Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

AWSRequest ValidateResourcePolicy Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

Associated Types

type AWSResponse ValidateResourcePolicy #

ToHeaders ValidateResourcePolicy Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

ToPath ValidateResourcePolicy Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

ToQuery ValidateResourcePolicy Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

type Rep ValidateResourcePolicy Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

type Rep ValidateResourcePolicy = D1 ('MetaData "ValidateResourcePolicy" "Amazonka.SecretsManager.ValidateResourcePolicy" "libZSservicesZSamazonka-secretsmanagerZSamazonka-secretsmanager" 'False) (C1 ('MetaCons "ValidateResourcePolicy'" 'PrefixI 'True) (S1 ('MetaSel ('Just "secretId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "resourcePolicy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)))
type AWSResponse ValidateResourcePolicy Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

newValidateResourcePolicy Source #

Create a value of ValidateResourcePolicy with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:secretId:ValidateResourcePolicy', validateResourcePolicy_secretId - (Optional) The identifier of the secret with the resource-based policy you want to validate. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.

For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.

$sel:resourcePolicy:ValidateResourcePolicy', validateResourcePolicy_resourcePolicy - A JSON-formatted string constructed according to the grammar and syntax for an Amazon Web Services resource-based policy. The policy in the string identifies who can access or manage this secret and its versions. For information on how to format a JSON parameter for the various command line tool environments, see Using JSON for Parameters in the CLI User Guide.publi

Request Lenses

validateResourcePolicy_secretId :: Lens' ValidateResourcePolicy (Maybe Text) Source #

(Optional) The identifier of the secret with the resource-based policy you want to validate. You can specify either the Amazon Resource Name (ARN) or the friendly name of the secret.

For an ARN, we recommend that you specify a complete ARN rather than a partial ARN.

validateResourcePolicy_resourcePolicy :: Lens' ValidateResourcePolicy Text Source #

A JSON-formatted string constructed according to the grammar and syntax for an Amazon Web Services resource-based policy. The policy in the string identifies who can access or manage this secret and its versions. For information on how to format a JSON parameter for the various command line tool environments, see Using JSON for Parameters in the CLI User Guide.publi

Destructuring the Response

data ValidateResourcePolicyResponse Source #

See: newValidateResourcePolicyResponse smart constructor.

Constructors

ValidateResourcePolicyResponse' 

Fields

Instances

Instances details
Eq ValidateResourcePolicyResponse Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

Read ValidateResourcePolicyResponse Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

Show ValidateResourcePolicyResponse Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

Generic ValidateResourcePolicyResponse Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

Associated Types

type Rep ValidateResourcePolicyResponse :: Type -> Type #

NFData ValidateResourcePolicyResponse Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

type Rep ValidateResourcePolicyResponse Source # 
Instance details

Defined in Amazonka.SecretsManager.ValidateResourcePolicy

type Rep ValidateResourcePolicyResponse = D1 ('MetaData "ValidateResourcePolicyResponse" "Amazonka.SecretsManager.ValidateResourcePolicy" "libZSservicesZSamazonka-secretsmanagerZSamazonka-secretsmanager" 'False) (C1 ('MetaCons "ValidateResourcePolicyResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "validationErrors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe [ValidationErrorsEntry])) :*: (S1 ('MetaSel ('Just "policyValidationPassed") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

newValidateResourcePolicyResponse Source #

Create a value of ValidateResourcePolicyResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:validationErrors:ValidateResourcePolicyResponse', validateResourcePolicyResponse_validationErrors - Returns an error message if your policy doesn't pass validatation.

$sel:policyValidationPassed:ValidateResourcePolicyResponse', validateResourcePolicyResponse_policyValidationPassed - Returns a message stating that your Reource Policy passed validation.

$sel:httpStatus:ValidateResourcePolicyResponse', validateResourcePolicyResponse_httpStatus - The response's http status code.

Response Lenses

validateResourcePolicyResponse_validationErrors :: Lens' ValidateResourcePolicyResponse (Maybe [ValidationErrorsEntry]) Source #

Returns an error message if your policy doesn't pass validatation.

validateResourcePolicyResponse_policyValidationPassed :: Lens' ValidateResourcePolicyResponse (Maybe Bool) Source #

Returns a message stating that your Reource Policy passed validation.