Commit graph

67 commits

Author SHA1 Message Date
patzielinski
4f3b0cf24b
Merge pull request #841 from yongjae354/list-globalrules
gittuf: add command list-globalrules
2025-03-05 18:57:05 +00:00
Yongjae Chung
dfd67f142a add cmd list-global-rules
Signed-off-by: Yongjae Chung <yongjae354@berkeley.edu>
2025-03-05 13:27:50 -05:00
Aditya Sirish A Yelgundhalli
3e7e688406
gittuf: Update how sync and propagation workflows interact
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2025-03-05 11:21:29 -05:00
Aditya Sirish A Yelgundhalli
0de2972b48
cmd: Add persistent options for attest
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2025-02-20 18:13:32 -05:00
Aditya Sirish A Yelgundhalli
3639e23219
*: Add gittuf sync
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2025-02-20 17:56:07 -05:00
Aditya Sirish A Yelgundhalli
03e363a527
*: Move attest functionality out of dev
This commit moves GitHub-specific attestations out of developer mode. In
addition, it drops the authorize subcommand of dev, which was deprecated in the
last release.

Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2025-02-18 09:18:57 -05:00
Aditya Sirish A Yelgundhalli
3d9ec638b3
*: Add propagation flow to certain RSL workflows
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2025-02-05 15:35:16 -05:00
Aditya Sirish A Yelgundhalli
9c9d735f40
gittuf: Add propagation workflow
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2025-02-05 14:38:58 -05:00
Aditya Sirish A Yelgundhalli
00fb1658f4
*: Add and remove propagation workflows from metadata
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2025-02-05 10:46:02 -05:00
Yongjae Chung
09395b18d8 Add remove-principal
Signed-off-by: Yongjae Chung <yongjae354@berkeley.edu>
2025-02-04 13:57:21 -05:00
Aditya Sirish A Yelgundhalli
2923704fa0
gitinterface: Support bare clones
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2025-02-04 11:18:02 -05:00
Horiodino
3d0be301a4
added Discard to clear the changes currently staged
Signed-off-by: Horiodino <holiodin@gmail.com>

updated Docs

Signed-off-by: Horiodino <holiodin@gmail.com>
2025-02-03 14:56:17 +05:30
Aditya Sirish
749b7df97c
*: Add support for coloring log output
Signed-off-by: Aditya Sirish <aditya@saky.in>
2025-02-01 17:58:11 -05:00
Aditya Sirish
c3148721b9
rsl: Fix gittuf rsl log buffering
This commit fixes how gittuf rsl log loads RSL entries to print.
Earlier, all entries were loaded into memory first and then printed.
This commit switches over to a buffered write approach, meaning the user
starts seeing output right away.

Signed-off-by: Aditya Sirish <aditya@saky.in>
Co-authored-by: Hao Tran <haoanhtran7@gmail.com>
2025-02-01 17:51:37 -05:00
Aditya Sirish A Yelgundhalli
16d9e1d9ce
*: Move reference authorizations out of dev mode
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2025-01-31 13:45:23 -05:00
Aditya Sirish A Yelgundhalli
82dfce994c
gittuf,policy: Add VerifyMergeableForCommit
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2025-01-28 17:53:09 -05:00
Aditya Sirish
d5df401da5
cmd: Fix help message
Signed-off-by: Aditya Sirish <aditya@saky.in>
2025-01-23 14:23:27 -05:00
Aditya Sirish
20780c2d84
*: Initial support for naming for gittuf app
gittuf has a companion app for GitHub that can record attestations for
pull request reviews. Previously, the app was identified by its signing
key. This commit adds initial support for naming the app, with an eye
towards eventually supporting attestations from multiple apps.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2025-01-23 13:34:42 -05:00
Aditya Sirish
a6c296b92e
Merge pull request #740 from gittuf/root-location
*: Add repositoryLocation to root metadata
2025-01-16 15:21:44 -05:00
Aditya Sirish A Yelgundhalli
72f47b06d0
*: Add repositoryLocation to root metadata
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2025-01-16 15:10:29 -05:00
Horiodino
deb011a9bf *: Add support for removing global rules
Signed-off-by: Horiodino <holiodin@gmail.com>

Update test-cases for global-rules

Signed-off-by: Horiodino <holiodin@gmail.com>

Add cmd for remove-global-rule

Signed-off-by: Horiodino <holiodin@gmail.com>

