pax_global_header 0000666 0000000 0000000 00000000064 15035076111 0014511 g ustar 00root root 0000000 0000000 52 comment=b8a1759074b33dd35c4c38294cdcf8d300016b70
esstra-0.2.0/ 0000775 0000000 0000000 00000000000 15035076111 0013011 5 ustar 00root root 0000000 0000000 esstra-0.2.0/.github/ 0000775 0000000 0000000 00000000000 15035076111 0014351 5 ustar 00root root 0000000 0000000 esstra-0.2.0/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 15035076111 0016534 5 ustar 00root root 0000000 0000000 esstra-0.2.0/.github/ISSUE_TEMPLATE/bug_report.yaml 0000664 0000000 0000000 00000003526 15035076111 0021576 0 ustar 00root root 0000000 0000000 name: Bug Report
description: File a bug report.
title: "[Bug]: "
body:
- type: checkboxes
attributes:
label: Mandatory confirmtion
description: "By submitting this issue, you agree to:"
options:
- label: "follow this project's [Code of Conduct](https://github.com/sony/esstra/blob/main/CODE_OF_CONDUCT.md)."
required: true
- label: "follow this project's [Contributing Guidelines](https://github.com/sony/esstra/blob/main/CONTRIBUTING.md)."
required: true
- label: "have checked the [issue list](https://github.com/sony/esstra/issues), and confirm that a similar issue has not been reported before."
required: true
- type: textarea
attributes:
label: "Description"
placeholder: "A clear and concise description of the bug."
- type: input
attributes:
label: "Version of ESSTRA"
placeholder: "For example, 'version 1' or 'commit ID abc123' "
validations:
required: true
- type: textarea
attributes:
label: "Environment"
placeholder: "What environment, device and OS do you use? What is your build configuration? With what version of dependencies and with which compiler and toolchain did you build?, etc."
- type: textarea
attributes:
label: "Steps to reproduce"
placeholder: "A unit test, system test, or step by step instructions to reproduce the bug."
- type: textarea
attributes:
label: "Console logs, visual proof, etc."
placeholder: "Relevant logs, screenshots or evidence to help in debugging."
- type: textarea
attributes:
label: "Expected results"
placeholder: "A clear and concise description of what you expected to happen."
- type: textarea
attributes:
label: "Additional context"
placeholder: "Add any other context about the problem here."
esstra-0.2.0/.github/ISSUE_TEMPLATE/feature_request.yaml 0000664 0000000 0000000 00000002657 15035076111 0022635 0 ustar 00root root 0000000 0000000 name: Feature request
description: Suggest an idea for this project.
title: "[Feature]: "
body:
- type: checkboxes
attributes:
label: Mandatory confirmtion
description: "By submitting this issue, you agree to:"
options:
- label: "follow this project's [Code of Conduct](https://github.com/sony/esstra/blob/main/CODE_OF_CONDUCT.md)."
required: true
- label: "follow this project's [Contributing Guidelines](https://github.com/sony/esstra/blob/main/CONTRIBUTING.md)."
required: true
- label: "have checked the [issue list](https://github.com/sony/esstra/issues), and confirm that a similar feature has not been requested before."
required: true
- type: textarea
attributes:
label: "Description"
placeholder: "A clear and concise description of the feature you would like to see."
- type: textarea
attributes:
label: "Background, motivation, etc."
placeholder: "Background information or context explaining why this feature is needed. What problem does it solve?"
- type: textarea
attributes:
label: "Expected results, benefits, etc."
placeholder: "Clear and concise description of what you want to happen, what benefits will it bring to the users or this project."
- type: textarea
attributes:
label: "Additional context"
placeholder: "Add any other context or screenshots about the feature request here."
esstra-0.2.0/.gitmodules 0000664 0000000 0000000 00000000170 15035076111 0015164 0 ustar 00root root 0000000 0000000 [submodule "third-party/WjCryptLib"]
path = third-party/WjCryptLib
url = https://github.com/WaterJuice/WjCryptLib.git
esstra-0.2.0/AUTHORS 0000664 0000000 0000000 00000000152 15035076111 0014057 0 ustar 00root root 0000000 0000000 Sony Group Corporation
NAGAO Sadakazu
NAMAE Takuya
Avneet Singh
Vikash Kumar
Utkarsh Yenurkar
SATO Kazumi
esstra-0.2.0/CODE_OF_CONDUCT.md 0000664 0000000 0000000 00000012611 15035076111 0015611 0 ustar 00root root 0000000 0000000 # Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[here](https://github.com/sony/esstra/issues/new).
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series of
actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within the
community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].
[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
esstra-0.2.0/CONTRIBUTING.md 0000664 0000000 0000000 00000007462 15035076111 0015253 0 ustar 00root root 0000000 0000000 # Contributing Guidelines
We gratefully accept contributions from the community. Please take a moment to review this document and our [Code of Conduct](CODE_OF_CONDUCT.md) in order to make the contribution process efficient and pleasant for everyone involved.
## Bug Reports
If you think you have found a bug, first make sure that you are testing against the latest version, in case your issue has already been fixed. Search our issues list on GitHub to see if a similar or related problem has already been reported.
When creating a new issue, or updating an existing one, please provide as much contextual information as you can. What environment, device and OS do you use? What is your build configuration? With what version of dependencies and with which compiler and toolchain did you build?
In addition it will be very helpful if you can provide a unit test, system test, or step by step instructions to reproduce the bug. It makes it much easier to find the problem and fix it.
## Feature Requests
If you find yourself wishing for a feature that doesn't exist, you are probably not alone. There are bound to be others with similar needs. Open an issue on our issues list on GitHub, detailing:
- The feature you would like to see
- Why it is important
- How it should work
- How you will use it
## Contributing Code, Tests, and Documentation
Send us your pull requests! For those just getting started, GitHub has a [how to](https://help.github.com/articles/using-pull-requests/).
### Submit a Pull Request (PR)
- Check for open issues or PRs related to your change.
- Before writing any code, consider creating a new issue for any major change and enhancement that you wish to make. It may be that somebody is already working on it, or that there are particular complexities that you should know about.
- Fork the repository on GitHub to start making your changes. As a general rule, you should use the "main" branch as a basis.
- Include unit tests when you contribute new features, as they help to prove that your code works correctly and guard against future breaking changes.
- Bug fixes also generally require unit tests, because the presence of bugs usually indicates insufficient test coverage.
- Keep API compatibility in mind when you change code in core functionality. Any non-backward-compatible public API changes will require a major version increment.
- Include a license header at the top of all new files.
- Please avoid including unrelated commits and changes in your PR branch.
- Before submitting a PR, test locally. Run formatting checks and unit tests on your development machine. See [the build instructions](README.md#how-to-build-and-install) for details.
- Send a PR and work with us until it is merged. Contributions may need some modifications, so a few rounds of review and fixing may be necessary.
- For quick merging, the contribution should be short, and concentrated on a single feature or topic. The larger the contribution is, the longer it takes to review and merge.
- Include as much context as possible: What problem does your PR solve, how does it solve it, and why is it important?
Our team members will review your PR, and once it is approved and passes continuous integration checks it will be ready to merge.
Bear in mind that when you contribute a new feature, the maintenance burden is transferred to our team. This means that the benefit of the contribution must be compared against the cost of maintaining the feature.
> [!WARNING]
>
> By submitting a PR, you agree to license your work under the same license as that used by the project.
## License and Copyright
Contributors accept that their contributions are made under the [LICENSE](LICENSE) file. All new files should include the standard license header and `SPDX-License-Identifier` where possible. See the [LICENSE](LICENSE) file for the full text of this license.
esstra-0.2.0/CONTRIBUTORS 0000664 0000000 0000000 00000000033 15035076111 0014665 0 ustar 00root root 0000000 0000000 Armijn Hemel
Hideki Yamane
esstra-0.2.0/LICENSE 0000664 0000000 0000000 00000004203 15035076111 0014015 0 ustar 00root root 0000000 0000000 GCC Plugin file ./core/esstracore.cpp:
======================================
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-FileCopyrightText: Copyright 2024-2025 Sony Group Corporation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
Third party modules under ./third-party:
========================================
The "third-party" directory contains code from other projects.
Each directory has its project's license terms and conditions.
Other files under ./:
=====================
SPDX-License-Identifier: MIT
SPDX-FileCopyrightText: Copyright 2024-2025 Sony Group Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
esstra-0.2.0/Makefile 0000664 0000000 0000000 00000000556 15035076111 0014457 0 ustar 00root root 0000000 0000000 # SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: Copyright 2024-2025 Sony Group Corporation
PREFIX ?= /usr/local
SUBDIRS := core util
.PHONY: all clean install install-specs uninstall-specs
all install-specs uninstall-specs:
@make -C core PREFIX=$(PREFIX) $@
install clean:
@for dir in $(SUBDIRS); do \
$(MAKE) -C $$dir PREFIX=$(PREFIX) $@; \
done
esstra-0.2.0/README.md 0000664 0000000 0000000 00000017104 15035076111 0014273 0 ustar 00root root 0000000 0000000 # Project ESSTRA
Project "ESSTRA", a software suite for
**E**nhancing **S**oftware **S**upply Chain **Tra**nsparency,
aims to improve the transparency of software supply chains as the name suggests.
More specifically, the goal of this project is to provide a set of tools to
help illuminate and unveil the "dark" areas in software supply chains where
critical information about software components is unclear, primarily from
software traceability and compliance perspective.
The current version of ESSTRA takes an approach of embedding metadata in
resulting binary files at compile time with GCC.
The metadata contains information about the source and header files from which
the binary file is generated.
For detailed usage and applications, please refer to the
[Samples](./samples/) that help you understand ESSTRA using simple
source code, as well as the [Case Study documentation](./doc/case-study) on
using ESSTRA for open-source software and Linux distributions.
## Status of This Version
ESSTRA is being developed on Ubuntu 22.04 with GCC 11.4.0 and Python
3.10.12 installed on an x86\_64 PC.
We have also confirmed that ESSTRA can be built and run on an Aarch64 (arm64)
Docker container virtualized with QEMU on an x86\_64 PC.
This is a preliminary version. The data format and content of the metadata,
as well as the specifications and functionality of the tools are tentative
and subject to change.
## ESSTRA's Components
The current version of ESSTRA consists of two tools:
* [ESSTRA Core](./core)
* [ESSTRA Utility](./util)
The ESSTRA Core (`esstracore.so`) is a
[GCC plugin](https://gcc.gnu.org/wiki/plugins) that intervenes in compilation
process of GCC and embeds metadata into the resulting binary file.
In this version, a list of the absolute paths of all source and header
files involved in compilation is embedded in the binary file as metadata.
The ESSTRA Utility (`esstra.py`) is a Python script for accessing metadata in
binary files embedded by the ESSTRA Core.
In this version, you can output metadata in YAML format, shrink metadata by
removing duplication, and attach license information to metadata by specifying
files in the
[SPDX 2.3 tag-value format](https://spdx.github.io/spdx-spec/v2.3/)
which contain license information.
## Technical Overview
The ESSTRA Core creates a section in the resulting ELF file to store metadata
during compilation.
The ESSTRA Utility allows users to access the metadata. For example, you can
update the metadata using license information detected from the source files,
delete some or all of the metadata, output the metadata to the console, or
pass it to other SCA (Software Composition Analysis) tools.

## How to Build and Install
Before building the GCC plugin, you need to install a package on your system.
For Debian/Ubuntu, first check the version of GCC:
```sh
$ gcc --version
gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
...
```
In this case, the major version is 11, so install the package named
`gcc-11-plugin-dev`:
```sh
$ sudo apt install gcc-11-plugin-dev
```
Since the [ESSTRA Utility](./util) uses the [PyYAML](https://pyyaml.org/)
module to handle YAML data, you may need to install it by typing:
```sh
$ pip install pyyaml
or
$ sudo apt install python3-yaml
```
After that, run `make` in the top directory:
```sh
$ make
```
If there are no errors, the build is complete.
To install the ESSTRA Core and the ESSTRA Utility on your system, run the
following command:
```sh
$ sudo make install
```
Then the files `esstracore.so` and `esstra.py` will be installed in the directory
`/usr/local/lib/gcc///plugin/` and `/usr/local/bin/`,
respectively.
## How to Use
The workflow using ESSTRA is as follows:
1. Compile source files with GCC using the ESSTRA Core
2. Use the ESSTRA Utility to access metadata embedded in the binary files
The example below compiles a source file
`hello.c` with `gcc` and generates a binary file `hello`.
(See also [Sample "hello"](./samples/hello/))
First, compile the source file `hello.c` by passing the path of
`esstracore.so` to the compiler with the `-fplugin` option.
Since we are using GCC version 11 on an x86\_64 PC, the command line would be as follows:
```sh
$ gcc -fplugin=/usr/local/lib/gcc/x86_64-linux-gnu/11/plugin/esstracore.so hello.c -o hello
```
The intervention of `esstracore.so` embeds metadata in the resulting
binary file `hello`. Note that this does not affect the behavior of the
binary file itself.
To access the embedded metadata, use the script `esstra.py`. The first argument
of this script is a *command*, and the second or subsequent arguments are the
arguments of the *command*.
The command `show` displays metadata in binary files in YAML format.
A command line:
```sh
$ esstra.py show hello
```
would generate an output as follows:
```yaml
#
# BinaryFileName: hello
# BinaryPath: /home/snagao/esstra/samples/hello/hello
#
Headers:
ToolName: ESSTRA Core
ToolVersion: 0.2.0
DataFormatVersion: 0.1.0
InputFileNames:
- hello.c
SourceFiles:
- Directory: /home/snagao/esstra/samples/hello
Files:
- File: hello.c
SHA1: 4bbee85215cbcb6a4f1625e4851cca19b0d3f6e2
- Directory: /usr/include
Files:
- File: features-time64.h
SHA1: 57c3c8093c3af70e5851f6d498600e2f6e24fdeb
- File: features.h
SHA1: d8725bb98129d6d70ddcbf010021c2841db783f7
- File: stdc-predef.h
SHA1: 2fef05d80514ca0be77efec90bda051cf87d771f
- File: stdio.h
SHA1: c7181b48c4194cd122024971527aab4056baf600
- Directory: /usr/include/x86_64-linux-gnu/bits
Files:
- File: typesizes.h
SHA1: ee94b5a60d007c23bdda9e5c46c8ba40f4eb402c
- File: wordsize.h
SHA1: 281ddd3c93f1e8653e809a45b606574c9b691092
- Directory: /usr/include/x86_64-linux-gnu/bits/types
Files:
- File: FILE.h
SHA1: 497924e329d53517631713ae52acb73e870d7d65
- File: __FILE.h
SHA1: 274242343e85d1c06e7f5ccc5abf15e120f6e957
- File: __fpos64_t.h
SHA1: ac38e294b004f6e2bf18f1c55e03dc80f48d6830
- File: __fpos_t.h
SHA1: 760ef77769ac1921f4b1f908cbf06863e2506775
- File: __mbstate_t.h
SHA1: e3a4f2ee55e635520db0b4610d2b361e9ce41de7
- File: struct_FILE.h
SHA1: 1dbf8bac589cb09e09aa4c1d36913e549a57bcf0
- Directory: /usr/include/x86_64-linux-gnu/gnu
Files:
- File: stubs-64.h
SHA1: f7603fa3908b56e9d1b33c91590db3252e13a799
- File: stubs.h
SHA1: be168037b7503a82b1cf694cdbac8c063bb6e476
- Directory: /usr/include/x86_64-linux-gnu/sys
Files:
- File: cdefs.h
SHA1: a419a6372029d89ba38ada0811d34f51df8d09b7
- Directory: /usr/lib/gcc/x86_64-linux-gnu/11/include
Files:
- File: stdarg.h
SHA1: fa23f49da8a0a5068b781dff7182f1a1c363dc30
- File: stddef.h
SHA1: 0de70008ffa3f198baf55c7b3f3d03b4ca11c21f
```
For more details, refer to the file [util/README.md](/util/README.md).
### Installing Spec File
It can be quite annoying to specify `-fplugin=....` for every `gcc`/`g++`
invocation.
To avoid this tedious task, simply type:
```sh
$ sudo make install-specs
```
This command installs a
[GCC spec file](https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html)
on your system which enables the option:
* `-fplugin=/usr/local/lib/gcc///plugin/esstracore.so`
by default.
After that, compiling anything with GCC as usual:
```sh
$ gcc hello.c -o hello
```
will generate a binary file with metadata embedded by the ESSTRA Core.
This is a very useful feature when you compile open-source or closed-source
projects and want the information the ESSTRA Core generates for them.
For more details about installing/uninstalling the spec file,
refer to the file [core/README.md](./core/README.md).
## License
See the [LICENSE](./LICENSE) file.
esstra-0.2.0/assets/ 0000775 0000000 0000000 00000000000 15035076111 0014313 5 ustar 00root root 0000000 0000000 esstra-0.2.0/assets/tech-overview.png 0000664 0000000 0000000 00000353515 15035076111 0017624 0 ustar 00root root 0000000 0000000 PNG
IHDR 8 C sRGB gAMA a pHYs % %IR$ IDATx^^^E U$$4j?`Oc&jb
{'
p\~ٽۻۛ}=}Svvr(,,
3 ( )***; h ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' &Q