You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/blog/posts/2024-11-15-release-v0.14.0.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,18 +15,18 @@ In this release, we have put together some nice features:
15
15
16
16
Keeping your environments secure is key these days. For container images, scanning them is widely adopted. Shipwright now performs a shift left of those scans by incorporating image scanning into the image build itself. We'll ensure that a vulnerable image never makes it into your container registry (though, you'd still have to re-scan it regularly to determine when it becomes vulnerable). This is a great safeguard for example against base images you consume in your Dockerfile that suddenly are not updated anymore.
17
17
18
-
You can read more about it in the separate blog post [Building Secure Container images with Shipwright](2024-07-15-vulnerability-scanning.md).
18
+
You can read more about it in the separate blog post [Building Secure Container images with Shipwright](../../../07/15/building-secure-container-images-with-shipwright).
19
19
20
20
### Parameters in the CLI
21
21
22
-
The Shipwright CLI finally received the first support for [build parameters](../../docs/build/build.md#defining-paramvalues). You can use the `--param-value` argument to provide values for strategy parameters such as the Go version and Go flags in our [ko sample build strategy](https://github.com/shipwright-io/build/blob/v0.14.0/samples/v1beta1/buildstrategy/ko/buildstrategy_ko_cr.yaml#L8-L13) like this: `shp build create my-app --param-value go-version=1.23 --param-value go-flags=-mod=vendor`.
22
+
The Shipwright CLI finally received the first support for [build parameters](../../../../../docs/build/build#defining-paramvalues). You can use the `--param-value` argument to provide values for strategy parameters such as the Go version and Go flags in our [ko sample build strategy](https://github.com/shipwright-io/build/blob/v0.14.0/samples/v1beta1/buildstrategy/ko/buildstrategy_ko_cr.yaml#L8-L13) like this: `shp build create my-app --param-value go-version=1.23 --param-value go-flags=-mod=vendor`.
23
23
24
24
### The smaller but still nice things
25
25
26
26
Often the small changes are what help you, here are some:
27
27
28
28
* If a step in your BuildRun goes out of memory, then it is now easier to determine that as the BuildRun status will have `StepOutOfMemory` as reason.
29
-
* A [new sample build strategy](https://github.com/shipwright-io/build/blob/v0.14.0/samples/v1beta1/buildstrategy/multiarch-native-buildah/buildstrategy_multiarch_native_buildah_cr.yaml) has been added which orchestrates a multi-arch build using Kubernetes Jobs. See [our documentation](https://github.com/shipwright-io/build/blob/v0.14.0/docs/buildstrategies.md#multi-arch-native-buildah) for more information.
29
+
* A [new sample build strategy](https://github.com/shipwright-io/build/blob/v0.14.0/samples/v1beta1/buildstrategy/multiarch-native-buildah/buildstrategy_multiarch_native_buildah_cr.yaml) has been added which orchestrates a multi-arch build using Kubernetes Jobs. See [our documentation](../../../../../docs/build/buildstrategies#multi-arch-native-buildah) for more information.
30
30
* We started to implement node selection properties on Builds and BuildRuns with [node selector support](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector). Tolerations are planned to be added in v0.15.
31
31
* As usual, we have done our due diligence. DependaBot helped us to keep our dependencies secure. We are now building with Go 1.22. Kubernetes and Tekton dependencies have been updated. We are also in the process of establishing automation across our repositories that gives us a GitHub issue once our latest release becomes vulnerable. You'll probably see more patch releases in the future where we keep our release free of vulnerabilities.
Copy file name to clipboardExpand all lines: content/en/docs/build/authentication.md
+19-16Lines changed: 19 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,15 @@
1
1
---
2
2
title: Authentication during builds
3
+
weight: 40
3
4
---
4
5
5
6
The following document provides an introduction around the different authentication methods that can take place during an image build when using the Build controller.
-[Authentication for Git](#authentication-for-git)
10
-
-[Basic authentication](#basic-authentication)
11
11
-[SSH authentication](#ssh-authentication)
12
+
-[Basic authentication](#basic-authentication)
12
13
-[Usage of git secret](#usage-of-git-secret)
13
14
-[Authentication to container registries](#authentication-to-container-registries)
14
15
-[Docker Hub](#docker-hub)
@@ -17,7 +18,7 @@ The following document provides an introduction around the different authenticat
17
18
18
19
## Overview
19
20
20
-
There are two places where users might need to define authentication when building images. Authentication to a container registry is the most common one, but also users might have the need to define authentications for pulling source-code from Git. Overall, the authentication is done via the definition of [secrets](https://kubernetes.io/docs/concepts/configuration/secret/) in which the require sensitive data will be stored.
21
+
There are two places where users might need to define authentication when building images. Authentication to a container registry is the most common one, but also users might have the need to define authentications for pulling source-code from Git. Overall, the authentication is done via the definition of [secrets](https://kubernetes.io/docs/concepts/configuration/secret/) in which the required sensitive data will be stored.
21
22
22
23
## Build Secrets Annotation
23
24
@@ -74,7 +75,10 @@ data:
74
75
The Basic authentication is very similar to the ssh one, but with the following differences:
75
76
76
77
- The Kubernetes secret should be of the type `kubernetes.io/basic-auth`
77
-
- The `stringData` should host your user and password in clear text.
78
+
- The `stringData` should host your user and personal access token in clear text.
79
+
80
+
Note: GitHub and GitLab no longer accept account passwords when authenticating Git operations.
81
+
Instead, you must use token-based authentication for all authenticated Git operations. You can create your own personal access token on [GitHub](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) and [GitLab](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html).
78
82
79
83
```yaml
80
84
apiVersion: v1
@@ -86,7 +90,7 @@ metadata:
86
90
type: kubernetes.io/basic-auth
87
91
stringData:
88
92
username: <cleartext username>
89
-
password: <cleartext password>
93
+
password: <cleartext token>
90
94
```
91
95
92
96
### Usage of git secret
@@ -98,29 +102,29 @@ Depending on the secret type, there are two ways of doing this:
@@ -146,18 +150,17 @@ _Notes:_ The value of `PASSWORD` can be your user docker hub password, or an acc
146
150
### Usage of registry secret
147
151
148
152
With the right secret in place (_note: Ensure creation of secret in the proper Kubernetes namespace_), users should reference it on their Build YAML definitions.
149
-
For container registries, the secret should be placed under the `spec.output.credentials` path.
153
+
For container registries, the secret should be placed under the `spec.output.pushSecret` path.
@@ -35,6 +40,7 @@ A `Build` resource allows the user to define:
35
40
- env
36
41
- retention
37
42
- volumes
43
+
- nodeSelector
38
44
39
45
A `Build` is available within a namespace.
40
46
@@ -99,7 +105,7 @@ The `Build` definition supports the following fields:
99
105
-[`kind`](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields) - Specifies the Kind type, for example `Build`.
100
106
-[`metadata`](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields) - Metadata that identify the custom resource instance, especially the name of the `Build`, and in which [namespace](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) you place it. **Note**: You should use your own namespace, and not put your builds into the shipwright-build namespace where Shipwright's system components run.
101
107
-`spec.source` - Refers to the location of the source code, for example a Git repository or OCI artifact image.
102
-
-`spec.strategy` - Refers to the `BuildStrategy` to be used, see the [examples](../samples/v1beta1/buildstrategy)
108
+
-`spec.strategy` - Refers to the `BuildStrategy` to be used, see the [examples](https://github.com/shipwright-io/build/tree/v0.14.0/samples/v1beta1/buildstrategy)
103
109
-`spec.output`- Refers to the location where the generated image would be pushed.
104
110
-`spec.output.pushSecret`- Reference an existing secret to get access to the container registry.
105
111
@@ -113,12 +119,14 @@ The `Build` definition supports the following fields:
113
119
- Use string `SourceTimestamp` to set the image timestamp to the source timestamp, i.e. the timestamp of the Git commit that was used.
114
120
- Use string `BuildTimestamp` to set the image timestamp to the timestamp of the build run.
115
121
- Use any valid UNIX epoch seconds number as a string to set this as the image timestamp.
122
+
-`spec.output.vulnerabilityScan` to enable a security vulnerability scan for your generated image. Further options in vulnerability scanning are defined [here](#defining-the-vulnerabilityscan)
116
123
-`spec.env` - Specifies additional environment variables that should be passed to the build container. The available variables depend on the tool that is being used by the chosen build strategy.
117
124
-`spec.retention.atBuildDeletion` - Defines if all related BuildRuns needs to be deleted when deleting the Build. The default is false.
118
125
-`spec.retention.ttlAfterFailed` - Specifies the duration for which a failed buildrun can exist.
119
126
-`spec.retention.ttlAfterSucceeded` - Specifies the duration for which a successful buildrun can exist.
120
127
-`spec.retention.failedLimit` - Specifies the number of failed buildrun that can exist.
121
128
-`spec.retention.succeededLimit` - Specifies the number of successful buildrun can exist.
129
+
-`spec.nodeSelector` - Specifies a selector which must match a node's labels for the build pod to be scheduled on that node.
122
130
123
131
### Defining the Source
124
132
@@ -127,7 +135,7 @@ A `Build` resource can specify a source type, such as a Git repository or an OCI
127
135
-`source.type` - Specify the type of the data-source. Currently, the supported types are "Git", "OCIArtifact", and "Local".
128
136
-`source.git.url` - Specify the source location using a Git repository.
129
137
-`source.git.cloneSecret` - For private repositories or registries, the name references a secret in the namespace that contains the SSH private key or Docker access credentials, respectively.
130
-
-`source.git.revision` - A specific revision to select from the source repository, this can be a commit, tag or branch name. If not defined, it will fallback to the Git repository default branch.
138
+
-`source.git.revision` - A specific revision to select from the source repository, this can be a commit, tag or branch name. If not defined, it will fall back to the Git repository default branch.
131
139
-`source.contextDir` - For repositories where the source code is not located at the root folder, you can specify this path here.
132
140
133
141
By default, the Build controller does not validate that the Git repository exists. If the validation is desired, users can explicitly define the `build.shipwright.io/verify.repository` annotation with `true`. For example:
@@ -262,12 +270,12 @@ spec:
262
270
263
271
A `Build` resource can specify the `BuildStrategy` to use, these are:
Defining the strategy is straightforward. You define the `name` and the `kind`. For example:
273
281
@@ -284,7 +292,7 @@ spec:
284
292
285
293
### Defining ParamValues
286
294
287
-
A `Build` resource can specify _paramValues_ for parameters that are defined in the referenced `BuildStrategy`. You specify these parameter values to control how the steps of the build strategy behave. You can overwrite values in the `BuildRun` resource. See the related [documentation](./buildrun.md#defining-params) for more information.
295
+
A `Build` resource can specify _paramValues_ for parameters that are defined in the referenced `BuildStrategy`. You specify these parameter values to control how the steps of the build strategy behave. You can overwrite values in the `BuildRun` resource. See the related [documentation](../buildrun#defining-paramvalues) for more information.
288
296
289
297
The build strategy author can define a parameter as either a simple string or an array. Depending on that, you must specify the value accordingly. The build strategy parameter can be specified with a default value. You must specify a value in the `Build` or `BuildRun` for parameters without a default.
290
298
@@ -299,7 +307,7 @@ In general, _paramValues_ are tightly bound to Strategy _parameters_. Please mak
299
307
300
308
#### Example
301
309
302
-
The [BuildKit sample `BuildStrategy`](../samples/v1beta1/buildstrategy/buildkit/buildstrategy_buildkit_cr.yaml) contains various parameters. Two of them are outlined here:
310
+
The [BuildKit sample `BuildStrategy`](https://github.com/shipwright-io/build/tree/v0.14.0/samples/v1beta1/buildstrategy/buildkit/buildstrategy_buildkit_cr.yaml) contains various parameters. Two of them are outlined here:
303
311
304
312
```yaml
305
313
apiVersion: shipwright.io/v1beta1
@@ -594,6 +602,48 @@ spec:
594
602
timestamp: SourceTimestamp
595
603
```
596
604
605
+
### Defining the vulnerabilityScan
606
+
607
+
`vulnerabilityScan`provides configurations to run a scan for your generated image.
608
+
609
+
- `vulnerabilityScan.enabled`- Specify whether to run vulnerability scan for image. The supported values are true and false.
610
+
- `vulnerabilityScan.failOnFinding`- indicates whether to fail the build run if the vulnerability scan results in vulnerabilities. The supported values are true and false. This field is optional and false by default.
611
+
- `vulnerabilityScan.ignore.issues`- references the security issues to be ignored in vulnerability scan
612
+
- `vulnerabilityScan.ignore.severity` - denotes the severity levels of security issues to be ignored, valid values are:
613
+
- `low`: it will exclude low severity vulnerabilities, displaying only medium, high and critical vulnerabilities
614
+
- `medium`: it will exclude low and medium severity vulnerabilities, displaying only high and critical vulnerabilities
615
+
- `high`: it will exclude low, medium and high severity vulnerabilities, displaying only the critical vulnerabilities
616
+
- `vulnerabilityScan.ignore.unfixed`- indicates to ignore vulnerabilities for which no fix exists. The supported types are true and false.
617
+
618
+
Example of user specified image vulnerability scanning options:
0 commit comments