Handling RemoveGlobalRuleThreshold and RemoveGlobalRuleBlockForcePushes rule

Signed-off-by: Horiodino <holiodin@gmail.com>

Update docs

Signed-off-by: Horiodino <holiodin@gmail.com>

fixed minor bugs

Signed-off-by: Horiodino <holiodin@gmail.com>

Handling RemoveGlobalRuleThreshold and RemoveGlobalRuleBlockForcePushes rule

Signed-off-by: Horiodino <holiodin@gmail.com>
2025-01-16 13:05:30 -05:00
Jamal Cao
7e0a338be5 tui: added a terminal user interface (TUI) for managing gittuf policy
Signed-off-by: Jamal Cao <jamaltheodds@gmail.com>
2025-01-15 11:32:09 -05:00
Aditya Sirish
3e24f4ceaf
*: Support multiple types of global rules
This commit adds support for different types of global rules (i.e., non
threshold constraints). This commit also adds a global rule to block
force pushes to one or more specified refs.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2025-01-09 19:14:29 -05:00
Aditya Sirish
96516300f6
*: Add support for global rules
This commit adds initial support for "global rules" that set baselines
that must be met during verification. Currently, the global rule only
enforces threshold rules. Each rule is enforced by inspecting the set of
principals successfully verified for a change. If a change is not
protected explicitly, then it's verified using all principals in the
policy.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2025-01-09 17:03:39 -05:00
Aditya Sirish
90a4d1a806
gittuf,cache,policy,cmd: Use persistent cache
This commit adds support for persistent cache searching as well as
explicit populating.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2025-01-08 12:42:13 -05:00
Aditya Sirish
cdacf9cf1a
*: Add control for RSL duplicate check
The RSL entry creation flow checks to see if the latest entry for the
reference being pushed has the same target ID as the proposed new entry.
This check should be optional, depending on how the entry is created.
When created using the "gittuf rsl record" command, the check should be
performed by default. But when created using the git-remote-gittuf
transport, the check is superfluous: the push is happening and an extra
entry recording the push happened is better. This also speeds up the RSL
entry creation for a new branch via the transport, as looking for an
existing RSL entry for the branch in question is expensive (the entire
RSL history must be checked).

Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-12-18 11:21:00 -05:00
Aditya Sirish A Yelgundhalli
a601aee55d
*: Various policy fixes
1. VerifyMergeable was incorrectly returning an error when no verifiers were
found (for an unprotected base branch).

2. Policy's searcher interface was also returning the wrong error when the
latest policy or attestation entry was not found.

3. A verify-mergeable command has been added to simplify debugging.

Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-12-06 16:08:32 -05:00
Aditya Sirish A Yelgundhalli
4ccc102f8e
*: Use person associatedIdentities to verify code review tool approvals
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-11-07 17:21:19 -05:00
Aditya Sirish A Yelgundhalli
9c08c47035
*: Expose persons in CLI
This commit allows for using persons in the CLI. In doing so, it updates the
expected flow where add-rule no longer also adds the principals passed in.
Instead, keys / persons must be added explicitly first, and add-rule will fail
if the principal is not found.

Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-11-07 15:11:52 -05:00
Aditya Sirish A Yelgundhalli
8c49dfea3a
policy, cmd: Add list-principals sub command
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-11-07 12:48:06 -05:00
Pat Zielinski
3829d966c3 cmd: Drop devmode requirement for root and policy thresholds
Signed-off-by: Pat Zielinski <70954403+patzielinski@users.noreply.github.com>
2024-10-01 11:18:59 -04:00
Aditya Sirish
fbf9720b29
Merge pull request #546 from gittuf/no-transport-check
Add reconciliation workflow to update local RSL against remote RSL
2024-09-25 14:26:34 -04:00
Aditya Sirish
929e0d162d
*: Automatically reconcile local RSL with remote updates
This commit adds ReconcileLocalRSLWithRemote, which checks the local RSL
against the specified remote and reconciles the local RSL if needed. If
the local RSL doesn't exist or is strictly behind the remote RSL, then
the local RSL is updated to match the remote RSL. If the local RSL is
ahead of the remote RSL, nothing is updated. Finally, if the local and
remote RSLs have diverged, then the local only RSL entries are reapplied
over the latest entries in the remote if the local only RSL entries and
remote only entries are for different Git references.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-09-25 14:02:59 -04:00
Jamal Cao
fdce8e76ce Add functions and a command for reorder rules in a policy file
Add functions `ReorderDelegations` to handle rule reordering at backend
Add a command 'gittuf policy reorder-rules [flags]' to reorder rules
from CLI by passing a space-separated list of the rules with updated
order.

