Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 93958ba

Browse files
committed
Checks -> Policy. Remove GraphQL
1 parent dbd77c7 commit 93958ba

File tree

11 files changed

+40
-140
lines changed

11 files changed

+40
-140
lines changed

docs/getting-started.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Atomist for DevSecOps is available in early access now.
1+
Atomist for DevSecOps is available in early access now.
22
Keep up to date with supported, current Docker base images and keep new vulnerabilities at bay.
33

44
[early-access]: https://atomist.com/devsecops (Request early access)
55

6-
To get up and running quickly, simply sign up, select repositories, then get a summary of your
6+
To get up and running quickly, simply sign up, select repositories, then get a summary of your
77
Docker security and start improving it.
88

99
### Create an account
@@ -18,7 +18,7 @@ Docker security and start improving it.
1818

1919
### Configure Image Registry
2020

21-
Start scanning images in your registry by enabling a [Registry Integration](https://dso.atomist.com/r/auth/integrations).
21+
Start scanning images in your registry by enabling a [Registry Integration](https://dso.atomist.com/r/auth/integrations).
2222
Specific instructions about each integration are included below.
2323

2424
| Integration | link to documentation |
@@ -61,8 +61,8 @@ Atomist is now tracking new container images. This includes updates to bills of
6161

6262
Teams use Atomist to protect downstream workloads from new vulnerabilities. It's also used to help teams track and remediate new vulnerabilities that impact existing workloads. In the next sections, we'll look at how teams can use atomist to gain visibility into container workload systems like Kubernetes.
6363

64-
* [Set up Checks](getting_started/checks.md) that will run whenever a new Image is pushed to your registry
64+
* [Set up Image Policies](getting_started/checks.md) with rules that will run whenever a new Image is pushed to your registry
6565
* [Create a Slack notification channel](integration/slack.md) to receive notifications about new security advisories impacting workloads.
6666
* Atomist watches for new advisories from [public sources](getting_started/sources.md), but you can also add your own internal advisories. Checkout how to [get started with your own advisories](getting_started/private-advisories.md).
67-
* Use [kubernetes admission control](integration/kubernetes.md) to ensure that images are fully checked before being admitted into different clusters or namespaces.
68-
* Try adding another check to add [secret scanning](getting_started/add-secret-scanner-check.md) to make sure that the sources used to build an image are always scanned for leaked secrets.
67+
* Use [kubernetes admission control](integration/kubernetes.md) to ensure that images conform to your policy before being admitted into different clusters or namespaces.
68+
* Try adding another rule to add [secret scanning](getting_started/add-secret-scanner-check.md) to make sure that the sources used to build an image are always scanned for leaked secrets.
Lines changed: 8 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,21 @@
1-
## Adding code Secret Scanning GitHub check
1+
## Adding code Secret Scanning GitHub Check
22

33
### Overview
44

55
Prevent leaking API keys, access tokens, passwords and other sensitive data by keeping them out of your codebase. Secret Scanner detects and alerts you when secrets are committed in your code and configuration in a GitHub repository. It helps prevent secrets from being exposed by adding a failed GitHub Check when a secret is detected.
66

7+
GitHub Checks like this one can be used as Image Policy Rules to protect workloads (e.g. Kubernetes Admission Control).
8+
79
Secret Scanner automatically scans for access and API keys for Twitter, Facebook, Google, Stripe, Square, PayPal, AWS, Twilio, Mailchimp, Mailgun and Picatic API. Secret Scanner supports adding patterns to detect other secrets not detected by default. Add scanning support for other tools with a simple regular expression.
810

911
### Configuration
1012

11-
Enable the Secret Scanner [here](https://go.atomist.com/catalog/skills/atomist/github-secret-scanner-skill), selecting the repositories for which you would like a a created.
12-
13-
Add `github/github-secret-scanner-skill` to your Image Policy by following the instructions for [image checks](checks.md)
14-
15-
### Configuration via GraphQL
16-
17-
It's also possible to configure Secret Scanning via the GraphQL api.
18-
19-
Save the following GraphQL snippet to a file
20-
21-
```shell
22-
cat <<'EOF' > secrets.graphql
23-
mutation enableSecretScanner {
24-
saveSkillConfiguration(name: "github-secret-scanner-skill",
25-
namespace: "atomist",
26-
configuration: {
27-
name: "default",
28-
parameters: [{
29-
repoFilter: {
30-
name: "repos",
31-
value: {}}}],
32-
enabled: true}) {__typename}}
33-
EOF
34-
```
35-
36-
And use `curl` to send to the Atomist API.
37-
38-
Now execute the script below. You’ll need to set the TEAM and the API_KEY to your `workspace-id` and an `api-key`.
39-
40-
```shell
41-
ATOMIST_API_KEY=<api-key>
42-
ATOMIST_WORKSPACE_ID=<workspace-id>
43-
44-
curl -X POST \
45-
-d '{"query": "'"$(sed 's/"/\\"/g' < secrets.graphql)"'" }' \
46-
-H "Authorization: Bearer ${ATOMIST_API_KEY}" \
47-
-H "Content-Type: application/json" \
48-
https://automation.atomist.com/graphql/team/${ATOMIST_WORKSPACE_ID}
49-
```
50-
51-
* `workspace-id`
52-
* Grab your workspace ID from https://dso.atomist.com/r/auth/policies
53-
* `api-key`
54-
* Used to authenticate with the Atomist API and managed here https://dso.atomist.com/r/auth/integrations
55-
56-
#### Adding to Image Policy
13+
Enable the Secret Scanner [here](https://dso.atomist.com/r/auth/policies)
5714

58-
To add this check to your Image Policy for an environment, it's just a case of adding the `github-secret-scanner-skill` GitHub check to the policy as configured at [Image Checks](checks.md). For example, if your policy previously looked like this:
15+
![enable-check-run](../img/getting-started/enable-secret-scanning.png)
5916

60-
```shell
61-
cat <<'EOF' > rules.json
62-
{"rules": ["demo/production:github/docker-vulnerability-policy"]}
63-
EOF
64-
```
17+
Add Secret Scanning to your Image Policy by following the instructions for [configuring image policy rules](checks.md).
6518

66-
requiring secret scanning in the `demo/production` policy would look like:
19+
Once configured, the policy should looking like this:
6720

68-
```shell
69-
cat <<'EOF' > rules.json
70-
{"rules": ["demo/production:github/docker-vulnerability-policy",
71-
"demo/production:github/github-secret-scanner-skill"]}
72-
EOF
73-
```
21+
![configured-policy](../img/getting-started/configured-policy.png)

docs/getting_started/checks.md

Lines changed: 11 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,35 @@
11
### Background
22

3-
Atomist keeps tracks of checks that are performed on container images. Examples of checks include the following.
3+
Atomist keeps track of the state of container images by continuously evaluating rules in your Image Policy. For example:
44

55
* Does the image have the required `LABEL`s?
66
* Was the image created by a trusted builder?
77
* Was the image created from a known git commit sha?
88
* Has the image been scanned for vulnerabilities?
99
* Does the image contain any vulnerabilities that are not already present in the currently running version?
1010

11-
Each workload can define a set of mandatory checks. This allows Atomist to wait for a new image to have all the necessary checks and then signal to a workload that a new candidate version is ready. This works well with a gitops workflow where new candidate images can be pulled into a workload once they are ready. Failing checks are made available to developers to indicate why a change was rejected, and these same checks drive tools like kubernetes admission controllers, to ensure that only fully checked images are admitted to selected namespaces. The combination of gitops controllers, admission controllers, and pluggable image checks, gives teams the ability to plug consistent validation into their cloud native delivery.
11+
Each workload can define a set of mandatory rules. This allows Atomist to wait for a new image to have all the necessary rules satisifed and then signal to a workload that a new candidate version is ready. This works well with a gitops workflow where new candidate images can be pulled into a workload once they are ready. Failing rules can be made available to developers via GitHub Checks to indicate why a change was rejected, and these same rules drive tools like kubernetes admission controllers, to ensure that only images that fully satisfy your policy are admitted to selected namespaces. The combination of gitops controllers, admission controllers, and pluggable image policy, gives teams the ability to plug consistent validation into their cloud native delivery.
1212

13-
### Enable Vulnerability Check
13+
### Enable Vulnerability GitHub Check
1414

1515
Start by checking whether a candidate image has additional vulnerabilities when compared to other versions already in existing workloads. If you're building an image from a pull request commit, this policy will also compare vulnerabilites against any image built from the HEAD commit of your default branch. [Enable the policy][settings] by navigating to your [settings page][settings].
1616

17-
In the section called `New Image Vulnerabilites`, select the check box that controls whether a GitHub check run should fail when _new_ critical or high severitare found.
17+
In the section called `New Image Vulnerabilites`, select the check box that controls whether a GitHub Check should fail when _new_ critical or high severitare found.
1818

1919
![enable-check-run](../img/getting-started/enable-check-run.png)
2020

21-
[settings]: https://dso.atomist.com/r/auth/policies
22-
23-
### Choose Admission Checks
24-
25-
Now that we are checking images for new vulnerabilities, we can begin requiring that certain sets of checks pass before an image is ready to be admitted into an existing workload (for example, see the [section on kubernetes admission control](admission-control.md)). We can select different checks for different environments. For example, let's start with the requirement that a kubernetes cluster named `demo` with a namespace `production` requires the check configured above.
26-
27-
This can be done by editing the [Deployment Policy](https://go.atomist.com/r/auth/manage/integrations/s/l/atomist/deploy-integration) and adding:
28-
29-
`demo/production:github/docker-vulnerability-policy` to the list of checks in the **Image Policy**:
3021

31-
![image-policy-checks](../img/image-policy-checks.png)
3222

33-
#### Configuration via GraphQL
23+
### Choose Admission Rules
3424

35-
We can also configure by calling a GraphQL mutation. Copy the following mutation into a file (e.g. rules.json)
25+
Policies are made up of sets of rules. Atomist comes with some built-in rules, but GitHub Checks can also be used directly as rules in policies. This makes it easy to compose policies from GitHub Checks created by other processes, such as CI/CD systems, to ensure for example, that images have been properly tested, that commits have been signed and so on.
3626

37-
```bash
38-
cat <<'EOF' > rules.json
39-
{"rules": ["demo/production:github/docker-vulnerability-policy"]}
40-
EOF
41-
```
27+
Now that we are checking images for new vulnerabilities, we can begin requiring that certain sets of rules pass before an image is ready to be admitted into an existing workload (for example, see the [section on kubernetes admission control](admission-control.md)). We can select different rules for different environments. For example, let's start with the requirement that a Kubernetes cluster named `demo` with a namespace `production` requires the GitHub Check configured above.
4228

43-
Now execute the scripts below:
29+
From the [policy view][settings], click the "Add first deployment policy" and and add the new GitHub Check we created above:
4430

45-
```bash
46-
ATOMIST_WORKSPACE_ID=<workspace-id>
47-
ATOMIST_API_KEY=<api-key>
48-
```
49-
50-
* `workspace-id`
51-
* Grab your workspace ID from https://dso.atomist.com/r/auth/policies
52-
* `api-key`
53-
* Used to authenticate with the Atomist API and managed here https://dso.atomist.com/r/auth/integrations
54-
55-
56-
```bash
57-
cat <<'EOF' > policy.graphql
58-
mutation setPolicy($rules: [String!]!) {
59-
setConfigurationParameter(
60-
name: "deploy-integration",
61-
namespace: "atomist",
62-
parameter: {stringArray:
63-
{name: "check-names",
64-
value: $rules}},
65-
configurationName: "policy-cfg")
66-
{
67-
configured {
68-
skills {id}
69-
}
70-
}
71-
}
72-
EOF
73-
74-
curl -X POST \
75-
-d '{"query": "'"$(sed 's/"/\\"/g' < policy.graphql)"'", "variables": '"$(< rules.json)"'}' \
76-
-H "Authorization: Bearer ${ATOMIST_API_KEY}" \
77-
-H "Content-Type: application/json" \
78-
https://automation.atomist.com/graphql/team/${ATOMIST_WORKSPACE_ID}
79-
```
31+
![add-first-policy](../img/getting-started/add-first-policy.png)
8032

33+
![configure-policy](../img/getting-started/configure-new-policy.png)
8134

35+
[settings]: https://dso.atomist.com/r/auth/policies
14.1 KB
Loading

docs/integration/deploys.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Tracking Image Deployments
22

3-
Atomist compares recent image vulnerabilty scans against the scans of images that are currently deployed.
3+
Atomist compares recent image vulnerabilty scans against the scans of images that are currently deployed.
44
This level of tracking gives developers contexts about when security debt is both increasing and decreasing. This can be integrated in several ways:
55

66
* steps in continuous deployment pipelines
@@ -16,7 +16,7 @@ Each Atomist workspace exposes an endpoint that can be called whenever an Image
1616
!!! Note
1717
you must create an api-key to use this endpoint.
1818

19-
The simplest form of interation is to call this api whenever a new image is deployed. The default environment name is `deployed` - if you want to image scans, and GitHub checkruns to start comparing against a "deployed" image, then call:
19+
The simplest form of interation is to call this api whenever a new image is deployed. The default environment name is `deployed` - if you want to image scans, and GitHub Checks to start comparing against a "deployed" image, then call:
2020

2121
```
2222
$ curl \\
@@ -48,7 +48,6 @@ The payload supports additional fields to support additional use cases.
4848
}
4949
```
5050

51-
* use custom environment names to track different image versions in environments like `staging` and `production`
51+
* use custom environment names to track different image versions in environments like `staging` and `production`
5252
* multi-platform image manifest lists are supported. Add the platform details for the environments. Vulnerability scans are dependent on the platform.
5353
* if you are deploying multiple images from the same container repository into one environment, it is mandatory that each `image` have a unique `name`.
54-

docs/integration/kubernetes.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ url=<replace this>
3232
team=<replace this>
3333
```
3434

35-
The `apiKey` and `url` must be filled in with your values from your Atomist workspace. You can find these values in the [integrations tab](https://dso.atomist.com/r/auth/integrations).
35+
The `apiKey` and `url` must be filled in with your values from your Atomist workspace. You can find these values in the [integrations tab](https://dso.atomist.com/r/auth/integrations).
3636
You'll also need your the id for your atomist `team`. This is the nine character value that you'll find at the top of [this page](https://dso.atomist.com/r/auth/policies).
3737

3838
![workspace id](./img/kubernetes/settings.png)
@@ -93,10 +93,10 @@ kubectl apply -f resources/k8s/admission/admission.yaml
9393
kubectl apply -f resources/k8s/jobs/patch.yaml
9494
```
9595

96-
## Enable image check policy
96+
## Enable Image Policy
9797

9898
The admission controller will still be admitting all pods. Reject pods with un-checked images by enabling the policy one namespace at a time.
99-
For example, start verifying that new pods in namespace `production` must have passed all necessary checks by annotating the namespace with the
99+
For example, start verifying that new pods in namespace `production` must have passed all necessary rules by annotating the namespace with the
100100
annotation `policy-controller.atomist.com/policy`.
101101

102102
```bash
@@ -110,4 +110,3 @@ kubectl annotate namespace production policy-controller.atomist.com/policy-
110110
```
111111

112112
[dynamic-admission-control]: https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/
113-

docs/tutorials/docker-vulnerability-policy.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
## Policy: Docker Vulnerability
44

5-
We'll start by enabling the
5+
We'll start by enabling the
66
[Docker Vulnerability Policy](https://go.atomist.com/catalog/skills/atomist/docker-vulnerability-policy?stability=unstable).
77
This policy illustrates how data can effectively flow back to developers to help make better decisions about promoting
88
change. There are several concepts involved:
99

10-
1. using Checks to push data back to developers
10+
1. using GitHub Checks to push data back to developers
1111
2. using Checks to inform github branch protection rules, and code reviews
1212
3. setting baselines for cases where we want to start "improving" (reducing "noise" for existing projects)
13-
4. integrating vulnerability data into GitOps promotion, and kubernetes admission control policies
13+
4. integrating vulnerability data into GitOps promotion, and kubernetes admission control policies
1414

1515
As usual, the first step is to [enable the policy][docker-vulnerability-policy].
1616

1717
![img/docker-vulnerability-policy/14.png](img/docker-vulnerability-policy/14.png)
1818

1919
For this policy, you should also be able to enable it using the default settings. The default settings use GitHub
20-
checks to ensure that image vulnerabilties in a development branch do not get "worse" than the ones already in main.
20+
Checks to ensure that image vulnerabilties in a development branch do not get "worse" than the ones already in main.
2121

2222
[docker-vulnerabilty-policy]: https://go.atomist.com/catalog/skills/atomist/docker-vulnerability-policy?stability=unstable

0 commit comments

Comments
 (0)