Giter Club home page Giter Club logo

project-freta's Introduction

Project Freta

Summary

The Freta SDK enables access to Project Freta, a service used to inspect volatile memory images.

Included in this library is a utility, freta, which provides command line access to the Project Freta service.

Documentation

  • Service Documentation contains information on how to use the Service and details to the information exposed by the Freta analysis.
  • CLI Reference contains information on how to use the Freta CLI to interact with the Freta service.
  • Module Documentation describes the APIs and data structures to programmatically interact with the Freta service.
  • Examples demonstrates how to build upon the SDK to automate Freta.

Installing

cargo install freta

Building

The Freta client is written in Rust and requires Rust 1.64.0 (stable) or newer.

To build freta:

$ git clone https://github.com/microsoft/project-freta
$ cd project-freta
$ cargo build --release
$ ./target/release/freta --version
0.9.0

Using the Client

$ freta info
{
  "api_version": "0.7.2",
  "models_version": "0.9.0",
  "current_eula": "993C44214D3E5D0EEB92679E41FC0C4D69DA9C37EF97988FB724C7B2493695BB",
  "formats": [
    "vmrs",
    "raw",
    "lime",
    "core",
    "avmh"
  ]
}
$ freta images upload ~/projects/samples/centos-6-2.6.32-754.17.1.el6/OpenLogic\:CentOS\:6.10\:latest.lime
[2022-10-20T17:37:39Z INFO  freta] uploading as image id: 78f6bdc7-31ce-4877-a67e-f7137db248bd
206.99 MiB (25.26 MiB/s)
$ freta images list
[
    {
      "last_updated": "2022-10-20T17:38:29.7311842Z",
      "owner_id": "72f988bf-86f1-41af-91ab-2d7cd011db47_09731d72-f8a6-463c-9efe-ca0bedfd82ae",
      "image_id": "78f6bdc7-31ce-4877-a67e-f7137db248bd",
      "state": "completed",
      "format": "lime",
      "tags": {},
      "shareable": false
    },    
]

Using Freta with automated tools

Instead of logging in as a user to the Freta service, automated tools can use the Azure service principals for authentication.

First, create a service principal:

$ az ad sp create-for-rbac -n YOUR_SERVICE_PRINCIPAL_NAME_HERE
{
  "appId": "00000000-0000-0000-0000-000000000000",
  "displayName": "YOUR_SERVICE_PRINCIPAL_NAME_HERE",
  "password": "REDACTED_PASSWORD_HERE",
  "tenant": "REDACTED_TENANT_HERE",
}

Then configure the freta client to use the newly created service principal, use the appId from the output of the previous command as the --client-id and the password as the --client-secret, and use the tenant as the --tenant-id:

$ freta config --client-id APP_ID_HERE --client-secret PASSWORD_HERE --tenant-id TENANT_HERE
[2023-01-04T19:43:34Z INFO  freta] config saved: Config { api url: "https://freta.microsoft.com/", client id: "00000000-0000-0000-0000-000000000000", tenant id: "REDACTED_TENANT_HERE", client secret: "[redacted]", scope: "api://a934fc14-92d7-4127-aecd-bddab35935da/.default" }

Before using the service, the service principal must agree to the Freta EULA. This can be done by running the following command:

$ freta eula accept

From here, the client can be used in an automated fashion.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Reporting Security Issues

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at [email protected]. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

project-freta's People

Contributors

bmc-msft avatar demoray avatar dependabot[bot] avatar duzvik avatar microsoft-github-operations[bot] avatar microsoftopensource avatar pedrovieira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

project-freta's Issues

Interprocess Communication report section

Would it be possible to extract and report process IPC? It looks like Freta currently reports INET and UNIX domain sockets (under the "Networks" and "Open Files" sections). You could create a new report section to consolidate all IPC information (UDS, Netlink sockets, and adding shared memory) or add this to the "Processes" section.

500 Error

Ran a basic pip install and run:

$> freta image formats
ERROR:nsv-backend:request did not succeed: HTTP 500 -
Traceback (most recent call last):
  File "C:\testing\venv\Scripts\freta-script.py", line 33, in <module>
    sys.exit(load_entry_point('freta==0.0.15', 'console_scripts', 'freta')())
  File "C:\testing\venv\lib\site-packages\freta\__main__.py", line 16, in main
    return execute_api(Freta(), [Endpoint], __version__)
  File "C:\testing\venv\lib\site-packages\freta\cli.py", line 315, in execute_api
    result = call_func(args.func, args)
  File "C:\testing\venv\lib\site-packages\freta\cli.py", line 38, in call_func
    return func(**myargs)
  File "C:\testing\venv\lib\site-packages\freta\api.py", line 109, in formats
    return self.backend.request("GET", "image_formats")
  File "C:\testing\venv\lib\site-packages\freta\backend.py", line 233, in request
    raise Error(
freta.backend.Error: 'request did not succeed: HTTP 500 - '

Python API on MS Learn not in use?

Hi, Project Freta owners,

We are the Learn engieering team for API reference documentation. We found that the previously released package “freta” was taken offline from pypi. And the Python SDK is also removed from the github repo. The SDK has been rewritten in Rust. With all of these changes, our reference generation pipeline cannot consume the python package and failed to rebuild the API documents.

Based on the current documentation list, it seems that https://learn.microsoft.com/en-us/python/api/freta/ is not in use anymore. Please help confirm so that we can remove the CI job for publishing, and removed the outdated API from Learn.microsoft.com.

Thank you!

Freta access token

It's possible to get Freta access token via OAuth 2 client credentials flow?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.