Skip to content

Scps

Tips on using SCPs

Additional examples:

# deny the usage of imdsv1
data "aws_iam_policy_document" "deny_imdsv1" {
  statement {
    sid    = "DenyIMDSv1"
    effect = "Deny"

    actions = [
      "*",
    ]

    resources = [
      "*",
    ]

    condition {
      test     = "NumericLessThan"
      variable = "ec2:RoleDelivery"
      values   = ["2.0"]
    }
  }
}
# deny creating public secrets
data "aws_iam_policy_document" "deny_public_secrets" {
  statement {
    sid    = "DenyPublicSecrets"
    effect = "Deny"

    actions = [
      "secretsmanager:PutResourcePolicy",
    ]

    resources = [
      "*",
    ]

    condition {
      test     = "Bool"
      variable = "secretsmanager:BlockPublicPolicy"
      values   = ["false"]
    }
  }
}

Visualization and Management