Skip to content

Commit

Permalink
Merge branch 'main' into pv-pipeline-readiness-gates
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMcDermott authored Feb 25, 2025
2 parents 16917fa + 8303802 commit d42e4f6
Show file tree
Hide file tree
Showing 9 changed files with 192 additions and 163 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/openssf_scorecard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: OpenSSF Scorecard

# Declare default permissions as read only.
permissions: read-all

on:
schedule:
- cron: '30 1 * * 6'
push:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
analysis:
runs-on: ubuntu-latest
permissions:
security-events: write
id-token: write
steps:
- name: Checkout
uses: actions/[email protected]
with:
persist-credentials: false
- name: Run analysis
uses: ossf/[email protected]
with:
results_file: results.sarif
results_format: sarif
publish_results: true
- name: Upload artifact
uses: actions/[email protected]
with:
name: SARIF file
path: results.sarif
retention-days: 5
- name: Upload to code-scanning
uses: github/codeql-action/[email protected]
with:
sarif_file: results.sarif
token: ${{ secrets.GITHUB_TOKEN }}

54 changes: 54 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Security Policy

We're extremely grateful for security researchers and users that report vulnerabilities to the Nephio Open Source Community.
All reports are thoroughly investigated by a set of community volunteers.

The Nephio community has adopted the security disclosures and response policy below to respond to security issues.

Please do not report security vulnerabilities through public GitHub issues.

## Supported Versions

The following versions of Nephio project are currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| >=1.0 | :white_check_mark: |

## Reporting a Vulnerability

### When should you?
- You think you discovered a potential security vulnerability in Nephio.
- You are unsure how a vulnerability affects Nephio.
- You think you discovered a vulnerability in a dependency of Nephio. For those projects, please leverage their reporting policy.

