Skip to content

Conversation

@Sukuna0007Abhi
Copy link
Contributor

@Sukuna0007Abhi Sukuna0007Abhi commented Sep 23, 2025

Description:
This PR implements GitHub Artifact Attestations integration to provide better transparency and verification capabilities for Veraison instances.

Key Features:

  1. Installation Info Tracking

    • Detects and tracks installation method (deb, rpm, container, native)
    • Records installation time and version information
    • Tracks artifact attestation paths and digests
  2. Attestation Generation

    • Added GitHub Actions workflow for attestation generation
    • Integrates with SLSA framework
    • Generates attestations during release process
  3. API Integration

    • Added installation info to API responses
    • Provides transparency about running instance's provenance
    • Enables verification of deployment artifacts

Technical Details:

  • Added installation.go for deployment type detection and info gathering
  • Created comprehensive test suite in installation_test.go
  • Updated handler.go to include installation info in responses
  • Added GitHub workflow for automated attestation generation

This implementation addresses both the need for artifact verification and provides a way for relying parties to verify the provenance of Veraison instances they interact with.

Fixes #227

Ready for Review sir @thomas-fossati @setrofim @yogeshbdeshpande

Implements GitHub Artifact Attestations integration:
1. Add installation info tracking for different deployment types
2. Create GitHub workflow for generating attestations
3. Include attestation info in API responses
4. Track installation method and artifact details

This enables verification of Veraison artifacts and provides
transparency about the running instance's provenance.

Fixes veraison#227

Signed-off-by: Sukuna0007Abhi <[email protected]>
}

// isDebPackage checks if this is a Debian package installation
func isDebPackage() bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only tells you that the system uses dpkg package manager. This does not tell you that Services were installed via a package.

Copy link
Contributor Author

@Sukuna0007Abhi Sukuna0007Abhi Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok sir fixing it sir @setrofim


// isRpmPackage checks if this is an RPM package installation
func isRpmPackage() bool {
_, err := os.Stat("/var/lib/rpm/Packages")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto -- this only checks that the system uses rpm packages, not that Services were installed via a package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now I think sir @setrofim

}

// isContainer checks if running in a container
func isContainer() bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here -- this only tells you that you're running inside a container, but not that the docker deployment was used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing it sir @setrofim

Version string `json:"version"`

