Skip to content

Commit d255743

Browse files
committed
Update pipeline security
1 parent f3220e0 commit d255743

File tree

6 files changed

+336
-59
lines changed

6 files changed

+336
-59
lines changed

.github/workflows/Continuous.yml

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,81 @@ on:
88
branches:
99
- main
1010
release:
11-
types: [created]
11+
types:
12+
- created
13+
14+
permissions:
15+
contents: read
16+
packages: none
17+
id-token: none
18+
attestations: none
1219

1320
jobs:
14-
ubuntu-latest:
15-
name: ubuntu-latest
16-
runs-on: ubuntu-latest
21+
build:
22+
name: Build & Push
23+
runs-on: ubuntu-24.04
24+
25+
permissions:
26+
contents: read
27+
packages: write
28+
id-token: write
29+
attestations: write
30+
1731
steps:
18-
- uses: actions/checkout@v4
32+
33+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
1934
with:
2035
fetch-depth: 0
36+
2137
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
22-
uses: actions/cache@v4
38+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
2339
with:
2440
path: |
2541
.nuke/temp
2642
~/.nuget/packages
2743
key: ${{ runner.os }}-${{ hashFiles('**/global.json', '**/*.csproj', '**/Directory.Packages.props') }}
44+
45+
- name: Cache Trivy DB
46+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
47+
with:
48+
path: .trivy-cache
49+
key: ${{ runner.os }}-trivy-cache
50+
2851
- name: 'Run: Push'
2952
run: ./build.cmd Push
3053
env:
3154
FeedGitHubToken: ${{ secrets.FEED_GITHUB_TOKEN }}
3255
NuGetApiKey: ${{ secrets.NUGET_API_KEY }}
56+
3357
- name: Report Coveralls
34-
uses: coverallsapp/github-action@v2
58+
uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b
59+
3560
- name: 'Publish: Artifacts'
36-
uses: actions/upload-artifact@v4
61+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
3762
with:
3863
name: Artifacts
3964
path: Artifacts
65+
66+
# Upload the Software Bill of Materials (SBOM) for this build, to enable downstream trust/analysis
67+
- name: Upload SBOM
68+
if: >
69+
(github.event_name == 'release') ||
70+
(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'dendrodocs/dotnet-shared-lib')
71+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
72+
with:
73+
name: SBOM
74+
path: Sbom/_manifest/spdx_2.2/manifest.spdx.json
75+
76+
# Use GitHub's attest-sbom action to cryptographically tie the SBOM to the artifacts + their checksums
77+
# (SLSA provenance proof, can be verified by downstream consumers)
78+
- name: Attest SBOM
79+
if: >
80+
(github.event_name == 'release') ||
81+
(github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'dendrodocs/dotnet-shared-lib')
82+
uses: actions/attest-sbom@bd218ad0dbcb3e146bd073d1d9c6d78e08aa8a0b
83+
with:
84+
sbom-path: Sbom/_manifest/spdx_2.2/manifest.spdx.json
85+
subject-path: |
86+
Artifacts/*.nupkg
87+
Artifacts/*.snupkg
88+
subject-checksums: Artifacts/SHA256SUMS

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,9 @@ paket-files/
263263
*.sln.iml
264264
pub/
265265

266-
**/launchSettings.json
266+
**/launchSettings.json
267+
268+
.trivy-cache
269+
.nuke/temp
270+
[Aa]rtifacts
271+
[Ss]bom

.nuke/build.schema.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,21 @@
2424
"ExecutableTarget": {
2525
"type": "string",
2626
"enum": [
27+
"Audit",
2728
"CalculateVersion",
2829
"Clean",
2930
"CodeCoverage",
3031
"Compile",
3132
"Pack",
33+
"Proof",
3234
"Push",
3335
"PushGithub",
3436
"PushNuget",
3537
"Restore",
36-
"UnitTests"
38+
"SbomDeliverable",
39+
"ScanSource",
40+
"UnitTests",
41+
"VerifyCleanGit"
3742
]
3843
},
3944
"Verbosity": {

.trivyignore.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vulnerabilities:
2+
- id: CVE-2025-26646
3+
statement: Microsoft.Build.Tasks.Core 17.11.31 is believed to be a fixed version, incorrectly not marked as such.

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ dendrodocs-analyze --solution G:\DendroDocs\dotnet-shared-lib\DendroDocs.Shared.
3636
The output of **DendroDocs.Tool** is a comprehensive JSON file that conforms to the schema defined in the [DendroDocs Schema](https://github.com/dendrodocs/schema).
3737
This JSON file provides a representation of your source code, which can be used to generate various types of documentation or integrate with other tools in your development pipeline.
3838

39+
## Security & Build Attestation
40+
41+
This library includes build attestation through GitHub's attest-build-provenance action, providing cryptographic proof of the build process and artifact integrity. Each published package includes verifiable provenance information that demonstrates:
42+
43+
* The exact repository and commit that built the artifacts
44+
* The GitHub Actions workflow that produced the packages
45+
* Cryptographic signatures ensuring artifact authenticity
46+
47+
This ensures that the packages you install have not been tampered with and came from the official DendroDocs build pipeline.
48+
3949
## The DendroDocs Ecosystem
4050

4151
**DendroDocs.Tool** is part of the broader DendroDocs ecosystem.

0 commit comments

Comments
 (0)