Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: create a new release #927

Merged
merged 35 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
dc6f276
refactor!: remove --config-path from CLI (#844)
tromai Sep 16, 2024
2af40f2
chore: move pom parser to parsers module (#863)
benmss Sep 19, 2024
70bad94
chore: disable too-many-positional-arguments check in Pylint (#868)
behnazh-w Sep 23, 2024
c4dbe46
docs: add project links to pyproject.toml (#867)
behnazh-w Sep 23, 2024
38387e4
feat!: allow specifying the dependency depth resolution through CLI a…
tromai Sep 25, 2024
5c490f9
chore: improve commit finder accuracy (#862)
benmss Sep 25, 2024
718c085
fix: prevent endless loop on 403 GitHub response (#866)
benmss Sep 27, 2024
e11be2d
chore: improve the indentation consistency of souffle Makefile goal (…
behnazh-w Sep 30, 2024
569f3f7
chore(deps): update SLSA verifier to version 2.6.0 (#879)
behnazh-w Sep 30, 2024
6ef2447
chore: fix Makefile goal `gnu-sed` to handle brew, port, and GNU sed …
jenstroeger Sep 30, 2024
07d0a14
chore(deps): bump actions/setup-java from 4.2.1 to 4.4.0 (#884)
dependabot[bot] Sep 30, 2024
0df909f
chore(deps): bump actions/checkout from 4.1.0 to 4.2.0 (#883)
dependabot[bot] Sep 30, 2024
4d3e4ad
test: remove unnecessary integration tests for micronaut-test-junit5 …
behnazh-w Sep 30, 2024
94504d4
chore: add suggestion mode to pylint settings, and silence the “too m…
jenstroeger Oct 2, 2024
6b9742d
chore: fix pylint message consider-using-any-or-all (#881)
jenstroeger Oct 2, 2024
b23fab1
chore: fix pylint message use-set-for-membership (#882)
jenstroeger Oct 2, 2024
aebf879
chore: fix pylint message overlapping-except (#886)
jenstroeger Oct 2, 2024
bc89fe9
chore: fix pylint message deprecated-typing-alias (#887)
jenstroeger Oct 2, 2024
7bb23d8
chore: fix pylint message else-if-used (#888)
jenstroeger Oct 3, 2024
6a210f4
fix: fix a bug in GitHub Actions matrix variable resolution (#896)
behnazh-w Oct 10, 2024
9ef9d50
chore(deps): Update Go to v1.23 and golangci-lint to v1.61.0 (#905)
behnazh-w Oct 24, 2024
3854a85
feat: verify whether the reported repository can be linked back to th…
mabdollahpour-ol Oct 28, 2024
7d3c63e
chore: address comments from PR#873 (#913)
mabdollahpour-ol Nov 4, 2024
f39784a
feat: add a new check to report the build tool (#914)
behnazh-w Nov 4, 2024
2d4582f
feat: add command to run repo and commit finder without analysis (#827)
benmss Nov 11, 2024
16e28e6
chore: update 3rd party license on deps.dev (#919)
tromai Nov 15, 2024
ab0dd3e
docs: add tutorial for find source command (#920)
benmss Nov 18, 2024
b65f0db
fix: block terminal prompts in find source (#918)
benmss Nov 18, 2024
4235041
refactor: accept provenance data in artifact pipeline check (#872)
behnazh-w Nov 18, 2024
baaff5f
test(integration): handle missing steps info in GitHub API response (…
behnazh-w Nov 22, 2024
b5afe0d
feat: report known malware for all ecosystems (#922)
behnazh-w Nov 22, 2024
0720311
docs: fix issues and improve the source finder tutorial (#924)
behnazh-w Nov 25, 2024
dca0365
chore(deps): bump mvdan.cc/sh/v3 from 3.7.0 to 3.10.0 (#903)
dependabot[bot] Nov 25, 2024
72b1985
chore(deps): update mypy requirement from <1.12,>=1.0.0 to >=1.0.0,<1…
dependabot[bot] Nov 26, 2024
3dce3ce
ci: remove redundant maven deps resolution tests (#928)
behnazh-w Nov 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
steps:

- name: Check out repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0

Expand All @@ -63,7 +63,7 @@ jobs:

# Install Java.
- name: Set up JDK
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0
with:
distribution: oracle
java-version: '17'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_build_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
steps:

- name: Check out repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_deploy-github-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
steps:

- name: Check out repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_generate-rebase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
steps:

- name: Check out repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0
token: ${{ secrets.REPO_ACCESS_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_base_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:

- name: Check out repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
steps:

- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-conventional-commits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
steps:

- name: Check out repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
steps:

- name: Check out repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0
token: ${{ secrets.REPO_ACCESS_TOKEN }}
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
steps:

- name: Check out repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0

Expand Down Expand Up @@ -305,7 +305,7 @@ jobs:
# steps:

# - name: Check out repository
# uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
# uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
# with:
# fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
steps:

- name: Check out repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ repos:

# A linter for Golang
- repo: https://github.com/golangci/golangci-lint
rev: v1.59.1
rev: v1.61.0
hooks:
- id: golangci-lint

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ a detailed commit message body is preferred. Make sure to keep the `Signed-off-b
### Prerequisites

- Python 3.11
- Go 1.21
- Go 1.23
- JDK 17

### Prepare the environment
Expand Down
59 changes: 34 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ setup-go:
go build -o $(PACKAGE_PATH)/bin/cuevalidate.so -buildmode=c-shared $(REPO_PATH)/golang/internal/cue_validator/cue_validator.go
setup-binaries: $(PACKAGE_PATH)/bin/slsa-verifier $(PACKAGE_PATH)/resources/mvnw $(PACKAGE_PATH)/resources/gradlew souffle gnu-sed
$(PACKAGE_PATH)/bin/slsa-verifier:
git clone --depth 1 https://github.com/slsa-framework/slsa-verifier.git -b v2.5.1
git clone --depth 1 https://github.com/slsa-framework/slsa-verifier.git -b v2.6.0
cd slsa-verifier/cli/slsa-verifier && go build -o $(PACKAGE_PATH)/bin/
cd $(REPO_PATH) && rm -rf slsa-verifier
$(PACKAGE_PATH)/resources/mvnw:
Expand Down Expand Up @@ -143,39 +143,48 @@ else
OS_DISTRO := "$(shell grep '^NAME=' /etc/os-release | sed 's/^NAME=//' | sed 's/"//g')"
endif
endif
# If Souffle cannot be installed, we advise the user to install it manually
# and return status code 0, which is not considered a failure.
.PHONY: souffle
souffle:
if ! command -v souffle; then \
echo "Installing system dependency: souffle" && \
case $(OS_DISTRO) in \
"Oracle Linux") \
sudo dnf -y install https://github.com/souffle-lang/souffle/releases/download/2.4/x86_64-oraclelinux-8-souffle-2.4-Linux.rpm \
;; \
"Fedora Linux") \
sudo dnf -y install https://github.com/souffle-lang/souffle/releases/download/2.4/x86_64-fedora-34-souffle-2.4-Linux.rpm \
;; \
"Ubuntu") \
sudo wget https://souffle-lang.github.io/ppa/souffle-key.public -O /usr/share/keyrings/souffle-archive-keyring.gpg; \
echo "deb [signed-by=/usr/share/keyrings/souffle-archive-keyring.gpg] https://souffle-lang.github.io/ppa/ubuntu/ stable main" | sudo tee /etc/apt/sources.list.d/souffle.list; \
sudo apt update; \
sudo apt install souffle; \
;; \
"Darwin") \
if command -v brew; then \
brew install --HEAD souffle-lang/souffle/souffle; \
else \
echo "Unable to install Souffle. Please install it manually." && exit 0; \
fi ;; \
esac; \
echo "Installing system dependency: souffle" && \
case $(OS_DISTRO) in \
"Oracle Linux") \
sudo dnf -y install https://github.com/souffle-lang/souffle/releases/download/2.4/x86_64-oraclelinux-8-souffle-2.4-Linux.rpm;; \
"Fedora Linux") \
sudo dnf -y install https://github.com/souffle-lang/souffle/releases/download/2.4/x86_64-fedora-34-souffle-2.4-Linux.rpm;; \
"Ubuntu") \
sudo wget https://souffle-lang.github.io/ppa/souffle-key.public -O /usr/share/keyrings/souffle-archive-keyring.gpg; \
echo "deb [signed-by=/usr/share/keyrings/souffle-archive-keyring.gpg] https://souffle-lang.github.io/ppa/ubuntu/ stable main" | sudo tee /etc/apt/sources.list.d/souffle.list; \
sudo apt update; \
sudo apt install souffle;; \
"Darwin") \
if command -v brew; then \
brew install --HEAD souffle-lang/souffle/souffle; \
else \
echo "Unable to install Souffle. Please install it manually." && exit 0; \
fi;; \
*) \
echo "Unsupported OS distribution: $(OS_DISTRO)"; exit 0;; \
esac; \
fi && \
command -v souffle || true
command -v souffle

# Install gnu-sed on mac using homebrew
.PHONY: gnu-sed
gnu-sed:
if [ "$(OS_DISTRO)" == "Darwin" ]; then \
brew install gnu-sed; \
fi
if ! command -v gsed; then \
if command -v brew; then \
brew install gnu-sed; \
elif command -v port; then \
sudo port install gsed; \
else \
echo "Unable to install GNU sed on macOS. Please install it manually." && exit 1; \
fi; \
fi; \
fi;

# Install or upgrade an existing virtual environment based on the
# package dependencies declared in pyproject.toml.
Expand Down
4 changes: 4 additions & 0 deletions THIRD_PARTY_LICENSES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13055,3 +13055,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-----------------------------------separator-----------------------------------

================================================================================

Google deps.dev

As well as aggregating data, deps.dev generates additional data, including resolved dependencies, advisory statistics, associations between entities, etc. This generated data is available under a CC-BY 4.0 license - https://creativecommons.org/licenses/by/4.0/.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions docs/source/_static/schemastore/find_source_report_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "macaron-source-finder-json-report-schema",
"title": "Macaron Source Finder JSON Report",
"$comment": "For any details about the schema specification and validation documentation, see https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-00 and https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00.",
"type": "object",
"properties": {
"purl": {
"type": "string"
},
"commit": {
"type": "string"
},
"repo": {
"type": "string"
},
"repo_validated": {
"type": "boolean"
},
"commit_validated": {
"type": "boolean"
},
"url": {
"type": "string"
}
}
}
10 changes: 8 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ the requirements that are currently supported by Macaron.
* - Check ID
- SLSA requirement
- Concrete check
* - ``mcn_build_tool_1``
- **Build tool exists** - The source code repository includes configurations for a supported build tool used to produce the software component.
- Detect the build tool used in the source code repository to build the software component.
* - ``mcn_build_script_1``
- **Scripted build** - All build steps were fully defined in a “build script”.
- Identify and validate build script(s).
Expand All @@ -74,7 +77,7 @@ the requirements that are currently supported by Macaron.
* - ``mcn_build_as_code_1``
- **Build as code** - If a trusted builder is not present, this requirement determines that the build definition and configuration executed by the build service is verifiably derived from text file definitions stored in a version control system.
- Identify and validate the CI service(s) used to build and deploy/publish an artifact.
* - ``mcn_infer_artifact_pipeline_1``
* - ``mcn_find_artifact_pipeline_1``
- **Infer artifact publish pipeline** - When a provenance is not available, checks whether a CI workflow run has automatically published the artifact.
- Identify a workflow run that has triggered the deploy step determined by the ``Build as code`` check.
* - ``mcn_provenance_level_three_1``
Expand All @@ -89,6 +92,9 @@ the requirements that are currently supported by Macaron.
* - ``mcn_provenance_derived_commit_1``
- **Provenance derived commit** - Check if the analysis target's commit matches the commit in the provenance.
- If there is no commit, this check will fail.
* - ``mcn_scm_authenticity_check_1``
- **Source repo authenticity** - Check whether the claims of a source code repository made by a package can be corroborated.
- If the source code repository contains conflicting evidence regarding its claim of the source code repository, this check will fail. If no source code repository or corroborating evidence is found, or if the build system is unsupported, the check will return ``UNKNOWN`` as the result. This check currently supports only Maven artifacts.

****************************************************************************************
Macaron checks that report integrity issues but do not map to SLSA requirements directly
Expand All @@ -101,7 +107,7 @@ Macaron checks that report integrity issues but do not map to SLSA requirements
* - Check ID
- Description
* - ``mcn_detect_malicious_metadata_1``
- This check analyzes the metadata of a package and reports malicious behavior. This check currently supports PyPI packages.
- This check performs analysis on PyPI package metadata to detect malicious behavior. It also reports known malware from other ecosystems, but the analysis is currently limited to PyPI packages.

----------------------
How does Macaron work?
Expand Down
17 changes: 11 additions & 6 deletions docs/source/pages/cli_usage/command_analyze.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ Usage

usage: ./run_macaron.sh analyze
[-h] [-sbom SBOM_PATH] [-purl PURL] [-rp REPO_PATH] [-b BRANCH]
[-d DIGEST] [-pe PROVENANCE_EXPECTATION] [-c CONFIG_PATH]
[--skip-deps] [-g TEMPLATE_PATH]
[-d DIGEST] [-pe PROVENANCE_EXPECTATION]
[--skip-deps] [--deps-depth DEPS_DEPTH] [-g TEMPLATE_PATH]
[--python-venv PYTHON_VENV]

-------
Options
Expand Down Expand Up @@ -62,18 +63,22 @@ Options

The path to the provenance file in in-toto format.

.. option:: -c CONFIG_PATH, --config-path CONFIG_PATH
.. option:: --skip-deps

The path to the user configuration.
DEPRECATED. Dependency resolution is off by default. This flag does nothing and will be removed in the next release.

.. option:: --skip-deps
.. option:: --deps-depth DEPS_DEPTH

Skip automatic dependency analysis.
The depth of the dependency resolution. 0: disable, 1: direct dependencies, inf: all transitive dependencies. (Default: 0)

.. option:: -g TEMPLATE_PATH, --template-path TEMPLATE_PATH

The path to the Jinja2 html template (please make sure to use .html or .j2 extensions).

.. option:: --python-venv PYTHON_VENV

The path to the Python virtual environment of the target software component.

-----------
Environment
-----------
Expand Down
38 changes: 38 additions & 0 deletions docs/source/pages/cli_usage/command_find-source.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.. Copyright (c) 2023 - 2023, Oracle and/or its affiliates. All rights reserved.
.. Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.

.. _find-source-command-cli:

===========
Find Source
===========

-----------
Description
-----------

Find the source commit, and optionally source repository, of a target artifact.

-----
Usage
-----

.. code-block:: shell

usage: ./run_macaron.sh find-source -purl PURL [-rp REPO_PATH]

-------
Options
-------

.. option:: -h, --help

Show this help message and exit

.. option:: -purl PACKAGE_URL, --package-url PACKAGE_URL

The PURL string used to uniquely identify the artifact.

.. option:: -rp REPO_PATH, --repo-path REPO_PATH

The path to the repository.
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@ macaron.parsers.github\_workflow\_model module
:members:
:undoc-members:
:show-inheritance:

macaron.parsers.pomparser module
--------------------------------

.. automodule:: macaron.parsers.pomparser
:members:
:undoc-members:
:show-inheritance:
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ macaron.repo\_finder.repo\_finder\_java module
:undoc-members:
:show-inheritance:

macaron.repo\_finder.repo\_utils module
---------------------------------------

.. automodule:: macaron.repo_finder.repo_utils
:members:
:undoc-members:
:show-inheritance:

macaron.repo\_finder.repo\_validator module
-------------------------------------------

Expand Down
Loading
Loading