Signed-off-by: Jamal Cao <jamaltheodds@gmail.com>
2024-09-10 15:23:39 -04:00
Aditya Sirish A Yelgundhalli
537c267bf0
*: Improve app attestations management
This commit includes several changes discussed with @wlynch synchronously.
Broadly speaking, the biggest changes are allowing the use of multiple apps in
tandem. There are some supporting changes such as making the GitHub instance
URL a parameter to the CLI / API rather than something read from the
environment.

Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-08-14 16:52:00 -04:00
Aditya Sirish A Yelgundhalli
575234ce05
*: Update code review approval layer to be forge agnostic and clarify docs
The code review approval layer is now agnostic to the code review system used.
The only system supported at the moment is GitHub's pull request approvals, but
we should be able to extend this to support GitLab, Gerrit, etc.

In addition, the GitHub app key add endpoint docs have been updated to clarify
what the purpose of the key is.

Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-08-14 11:16:58 -04:00
Aditya Sirish A Yelgundhalli
b49c0beae8
*: Refactor approval attestations
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-08-14 11:16:29 -04:00
Aditya Sirish A Yelgundhalli
d8f72d9fef
*: Add support for GitHub pull request approval attestation
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-08-14 11:16:28 -04:00
Aditya Sirish
c0493c16c9
*: Support distinct remote ref name when verifying
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-06-28 11:22:23 -04:00
Aditya Sirish
2fd8d2a817
*: Support distinct src and dst refs in RSL
Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-06-28 11:22:23 -04:00
Billy Lynch
095a1e5e2a
Merge pull request #445 from gittuf/drop-verify-commit-tag
*: Drop verify-{commit,tag} workflows
2024-06-18 10:32:20 -04:00
patzielinski
e8a798f5ca
Merge pull request #369 from neilnaveen/neil/fixrslrecordonrebase
Automaticaly Skip RSL Reference Entries That Point to Non-Existent Commits
2024-06-18 02:15:28 +00:00
neilnaveen
3b1af5b010 Automaticaly Skip RSL Reference Entries That Point to Non-Existent Commits
- Fixes https://github.com/gittuf/gittuf/issues/368

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
2024-06-17 17:34:06 -05:00
Aditya Sirish A Yelgundhalli
06b2d5713f *: Drop verify-{commit,tag} workflows
These workflows have some shortcomings, as discussed in
https://github.com/gittuf/gittuf/issues/384#issuecomment-2099153472.

verify-commit doesn't currently do enough to ensure the right policy is
identified for when a commit is first introduced. verify-ref, with some
enhancements, is better.

verify-tag implements a subset of verify-ref already because it recognizes tags
are refs. Thus, verify-ref is again a better option.

Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
2024-06-17 16:41:01 -04:00
Aditya Sirish
73ccd2b166
Merge pull request #282 from neilnaveen/neil/internal/cmd/rsl/log
Added gittuf rsl log to log the rsl with additional information
2024-05-28 12:40:20 -04:00
neilnaveen
fbd580098b Add support to check if expected root keys are the actual root keys in clone.go
- Added the expectedRootKeys flag to clone.go
- Added addtional test in sync_test.go for expectedRootKeys

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
2024-05-27 13:00:45 -05:00
neilnaveen
46b4bffb8d Added gittuf rsl log to log the rsl with additional information
- Added gittuf rsl log to log the rsl with additional information

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
2024-05-23 09:56:23 -05:00
Aditya Sirish
313509d3d9
cmd: Move apply to trust / policy cmds
For consistency, this makes apply a subcommand of both trust and policy
commands.

Signed-off-by: Aditya Sirish <aditya@saky.in>
2024-05-07 16:08:15 -04:00
Aditya Sirish
6532eeef49
Merge pull request #260 from neilnaveen/neil/introducebasicpolicystagingusage
Introduce Basic Staging Capabilities Utilizing the Policy Staging Ref
2024-04-29 13:06:32 -07:00
Aditya Sirish
706104ebe5
*: Store GitHub PR data as an attestation
Signed-off-by: Aditya Sirish <aditya@saky.in>
Co-authored-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
2024-04-29 13:17:41 -04:00