-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: linus-sun <[email protected]>
- Loading branch information
Showing
13 changed files
with
210 additions
and
416 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Copyright 2024 The Sigstore Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# NOTE: This GHA should not be run concurrently. | ||
# TODO: Once the workflows for consistency check and identity monitor are fully split, | ||
# the consistency check workflow should no longer require a checkpoint file. | ||
|
||
name: Rekor Identity Monitor Template | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
once: | ||
default: true | ||
required: false | ||
type: boolean | ||
config: | ||
description: 'multiline yaml of configuration settings for identity monitor run' | ||
required: true | ||
type: string | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
detect-workflow: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # Needed to detect the current reusable repository and ref. | ||
outputs: | ||
repository: ${{ steps.detect.outputs.repository }} | ||
ref: ${{ steps.detect.outputs.ref }} | ||
steps: | ||
- name: Detect the repository and ref | ||
id: detect | ||
uses: slsa-framework/slsa-github-generator/.github/actions/detect-workflow-js@5a775b367a56d5bd118a224a811bba288150a563 # v2.0.0 | ||
|
||
monitor: | ||
runs-on: ubuntu-latest | ||
needs: [detect-workflow] | ||
steps: | ||
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 | ||
with: | ||
repository: ${{ needs.detect-workflow.outputs.repository }} | ||
ref: "${{ needs.detect-workflow.outputs.ref }}" | ||
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 | ||
with: | ||
go-version: '1.23' | ||
- name: Run identity monitor | ||
run: go run ./cmd/rekor_monitor --config ${{ inputs.config }} --once |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,13 @@ | |
Rekor Log Monitor provides an easy-to-use monitor to verify log consistency, | ||
that the log is immutability and append-only. Monitoring is critical to | ||
the transparency log ecosystem, as logs are tamper-evident but not tamper-proof. | ||
Rekor Log Monitor also provides a monitor to search for identities within a log, | ||
and send a list of found identities via various notification platforms. | ||
|
||
## Consistency check | ||
|
||
To run, create a GitHub Actions workflow that uses the | ||
[reusable monitoring workflow](https://github.com/sigstore/rekor-monitor/blob/main/.github/workflows/reusable_monitoring.yml). | ||
[consistency check workflow](https://github.com/sigstore/rekor-monitor/blob/main/.github/workflows/consistency_check.yml). | ||
It is recommended to run the log monitor every hour for optimal performance. | ||
|
||
Example workflow: | ||
|
@@ -46,6 +50,10 @@ Please read [this](https://github.com/google/re2/wiki/Syntax) for syntax referen | |
Note: The log monitor only starts monitoring from the latest checkpoint. If you want to search previous | ||
entries, you will need to query the log. | ||
|
||
To run, create a GitHub Actions workflow that uses the | ||
[identity monitoring workflow](https://github.com/sigstore/rekor-monitor/blob/main/.github/workflows/identity_monitor.yml). | ||
It is recommended to run the log monitor every hour for optimal performance. | ||
|
||
Example workflow below: | ||
|
||
``` | ||
|
@@ -66,26 +74,27 @@ jobs: | |
with: | ||
file_issue: true # Strongly recommended: Files an issue on monitoring failure | ||
artifact_retention_days: 14 # Optional, default is 14: Must be longer than the cron job frequency | ||
identities: | | ||
certIdentities: | ||
- certSubject: user@domain\.com | ||
- certSubject: otheruser@domain\.com | ||
issuers: | ||
- https://accounts\.google\.com | ||
- https://github\.com/login | ||
- certSubject: https://github\.com/actions/starter-workflows/blob/main/\.github/workflows/lint\.yaml@.* | ||
issuers: | ||
- https://token\.actions\.githubusercontent\.com | ||
subjects: | ||
- subject@domain\.com | ||
fingerprints: | ||
- A0B1C2D3E4F5 | ||
fulcioExtensions: | ||
build-config-uri: | ||
- https://example.com/owner/repository/build-config.yml | ||
customExtensions: | ||
- objectIdentifier: 1.3.6.1.4.1.57264.1.9 | ||
extensionValues: https://github.com/slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
config: | | ||
monitoredValues: | | ||
certIdentities: | ||
- certSubject: user@domain\.com | ||
- certSubject: otheruser@domain\.com | ||
issuers: | ||
- https://accounts\.google\.com | ||
- https://github\.com/login | ||
- certSubject: https://github\.com/actions/starter-workflows/blob/main/\.github/workflows/lint\.yaml@.* | ||
issuers: | ||
- https://token\.actions\.githubusercontent\.com | ||
subjects: | ||
- subject@domain\.com | ||
fingerprints: | ||
- A0B1C2D3E4F5 | ||
fulcioExtensions: | ||
build-config-uri: | ||
- https://example.com/owner/repository/build-config.yml | ||
customExtensions: | ||
- objectIdentifier: 1.3.6.1.4.1.57264.1.9 | ||
extensionValues: https://github.com/slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
``` | ||
|
||
In this example, the monitor will log: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.