Skip to content

Evinse for scala + SaaSBOM v2 #1714

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

Merged
merged 17 commits into from
Mar 31, 2025
Merged

Evinse for scala + SaaSBOM v2 #1714

merged 17 commits into from
Mar 31, 2025

Conversation

prabhu
Copy link
Collaborator

@prabhu prabhu commented Mar 31, 2025

SaaSBOM v2

SaaSBOM v2 powered by atom-tools. cdxgen can now track even the http method for the given service endpoint under the property cdx:service:httpMethod.

"services": [
        {
            "name": "service-v1posts-delete",
            "endpoints": [
                "/v1/posts"
            ],
            "properties": [
                {
                    "name": "cdx:service:httpMethod",
                    "value": "delete"
                },
                {
                    "name": "internal:operationId",
                    "value": "v1.post.PostRouter-4"
                }
            ]
        },
        {
            "name": "service-v1posts-get",
            "endpoints": [
                "/v1/posts"
            ],
            "properties": [
                {
                    "name": "cdx:service:httpMethod",
                    "value": "get"
                },
                {
                    "name": "internal:operationId",
                    "value": "v1.post.PostRouter-1"
                }
            ]
        },
cdx ↝ .services
╔═══════════════════════════════════════════════════════════════════════╗
║                           List of Services                            ║
║                      Generated with ♥  by cdxgen                      ║
╟────────────────────────┬───────────┬───────────────┬──────────────────╢
║ Name                   │ Endpoints │ Authenticated │ X Trust Boundary ║
╟────────────────────────┼───────────┼───────────────┼──────────────────╢
║ service-v1posts-delete │ /v1/posts │               │                  ║
╟────────────────────────┼───────────┼───────────────┼──────────────────╢
║ service-v1posts-get    │ /v1/posts │               │                  ║
╟────────────────────────┼───────────┼───────────────┼──────────────────╢
║ service-v1posts-patch  │ /v1/posts │               │                  ║
╟────────────────────────┼───────────┼───────────────┼──────────────────╢
║ service-v1posts-post   │ /v1/posts │               │                  ║
╟────────────────────────┼───────────┼───────────────┼──────────────────╢
║ service-v1posts-put    │ /v1/posts │               │                  ║
╚════════════════════════╧═══════════╧═══════════════╧══════════════════╝

Evinse for scala

For the first time, we can plot occurrences evidence for scala projects. The granularity is accurate only to the file level though, since we lose the line number information with our hybrid analyzer.

cdx ↝ .occurrences
Component Evidence
Generated with ♥  by cdxgen
╔════════════════════════════════╤════════════════════════════════╤═══════════════════════════╤══════════════════════════════════════════════════════════════════════════════════╗
║ Group                          │ Name                           │                   Version │ Occurrences                                                                      ║
╟────────────────────────────────┼────────────────────────────────┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────╢
║ io.lemonlabs                   │ scala-uri_2.13                 │                     4.0.3 │ app/v1/post/PostRouter.scala                                                     ║
╟────────────────────────────────┼────────────────────────────────┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────╢
║ com.google.inject              │ guice                          │                     6.0.0 │ app/Module.scala                                                                 ║
╟────────────────────────────────┼────────────────────────────────┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────╢
║ net.logstash.logback           │ logstash-logback-encoder       │                       7.3 │ app/v1/post/PostActionBuilder.scala                                              ║
╟────────────────────────────────┼────────────────────────────────┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────╢
║ org.playframework              │ play_2.13                      │                     3.0.7 │ app/ErrorHandler.scala                                                           ║
║                                │                                │                           │ app/RequestHandler.scala                                                         ║
║                                │                                │                           │ app/v1/post/PostActionBuilder.scala                                              ║
║                                │                                │                           │ app/v1/post/PostRepository.scala                                                 ║
║                                │                                │                           │ app/v1/post/PostResourceHandler.scala                                            ║
║                                │                                │                           │ app/v1/post/PostRouter.scala                                                     ║
║                                │                                │                           │ target/scala-2.13/routes/main/router/Routes.scala                                ║
╟────────────────────────────────┼────────────────────────────────┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────╢
║ org.slf4j                      │ slf4j-api                      │                    2.0.17 │ app/ErrorHandler.scala                                                           ║
║                                │                                │                           │ app/v1/post/PostActionBuilder.scala                                              ║
╟────────────────────────────────┼────────────────────────────────┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────╢
║ org.playframework              │ play-configuration_2.13        │                     3.0.7 │ app/ErrorHandler.scala                                                           ║
╟────────────────────────────────┼────────────────────────────────┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────╢
║ org.playframework              │ play-json_2.13                 │                     3.0.4 │ app/ErrorHandler.scala                                                           ║
╟────────────────────────────────┼────────────────────────────────┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────╢
║ com.example.play-scala-rest-ap │ com.example.play-scala-rest-ap │                           │ app/ErrorHandler.scala                                                           ║
║ i-example-1.0-SNAPSHOT-sans-ex │ i-example-1.0-SNAPSHOT-sans-ex │                           │ app/v1/post/PostController.scala                                                 ║
║ ternalized                     │ ternalized                     │                           │ app/v1/post/PostRepository.scala                                                 ║
║                                │                                │                           │ app/v1/post/PostResourceHandler.scala                                            ║
║                                │                                │                           │ target/scala-2.13/routes/main/router/Routes.scala                                ║
║                                │                                │                           │ target/scala-2.13/routes/main/router/RoutesPrefix.scala                          ║
╟────────────────────────────────┼────────────────────────────────┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────╢
║ com.example                    │ play-scala-rest-api-example_2. │              1.0-SNAPSHOT │ app/ErrorHandler.scala                                                           ║
║                                │ 13-1.0-SNAPSHOT                │                           │ app/v1/post/PostController.scala                                                 ║
║                                │                                │                           │ app/v1/post/PostRepository.scala                                                 ║
║                                │                                │                           │ app/v1/post/PostResourceHandler.scala                                            ║
║                                │                                │                           │ target/scala-2.13/routes/main/router/Routes.scala                                ║
║                                │                                │                           │ target/scala-2.13/routes/main/router/RoutesPrefix.scala                          ║
╟────────────────────────────────┼────────────────────────────────┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────╢
║ play-scala-rest-api-example_2. │ play-scala-rest-api-example_2. │              1.0-SNAPSHOT │ app/ErrorHandler.scala                                                           ║
║ 13-1.0-SNAPSHOT-sources        │ 13-1.0-SNAPSHOT-sources        │                           │ target/scala-2.13/routes/main/router/Routes.scala                                ║
║                                │                                │                           │ target/scala-2.13/routes/main/router/RoutesPrefix.scala                          ║
╟────────────────────────────────┼────────────────────────────────┼───────────────────────────┼──────────────────────────────────────────────────────────────────────────────────╢
║ play-scala-rest-api-example_2. │ play-scala-rest-api-example_2. │                           │ app/ErrorHandler.scala                                                           ║
║ 13-1.0-SNAPSHOT-sans-externali │ 13-1.0-SNAPSHOT-sans-externali │                           │ app/v1/post/PostController.scala                                                 ║
║ zed                            │ zed                            │                           │ app/v1/post/PostRepository.scala                                                 ║
║                                │                                │                           │ app/v1/post/PostResourceHandler.scala                                            ║
║                                │                                │                           │ target/scala-2.13/routes/main/router/Routes.scala                                ║
║                                │                                │                           │ target/scala-2.13/routes/main/router/RoutesPrefix.scala                          ║
╚════════════════════════════════╧════════════════════════════════╧═══════════════════════════╧══════════════════════════════════════════════════════════════════════════════════╝

Also fixes #1698

Signed-off-by: Prabhu Subramanian <[email protected]>
@prabhu
Copy link
Collaborator Author

prabhu commented Mar 31, 2025

@prabhu
Copy link
Collaborator Author

prabhu commented Mar 31, 2025

For any interested students out there, the current state of our callstack evidence for Scala is shown below. I have some ideas to convert this back to a callstack representing the source, but best done as a graduate-level research project.

cdx ↝ .callstack
╔══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║                                                                          Component Call Stack Evidence                                                                           ║
║                                                                           Generated with ♥  by cdxgen                                                                            ║
╟──────────────┬──────────────┬─────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ Group        │ Name         │ Version │ Call Stack                                                                                                                               ║
╟──────────────┼──────────────┼─────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ javax.inject │ javax.inject │ 1       │ /var/folders/sj/g0xj1gyn05qcvc6r3j3syg6h0000gn/T/jimple2cpg-16032504132115585684/ErrorHandler.class#40                                   ║
║              │              │         │ ├──  /var/folders/sj/g0xj1gyn05qcvc6r3j3syg6h0000gn/T/jimple2cpg-16032504132115585684/ErrorHandler.class#41                              ║
║              │              │         │ └──  /var/folders/sj/g0xj1gyn05qcvc6r3j3syg6h0000gn/T/jimple2cpg-16032504132115585684/ErrorHandler$$anonfun$$lessinit$greater$1.class#36 ║
╚══════════════╧══════════════╧═════════╧══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝

prabhu added 5 commits March 31, 2025 19:10
Signed-off-by: Prabhu Subramanian <[email protected]>
Signed-off-by: Prabhu Subramanian <[email protected]>
Signed-off-by: Prabhu Subramanian <[email protected]>
Signed-off-by: Prabhu Subramanian <[email protected]>
Signed-off-by: Prabhu Subramanian <[email protected]>
prabhu added 3 commits March 31, 2025 23:34
Signed-off-by: Prabhu Subramanian <[email protected]>
Signed-off-by: Prabhu Subramanian <[email protected]>
Signed-off-by: Prabhu Subramanian <[email protected]>
@prabhu prabhu merged commit c2c0567 into master Mar 31, 2025
30 of 31 checks passed
@prabhu prabhu deleted the feature/saasbom-v2 branch March 31, 2025 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[python] setuptools 78.0.1 is breaking sbom generation
1 participant