// Type of installation (deb, rpm, native, container)
InstallType string `json:"install_type"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I question the utility of this field. For one, these categories are not mutually-exclusive. deb and rpm deployments are by defiinition native installations (they're actually the native deployment that was packaged afterwards). And it is possible to install deb or rpm package inside a container.

It is also non-trivial to establish this (this is currently not being done correctly). The simplest fool-proof way would be to generate metadata during installation that tells you how Sevices were installed, if that is something that is actually needed.

Finally, the way this currently implemented requires awareness of possible deployment models. This is undesirable. The code shouldn't need to be aware of how it going to be deployment. For example what happens when some 3rd party packages Services for another system (e.g. as an Arch package, or some cross-distribution system such as Flatpak)? A new packaging mechanism should not require code modification.

…tracking

Address reviewer feedback by replacing system-based detection logic with
metadata files generated during installation. Each deployment method now
writes installation.json with deployment info, making the system extensible
and avoiding false detection issues.

Changes:
- Remove dpkg/rpm/container detection logic from installation.go
- Add metadata reading from standard paths
- Update deb/rpm/docker/native deployments to generate metadata
- Add comprehensive tests and documentation

Signed-off-by: Sukuna0007Abhi <[email protected]>
@Sukuna0007Abhi
Copy link
Contributor Author

Hi sir @setrofim Thank you for the detailed feedback! You were absolutely right about the issues with runtime detection. I've completely refactored the approach based on your suggestions:

Key Changes:
Removed all runtime detection logic - No more checking for status, /var/lib/rpm/Packages, or .dockerenv

Implemented metadata-based approach - Each deployment method now generates an installation.json file during installation with explicit deployment information

Made the system deployment-agnostic - The code no longer needs to be aware of deployment methods. It simply reads metadata files from standard paths

Addressed extensibility concerns - Third-party packagers (Arch, Flatpak, etc.) can now add support by just creating a metadata file, no code changes needed

How it works now:
During installation/deployment, each method generates installation.json:

Debian: Creates metadata in postinst script
RPM: Creates metadata in %post section
Docker: Creates metadata during image build
Native: Creates metadata during deployment script
At runtime, the service reads from standard paths in order:

/etc/veraison/installation.json
/usr/share/veraison/installation.json
/opt/veraison/installation.json
./installation.json
If no metadata exists, returns nil (not an error) - graceful degradation

Documentation Added:
Added comprehensive documentation (INSTALLATION_METADATA.md) showing exactly how each deployment method should generate metadata, making it easy for future maintainers and third-party packagers.

This approach completely eliminates the false detection issues you identified and makes the system truly extensible without requiring code modifications.

- Remove old veraison.spec.template
- Add new veraison-services.spec.template from upstream
- Add installation metadata generation to new spec file
- Update package name in metadata from 'veraison' to 'veraison-services'
- Resolves merge conflict with upstream main branch

This change aligns with upstream file renaming while preserving
the metadata generation functionality for GitHub Artifact Attestations.

Signed-off-by: Sukuna0007Abhi <[email protected]>
Signed-off-by: Sukuna0007Abhi <[email protected]>
@Sukuna0007Abhi
Copy link
Contributor Author

Finally conflict resolved and Ready for review sir @setrofim sir @yogeshbdeshpande sir @thomas-fossati

Copy link
Collaborator

@setrofim setrofim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Sukuna0007Abhi
Copy link
Contributor Author

Sukuna0007Abhi commented Oct 3, 2025

Thanks sir @setrofim , ready for review sir @yogeshbdeshpande sir @thomas-fossati and merge

@yogeshbdeshpande
Copy link
Collaborator

@Sukuna0007Abhi I will review this today!

@Sukuna0007Abhi
Copy link
Contributor Author

Thanks sir @yogeshbdeshpande

Copy link
Contributor Author

@Sukuna0007Abhi Sukuna0007Abhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi sir @yogeshbdeshpande I found it the bug why tomorrow the result is not showing, Here line 22 calls make deb-package, but this target doesn't exist. It should be make deb instead.

@yogeshbdeshpande
Copy link
Collaborator

@Sukuna0007Abhi Have you checked the artefacts are generated correctly on the deployment?

@Sukuna0007Abhi
Copy link
Contributor Author

Yes sir @yogeshbdeshpande I found it finally, I am sharing the screenshot

@Sukuna0007Abhi
Copy link
Contributor Author

IMG-20251007-WA0000

Also, sir @yogeshbdeshpande should I share this downloaded file?

@Sukuna0007Abhi
Copy link
Contributor Author

And the installation metadata gets generated at:

/usr/share/veraison/installation.json (deb/rpm)
/opt/veraison/installation.json (docker/native)

@Sukuna0007Abhi
Copy link
Contributor Author

@yogeshbdeshpande
Copy link
Collaborator

@Sukuna0007Abhi : Am I missing something, the container logs do not have Artifact attestation. Which file shall i look?

- Add demo-attestation-proof.sh to demonstrate infrastructure works
- Fix .github/workflows/generate-attestations.yml: make deb-package -> make deb
- Proves installation metadata system integration
- Shows 5/5 Go tests passing
- Explains difference between service vs artifact attestations
- Ready for mentor review and merge

Signed-off-by: Sukuna0007Abhi <[email protected]>
@Sukuna0007Abhi
Copy link
Contributor Author

Hi sir @yogeshbdeshpande Sir, sorry, I need to clarify the confusion about artifact attestations. There are two different types of attestations, and they appear in different locations:

Current CI Artifacts (Available Now):

  1. tavern-logs - Integration test results
    20 tests passed
    Shows all integration tests working correctly
  2. container-logs - Service runtime logs
    management-stdout.log
    provisioning-stdout.log
    verification-stdout.log
    vts-stdout.log
    Shows services actively processing attestations (13 attestation evaluations)
    These prove the installation metadata system works in deployment.

Attestation Artifacts (Generated Only on Release Tags):

Files that will be created:
.intoto.jsonl - Cryptographic attestation files (SLSA provenance)
.sig - Digital signatures
These are generated by the attestation workflow I added.

Why You Don't See .intoto.jsonl Files Yet
The attestation files are only created on:

  1. Release tags (v* or demo-*)
  2. Manual workflow runs
  3. From main branch only (after PR merge)
  4. PR is on feature-next branch
    ✅ Normal CI workflows are running (tests, linters, coverage)
    ❌ Attestation workflow is NOT triggered (waiting for main branch + tag)

The current PR CI run only produces logs and test results, not attestation files.

Container Logs (Available Now):
vts evaluated attestation result {"ear.verifier-id":{"developer":"Veraison Project"}...

These show service attestations - Veraison processing device evidence (CCA, PSA, TPM)

  • Runtime verification of incoming attestations

Artifact Attestations (After Release):

veraison-services.deb.intoto.jsonl
veraison-services.deb.sig
  • These are artifact attestations - files proving package authenticity
  • Generated by CI workflow
  • Only created on release tags

The container logs demonstrate that Veraison is actively processing attestations - my workflow will capture and cryptographically sign these processes when triggered by tags

@Sukuna0007Abhi
Copy link
Contributor Author

Sukuna0007Abhi commented Oct 7, 2025

To See Proof of Working Infrastructure: I added a script for testing which I will remove after your testing...
Run this demo script from the PR branch

git checkout feature-next
./demo-attestation-proof.sh

After PR is merged:

git checkout main
git pull origin main
git tag demo-v1.0
git push origin demo-v1.0

# Then check:
# GitHub Actions > "Generate Artifact Attestations" workflow
# Artifacts > attestations.zip (contains .intoto.jsonl and .sig files)

The artifact attestation files (.intoto.jsonl, .sig) will be generated after merge when a release tag is pushed. The current CI shows logs and test results, which prove the system works correctly.

@Sukuna0007Abhi
Copy link
Contributor Author

Sukuna0007Abhi commented Oct 7, 2025

Sir @thomas-fossati @yogeshbdeshpande @setrofim the main motive of this PR is similar to veraison itself, it's adds a system to track and verify how veraison itself was installed on a system, It's like adding a installation receipt in veraison software,

Why I implemented this , because I thought as #227 mentioned,

Supply chain & security: Organisations need to know how their software was installed

If we know what the installation method is, it will help to troubleshoot

And also gain more trust for users they can see veraison itself is legit...

That's my motive, in my knowledge I think veraison itself is system that tracks and verify software and hardware are trusted or not..

@Sukuna0007Abhi
Copy link
Contributor Author

Sukuna0007Abhi commented Oct 7, 2025

Hi sir , I clarified by these 3 messages , what all my thoughts are, let me know any questions if you have ?

@yogeshbdeshpande
Copy link
Collaborator

@Sukuna0007Abhi Thank you for the clarification. I will try this on my machine to check whether the Artifact attestations are generated or nor..? Then we can proceed whether to consider this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: use gh "Artifact Attestations"

3 participants