Skip to content

Commit

Permalink
Improve getting started documentation (#1561)
Browse files Browse the repository at this point in the history
- Fix typos
- Make repository deletion instructions consistent
- Avoid getting "profile already exists" error when enabling remediation
  • Loading branch information
eleftherias authored Nov 7, 2023
1 parent bb8c63f commit 60004c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
8 changes: 5 additions & 3 deletions docs/docs/getting_started/first_profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ minder profile_status list --profile github-profile --detailed
## Viewing alerts

Disable secret scanning in one of the registered repositories, by following
[these instructions provided by GitHub](https://docs.github.com/en/code-security/secret-scanning/configuring-secret-scanning-for-your-repositories):
[these instructions provided by GitHub](https://docs.github.com/en/code-security/secret-scanning/configuring-secret-scanning-for-your-repositories).

Navigate to the repository on GitHub, click on the Security tab and view the Security Advisories.
Notice that there is a new advisory titled `minder: profile github-profile failed with rule secret_scanning`.
Expand All @@ -103,8 +103,10 @@ Navigate to the repository on GitHub, click on the Security tab and view the Sec
Notice that the advisory titled `minder: profile github-profile failed with rule secret_scanning` is now closed.

## Delete registered repositories
If you wish to delete a registered repository, you can do so with the following command:
If you want to stop monitoring a repository, you can delete it from Minder by using the `repo delete` command:
```bash
minder repo delete -n $REPO_NAME --provider github
minder repo delete --provider github --name $REPO_NAME
```
where `$REPO_NAME` is the fully-qualified name (`owner/name`) of the repository you wish to delete, for example `testorg/testrepo`.

This will delete the repository from Minder and remove the webhook from the repository.
14 changes: 7 additions & 7 deletions docs/docs/getting_started/remediations.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In [Creating your first profile](./first_profile.md), we wrote a rule to open a
security advisory when repo configuration drifted from the configured profile
in Minder. In this tutorial, we will show how Minder can automatically
resolve the misconfiguration and ensure that enrolled repos have secret
scanning enabled. Secret scanning isone of several settings which can be
scanning enabled. Secret scanning is one of several settings which can be
managed by Minder. When you apply a Minder profile to enrolled repositories,
it will remediate (fix) the setting if it is changed to violate the profile.

Expand All @@ -19,20 +19,20 @@ it will remediate (fix) the setting if it is changed to violate the profile.
* [A Minder account](./login.md)
* [An enrolled GitHub token](./login.md#enrolling-the-github-provider) that is either an Owner in the organization or an Admin on the repositories
* [A registered repository in Minder](./first_profile.md#register-repositories)
* [The `secret_scanning`` rule type](./first_profile.md#creating-and-applying-profiles)
* [The `secret_scanning` rule type](./first_profile.md#creating-and-applying-profiles)
* [A policy to open security advisories when secret scanning is off](./first_profile.md#creating-and-applying-profiles)

## Creating a profile with `remediate: on`

Minder doesn't currently support editing profiles, so we will create a new profile with `remediate: on`.

Edit the YAML file of the [profile from the secret-scanning tutorial](./first_profile.md#creating-and-applying-profiles)
and set the `remediate` attribute to `on`:
Create a new file called `profile-remediate.yaml`.
Paste the following profile definition into the newly created file, setting the `remediate` attribute to `on`:
```yaml
---
version: v1
type: profile
name: github-profile
name: github-profile-remediate
context:
provider: github
alert: "on"
Expand All @@ -45,12 +45,12 @@ repository:
Create the profile in Minder:
```
minder profile create -f profile.yaml
minder profile create -f profile-remediate.yaml
```

Check the status of the profile:
```
minder profile_status list --profile github-profile
minder profile_status list --profile github-profile-remediate
```

With remediation on, the profile status should be "Success" when the repository has been updated to match the profile.
Expand Down

0 comments on commit 60004c0

Please sign in to comment.