Skip to content

Commit

Permalink
Refactor Guardrails-Samples repo to Guardrails-Tools
Browse files Browse the repository at this point in the history
Change required for these directories:
- api-examples
- aws_account_delete
- env_health_checks
- installation
- migration
- mod_examples
- repo-tools
- workspace_usage
  • Loading branch information
Joeturbot committed Jul 8, 2024
1 parent fbca2d1 commit c4b1ae6
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion docs/7-minute-labs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Written profile 'default' to '/Users/TestUser/.config/turbot/credentials.yml'

This command will generate a `default` profile and add it to your Turbot Guardrails
credentials file. The Turbot Guardrails Terraform provider and
[scripts in the Guardrails Samples Repo](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients)
[scripts in the Guardrails Samples Repo](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients)
can use the Turbot Guardrails CLI credentials file.

### Login
Expand Down
2 changes: 1 addition & 1 deletion docs/7-minute-labs/graphql/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,5 +349,5 @@ smart folder.

- [Turbot GraphQL API Reference](reference/graphql)
- [Turbot Filter Language Reference](reference/filter)
- [Turbot Guardrails GraphQL Examples in Samples Repo](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/queries)
- [Turbot Guardrails GraphQL Examples in Samples Repo](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/queries)
- [Introduction to GraphQL](https://graphql.org/learn/)
2 changes: 1 addition & 1 deletion docs/enterprise/FAQ/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ Guardrails will automatically copy the tags applied to the Service Catalog Turbo
7. When the TEF stack has finished updating, switch over to the Guardrails console.
8. The Type Installed controls are responsible for deploying the SNS topics and Lambda functions that execute each control. They are also responsible for copying the tags from the TEF stack.
9. Run all the `Turbot > Mod > Installed` controls at 5 minute intervals. This will download the zip file that holds the Lambda code. The zip file must be present in order to run the Type Installed controls. Running a `Turbot > Mod > Installed` control automatically reruns the `Turbot > Type Installed` controls for that mod.
- The easiest way to run all the Turbot > Mod > Installed controls is with the run_controls_batches script found in the [Guardrails-Samples Repo](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/python/run_controls_batches).
- The easiest way to run all the Turbot > Mod > Installed controls is with the run_controls_batches script found in the [Guardrails-Samples Repo](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/python/run_controls_batches).
- `python run_controls_batches.py -b 1 -d 300 --filter "controlTypeId:'tmod:@turbot/turbot#/control/types/modInstalled'"`
10. Some `Turbot > Type Installed` controls may be in an `error` state with an error message like "Rate Exceeded". Rerun those Type Installed controls.
- `python run_controls_batches.py -b 10 -d 60 --filter "controlTypeId:'tmod:@turbot/turbot#/control/types/controlInstalled' state:error"`
2 changes: 1 addition & 1 deletion docs/enterprise/FAQ/redis-caching/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,5 @@ hive user-group.

Guardrails Bastion host comes with all the pre-requisites installed in order to
connect to RDS/Redis. Please refer to the
[README](https://github.com/turbot/guardrails-samples/tree/master/installation/turbot_bastion_host)
[README](https://github.com/turbot/guardrails-tools/tree/master/installation/turbot_bastion_host)
for instructions and usage.
4 changes: 2 additions & 2 deletions docs/enterprise/restore/disaster-recovery-exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ aim is to restore this (almost) empty schema with the data from backup.
database match those of the original database.
4. Once the temp DB is created from the snapshot, note the endpoint.
5. Launch a
[Turbot Bastion Host](https://github.com/turbot/guardrails-samples/tree/master/installation/turbot_bastion_host).
[Turbot Bastion Host](https://github.com/turbot/guardrails-tools/tree/master/installation/turbot_bastion_host).
6. Run the
[migration script](https://github.com/turbot/guardrails-samples/tree/master/migration/turbot-schema-migration)
[migration script](https://github.com/turbot/guardrails-tools/tree/master/migration/turbot-schema-migration)
which will copy the DB schema from the restored database to the actual
database.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ If you have changed/corrected any of the above settings, wait ~15 min for the ev

If all of the above settings are verified, and events are still not being received by Guardrails, it is possible that the internal representation of the event handler infrastructure is out of sync with current state.

You can use a [script](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/python/run_controls) from the [Guardrails Samples Repo](https://github.com/turbot/guardrails-samples) to get your environment back in-sync. Running this script will catch any new, altered or destroyed Event Handler resources across the entire workspace. Clone the repo locally and follow the readme for how to set up your environment. Once setup you can use the following filter to synchronize Guardrails' CMDB with the current state of resources in AWS:
You can use a [script](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/python/run_controls) from the [Guardrails Samples Repo](https://github.com/turbot/guardrails-samples) to get your environment back in-sync. Running this script will catch any new, altered or destroyed Event Handler resources across the entire workspace. Clone the repo locally and follow the readme for how to set up your environment. Once setup you can use the following filter to synchronize Guardrails' CMDB with the current state of resources in AWS:
```shell
python3 run_controls.py --profile {workspace_profile} --filter "sort:-stateChangeTimestamp controlCategoryId:'tmod:@turbot/turbot#/control/categories/cmdb' resourceTypeId:'tmod:@turbot/aws-sns#/resource/types/topic','tmod:@turbot/aws-sns#/resource/types/subscription','tmod:@turbot/aws-events#/resource/types/rule','tmod:@turbot/aws-events#/resource/types/target'" --execute
```
Expand Down
6 changes: 3 additions & 3 deletions docs/faq/general-faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ sure to keep an eye out for new mod versions!
Install `firehose-aws-sns` mod on your workspace and a service user for the
email. Refer to the [Guardrails Firehose](guides/firehose) guide for more
information. A full configuration script can be found in the
[Guardrails Samples](https://github.com/turbot/guardrails-samples/tree/master/mod_examples/firehose-aws-sns/setup/terraform).
[Guardrails Samples](https://github.com/turbot/guardrails-tools/tree/master/mod_examples/firehose-aws-sns/setup/terraform).

## Is there a way to create a Guardrails File in the console?

Expand Down Expand Up @@ -226,7 +226,7 @@ Yes! This can be accomplished by a GraphQL query or
and [AwsCredentials](reference/graphql/object/AwsCredentials) information,
Guardrails will respond with an access and secret access key. This can be done via a
preferred scripting language - you can find additional scripting examples on our
[Guardrails Samples](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients).
[Guardrails Samples](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients).

Refer to
[AWS IAM documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html)
Expand Down Expand Up @@ -366,7 +366,7 @@ In rare circumstances, attempting to delete an AWS account can result in a
timeout. This is usually due to a large amount of resources within an account.
To delete large accounts, a delete account script lives in the Guardrails Samples Repo.

- [Guardrails AWS account delete script](https://github.com/turbot/guardrails-samples/tree/master/aws_account_delete)
- [Guardrails AWS account delete script](https://github.com/turbot/guardrails-tools/tree/master/aws_account_delete)

Be sure to change the Guardrails data resource `deleteThisAwsAccount` id value to
the arn of the account that must be deleted.
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started/activity-exceptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ This concludes the guided tour of Guardrails! We highly recommend reviewing addi
- Turbot Guardrails Firehose (Watch):
- [Firehose Guide](guides/firehose)
- [Building Notifications Pipelines](guides/firehose/pipelines)
- [Setting up Firehose Using Terraform](https://github.com/turbot/guardrails-samples/tree/master/mod_examples/firehose-aws-sns/setup/terraform)
- [Setting up Firehose Using Terraform](https://github.com/turbot/guardrails-tools/tree/master/mod_examples/firehose-aws-sns/setup/terraform)
- Turbot Guardrails Hierarchy and Folders:
- [Resource Hierarchy Concepts](concepts/resources/hierarchy)
- [Folder Guide](guides/working-with-folders)
Expand All @@ -104,7 +104,7 @@ This concludes the guided tour of Guardrails! We highly recommend reviewing addi

### Developer Focused

- [Additional Guardrails Samples](https://github.com/turbot/guardrails-samples/tree/master/api_examples)
- [Additional Guardrails Samples](https://github.com/turbot/guardrails-tools/tree/master/api_examples)
- [Turbot Guardrails Terraform in 7 Minutes](7-minute-labs/terraform)
- [Turbot Guardrails CLI](reference/cli)
- [GraphQL with Turbot Guardrails CLI](7-minute-labs/cli#query-turbot-with-turbot-graphql)
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Develop a plan for some or all of the following:
- How new policies will be rolled out.
- How developers & engineers will get exceptions to policies.
- How to remediate out-of-compliance resources in legacy Production accounts.
- How to run a short and fast feedback loop between remediation actions and informing the affected party what happened and why. This often involves notifications, ticketing and dashboard systems. Guardrails' GraphQL API provides considerable power to get the information your enterprise needs. The Guardrails Samples Repo has plenty of [GraphQL examples](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql) for controls and notifications.
- How to run a short and fast feedback loop between remediation actions and informing the affected party what happened and why. This often involves notifications, ticketing and dashboard systems. Guardrails' GraphQL API provides considerable power to get the information your enterprise needs. The Guardrails Samples Repo has plenty of [GraphQL examples](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql) for controls and notifications.
- How to make it easy for devs and engineers to look up information about active policies.
- What policies are enforced
- What policies are checked
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/firehose/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Notification generated by change on a resource, control, policy, etc -> Watch Fi

The following steps cover how to manually install and configure the mod. If
Terraform is preferred, use this
[mod example](https://github.com/turbot/guardrails-samples/tree/master/mod_examples/firehose-aws-sns/setup/terraform)
[mod example](https://github.com/turbot/guardrails-tools/tree/master/mod_examples/firehose-aws-sns/setup/terraform)
for steps 2 - 5 and creating the Guardrails Firehose.

1. Install the mod into the workspace if not already installed. See
Expand Down Expand Up @@ -501,7 +501,7 @@ Notification generated (resource, control, policy, etc) -> Watch -> Render the N
Key, Access Secret.
- If the Firehose was configured manually, have you configured all the same
resources as created by the Firehose Terraform in the
[Guardrails Samples Repo](https://github.com/turbot/guardrails-samples/tree/master/mod_examples/firehose-aws-sns/setup/terraform)?
[Guardrails Samples Repo](https://github.com/turbot/guardrails-tools/tree/master/mod_examples/firehose-aws-sns/setup/terraform)?

### Firehose Watches

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/firehose/pipelines/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,5 @@ Refer to the Cloudwatch logs for `/aws/lambda/turbot-turbotfirehoseawssnssender-

## Reference
- [Firehose Installation Instructions](/guardrails/docs/mods/turbot/firehose-aws-sns#setup): Basic overview and capabilities
- [Firehose Terraform Bootstrap](https://github.com/turbot/guardrails-samples/tree/master/mod_examples/firehose-aws-sns/setup/terraform): Terraform for setting up the SNS topic then configuring the appropriate Guardrails policies. Requires AWS and Guardrails credentials to execute.
- [Firehose Terraform Bootstrap](https://github.com/turbot/guardrails-tools/tree/master/mod_examples/firehose-aws-sns/setup/terraform): Terraform for setting up the SNS topic then configuring the appropriate Guardrails policies. Requires AWS and Guardrails credentials to execute.
- [Firehose Notification Templates](/guardrails/docs/mods/turbot/firehose-aws-sns/policy#turbot--firehose--aws-sns--notification-template): Each Notification type has a template. These can be altered to include or exclude required information. These templates exclusively alter the formatting and included info that is sent to the Firehose SNS topic. Be conservative with changes here.
2 changes: 1 addition & 1 deletion docs/guides/iam/administrators/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Guardrails allows administrators to set a custom minimum password length for loc

## Setting Guardrails API Keys to expire

By default, Guardrails API keys do not expire. Passwords for users in the Guardrails Local directory expire by default at 365 days. Usually, the API keys for the break glass described above are method of last resort to get back into a workspace in the event of an emergency. The [Password Reset](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/queries/password_reset) queries in the Guardrails Samples Repo require API keys. These instructions describe a method for expiring all Guardrails API keys except the break glass user(s). A benefit of this approach is that it makes it easy to apply to one directory but not others.
By default, Guardrails API keys do not expire. Passwords for users in the Guardrails Local directory expire by default at 365 days. Usually, the API keys for the break glass described above are method of last resort to get back into a workspace in the event of an emergency. The [Password Reset](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/queries/password_reset) queries in the Guardrails Samples Repo require API keys. These instructions describe a method for expiring all Guardrails API keys except the break glass user(s). A benefit of this approach is that it makes it easy to apply to one directory but not others.

1. Use the "Aging Turbot Access Keys" report to get an idea of which keys this policy will deactivate. API keys in this report show all keys over 90 days of age, regardless of "Active" or "Inactive" status.
2. In the Terraform below, adjust the regex to match the break glass user(s). Make additional changes to the calc policy as required.
Expand Down
8 changes: 4 additions & 4 deletions docs/integrations/aws/import-aws-account/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,17 @@ integrating Guardrails into account onboarding pipelines.
- **Account Import Terraform**:
[account_import Terraform](https://github.com/turbot/guardrails-samples/tree/master/baselines/aws/aws_account_import)
- **Policies Stuck in TBD**: Use the
[run_policies](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/python/run_policies)
[run_policies](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/python/run_policies)
script with this filter to rerun policy values in `tbd`:
`--filter "resourceId:'<ARNofAccount>' state:tbd"`
- **Controls Stuck in TBD**: Use the
[run_controls](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/python/run_controls)
[run_controls](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/python/run_controls)
or
[run_controls_batches](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/python/run_controls_batches)
[run_controls_batches](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/python/run_controls_batches)
scripts with this filter to rerun controls in `tbd`:
`--filter "resourceId:'<ARNofAccount>' state:tbd"`
- **Event Handler Controls not in OK**: Use the Guardrails Samples
[run_controls_batches](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/python/run_controls_batches)
[run_controls_batches](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/python/run_controls_batches)
script with this filter:
`--filter "resourceId:'<ARNofAccount>' controlTypeId:'tmod:@turbot/aws#/control/types/eventHandlers','tmod:@turbot/aws-sns#/control/types/topicConfigured','tmod:@turbot/aws-sns#/control/types/subscriptionConfigured','tmod:@turbot/aws-event#s/control/types/targetConfigured','tmod:@turbot/aws-events#/control/types/ruleConfigured' state:tbd,error,invalid"`

Expand Down
6 changes: 3 additions & 3 deletions docs/integrations/gcp/import-gcp-project/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ may be a large number of Discovery controls in `error`. These can be resolved in
one of two ways. First, simply delete the project and reimport it with proper
credentials. Second, keep the project imported but rerun each control in `error`
using the run_controls scripts in the Guardrails Samples Repo available in
[Python](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/python/run_controls),
[Javascript](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/node/run-controls)
[Python](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/python/run_controls),
[Javascript](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/node/run-controls)
or
[shell](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/shell/run-controls).
[shell](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/shell/run-controls).
The filter of `state:error` to rerun all controls in `error`.

### GCP Service API Enabled policies aren't set
Expand Down
8 changes: 4 additions & 4 deletions docs/mods/guide/troubleshooting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ when installing or removing Azure and GCP mods.
- Identify any issues with **controls** in `tbd`, `error` or `invalid`.
Resolve any problems.
- Use the
[run_policy](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/python/run_policies)
[run_policy](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/python/run_policies)
and
[run_controls](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/python/run_controls)
[run_controls](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/python/run_controls)
scripts help a lot with resolving policy values and controls stuck in
`tbd`.
- A healthy workspace has zero controls or policy values in `error` or
Expand Down Expand Up @@ -121,7 +121,7 @@ steps should be disregarded.
7. Let Guardrails clean up the resources. Time taken will depend on overall system
load, Guardrails configuration and the number of resources for that mod.
- Use the
[run_controls](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/python/run_controls)
[run_controls](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/python/run_controls)
script in the case where CMDB controls need a kick to finish cleaning
themselves up.
8. Verify that all resources for each mod have been removed from Guardrails. There
Expand Down Expand Up @@ -200,7 +200,7 @@ Let's break this down:
**Important Note**: This works well for new controls, but existing controls will
require a control run to adhere to the new, defined interval. We suggest running
all relevant resource controls which can be done all at once by utilizing a
[control run](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/python/run_controls)
[control run](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/python/run_controls)
script.

### **WARNING!!**
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/cli/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ credentials file. The default profile is used when you run the `turbot` command
without explicitly specifying a `--profile` .

The default location for the credentials file is referenced by the Turbot Guardrails CLI, the Turbot Guardrails Terraform
provider and the Python scripts in the [Guardrails Samples Repo](https://github.com/turbot/guardrails-samples/tree/master/api_examples/graphql/clients/python).
provider and the Python scripts in the [Guardrails Samples Repo](https://github.com/turbot/guardrails-tools/tree/master/api_examples/graphql/clients/python).

### Named Profiles

Expand Down
Loading

0 comments on commit c4b1ae6

Please sign in to comment.