### When you should not?
- You need assistance in configuring Nephio for security - please discuss this is in the [slack channel](https://nephio.slack.com/archives/C05UXLPF4V6).
- You need help applying security-related updates.
- Your issue is not security-related.

### Please use the process below to report a vulnerability to the project:
1. Email the **Nephio security group at [email protected]**

* Please include the information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of the source file(s) related to the manifestation of the issue
* Location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue

* This information will help us triage your report more quickly.

2. The project security team will send an initial response to the disclosure in 3-5 days. Once the vulnerability and fix are confirmed, the team will plan to release the fix based on the severity and complexity.

3. You may be contacted by a project maintainer to further discuss the reported item. Please bear with us as we seek to understand the breadth and scope of the reported problem, recreate it, and confirm if there is a vulnerability present.

## Security bulletins
For information regarding the security of this project please join our [slack channel](https://nephio.slack.com/archives/C05UXLPF4V6).

## Public Disclosure Timing
A public disclosure date is negotiated by the Nephio Security Response Committee and the bug submitter. We prefer to fully disclose the bug as soon as possible once a user mitigation is available. It is reasonable to delay disclosure when the bug or the fix is not yet fully understood, the solution is not well-tested, or for vendor coordination. The timeframe for disclosure is from immediate (especially if it's already publicly known) to a few weeks. For a vulnerability with a straightforward mitigation, we expect report date to disclosure date to be on the order of 7 days. The Nephio Security Response Committee holds the final say when setting a disclosure date.


122 changes: 0 additions & 122 deletions api/porchconfig/v1alpha1/config.porch.kpt.dev_repositories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,25 +115,6 @@ spec:
required:
- repo
type: object
mutators:
description: |-
`Mutators` specifies list of functions to be added to the list of package's mutators on changes to the packages in the repository to ensure the packages meet constraints
enforced by the mutators associated with the repository.
Based on the Kubernetest Admission Controllers (https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/). The functions will be evaluated
in the order specified in the list.
items:
properties:
configMap:
additionalProperties:
type: string
description: '`ConfigMap` specifies the function config (https://kpt.dev/reference/cli/fn/eval/).'
type: object
image:
description: '`Image` specifies the function image, such as
`gcr.io/kpt-fn/gatekeeper:v0.2`.'
type: string
type: object
type: array
oci:
description: OCI repository details. Required if `type` is `oci`.
Ignored if `type` is not `oci`.
Expand All @@ -158,109 +139,6 @@ spec:
type:
description: Type of the repository (i.e. git, OCI)
type: string
upstream:
description: |-
Upstream is the default upstream repository for packages in this
repository. Specifying it per repository allows simpler UX when
creating packages.
properties:
git:
description: Git repository details. Required if `type` is `git`.
Must be unspecified if `type` is not `git`.
properties:
branch:
default: main
description: Name of the branch containing the packages. Finalized
packages will be committed to this branch (if the repository
allows write access). If unspecified, defaults to "main".
minLength: 1
type: string
createBranch:
description: CreateBranch specifies if Porch should create
the package branch if it doesn't exist.
type: boolean
directory:
description: Directory within the Git repository where the
packages are stored. A subdirectory of this directory containing
a Kptfile is considered a package. If unspecified, defaults
to root directory.
type: string
repo:
description: |-
Address of the Git repository, for example:
`https://github.com/GoogleCloudPlatform/blueprints.git`
type: string
secretRef:
description: Reference to secret containing authentication
credentials.
properties:
name:
description: Name of the secret. The secret is expected
to be located in the same namespace as the resource
containing the reference.
type: string
required:
- name
type: object
required:
- repo
type: object
oci:
description: OCI repository details. Required if `type` is `oci`.
Must be unspecified if `type` is not `oci`.
properties:
registry:
description: Registry is the address of the OCI registry
type: string
secretRef:
description: Reference to secret containing authentication
credentials.
properties:
name:
description: Name of the secret. The secret is expected
to be located in the same namespace as the resource
containing the reference.
type: string
required:
- name
type: object
required:
- registry
type: object
repositoryRef:
description: RepositoryRef contains a reference to an existing
Repository resource to be used as the default upstream repository.
properties:
name:
description: Name of the Repository resource referenced.
type: string
required:
- name
type: object
type:
description: Type of the repository (i.e. git, OCI). If empty,
repositoryRef will be used.
type: string
type: object
validators:
description: |-
`Validators` specifies list of functions to be added to the list of package's validators on changes to the packages in the repository to ensure the packages meet constraints
enforced by the validators associated with the repository.
Based on the Kubernetest Admission Controllers (https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/). The functions will be evaluated
in the order specified in the list.
items:
properties:
configMap:
additionalProperties:
type: string
description: '`ConfigMap` specifies the function config (https://kpt.dev/reference/cli/fn/eval/).'
type: object
image:
description: '`Image` specifies the function image, such as
`gcr.io/kpt-fn/gatekeeper:v0.2`.'
type: string
type: object
type: array
type: object
status:
description: RepositoryStatus defines the observed state of Repository
Expand Down
16 changes: 0 additions & 16 deletions api/porchconfig/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,6 @@ type RepositorySpec struct {
Git *GitRepository `json:"git,omitempty"`
// OCI repository details. Required if `type` is `oci`. Ignored if `type` is not `oci`.
Oci *OciRepository `json:"oci,omitempty"`
// Upstream is the default upstream repository for packages in this
// repository. Specifying it per repository allows simpler UX when
// creating packages.
Upstream *UpstreamRepository `json:"upstream,omitempty"`

// `Mutators` specifies list of functions to be added to the list of package's mutators on changes to the packages in the repository to ensure the packages meet constraints
// enforced by the mutators associated with the repository.
// Based on the Kubernetest Admission Controllers (https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/). The functions will be evaluated
// in the order specified in the list.
Mutators []FunctionEval `json:"mutators,omitempty"`

// `Validators` specifies list of functions to be added to the list of package's validators on changes to the packages in the repository to ensure the packages meet constraints
// enforced by the validators associated with the repository.
// Based on the Kubernetest Admission Controllers (https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/). The functions will be evaluated
// in the order specified in the list.
Validators []FunctionEval `json:"validators,omitempty"`
}

// GitRepository describes a Git repository.
Expand Down
21 changes: 1 addition & 20 deletions api/porchconfig/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@ func (cad *cadEngine) UpdatePackageResources(ctx context.Context, repositoryObj
if err != nil {
return nil, renderStatus, err
}
repoPkgRev.SetMeta(rev.ObjectMeta)

return repoPkgRev, renderStatus, nil
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/git/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (p *gitPackageRevision) GetPackageRevision(ctx context.Context) (*v1alpha1.
UID: p.uid(),
ResourceVersion: p.commit.String(),
CreationTimestamp: metav1.Time{
Time: p.updated,
Time: p.metadata.CreationTimestamp.Time,
},
},
Spec: v1alpha1.PackageRevisionSpec{
Expand Down Expand Up @@ -209,7 +209,7 @@ func (p *gitPackageRevision) GetResources(ctx context.Context) (*v1alpha1.Packag
UID: p.uid(),
ResourceVersion: p.commit.String(),
CreationTimestamp: metav1.Time{
Time: p.updated,
Time: p.metadata.CreationTimestamp.Time,
},
OwnerReferences: []metav1.OwnerReference{}, // TODO: should point to repository resource
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (p *ociPackageRevision) GetResources(ctx context.Context) (*v1alpha1.Packag
Name: p.KubeObjectName(),
Namespace: p.parent.namespace,
CreationTimestamp: metav1.Time{
Time: p.created,
Time: p.metadata.CreationTimestamp.Time,
},
ResourceVersion: p.resourceVersion,
UID: p.uid,
Expand Down Expand Up @@ -351,7 +351,7 @@ func (p *ociPackageRevision) GetPackageRevision(ctx context.Context) (*v1alpha1.
Name: p.KubeObjectName(),
Namespace: p.parent.namespace,
CreationTimestamp: metav1.Time{
Time: p.created,
Time: p.metadata.CreationTimestamp.Time,
},
ResourceVersion: p.resourceVersion,
UID: p.uid,
Expand Down
Loading

0 comments on commit d42e4f6

Please sign in to comment.