grapl-security / grapl

Graph platform for Detection and Response
https://www.graplsecurity.com
Apache License 2.0
686 stars 78 forks source link

Set service.version on the service level #2084

Closed ghost closed 2 years ago

ghost commented 2 years ago

Which issue does this PR correspond to?

Fixes https://github.com/grapl-security/issue-tracker/issues/1051

What changes does this PR make to Grapl? Why?

This sets the service.version tag at the service level instead of the job level. As Grapl only rebuilds and tags containers that have changes, the versions for each service within a job are not the same.

How were these changes tested?

Tests

ghost commented 2 years ago

Right now I've chosen to create a second Mapping. An alternative approach (and more efficient) would be to create a single container_meta Mapping that looks something like

{
    container_name: {
        image: container_image_id
        version: container_version
    }
}

The tradeoff here is between verbosity (every affected line in Nomad would be longer) and efficiency

codecov[bot] commented 2 years ago

Codecov Report

Base: 39.24% // Head: 39.21% // Decreases project coverage by -0.02% :warning:

Coverage data is based on head (c8305fa) compared to base (3bb3f51). Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2084 +/- ## ========================================== - Coverage 39.24% 39.21% -0.03% ========================================== Files 435 435 Lines 10221 10228 +7 ========================================== Hits 4011 4011 - Misses 6210 6217 +7 ``` | [Impacted Files](https://codecov.io/gh/grapl-security/grapl/pull/2084?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=grapl-security) | Coverage Δ | | |---|---|---| | [pulumi/grapl/\_\_main\_\_.py](https://codecov.io/gh/grapl-security/grapl/pull/2084/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=grapl-security#diff-cHVsdW1pL2dyYXBsL19fbWFpbl9fLnB5) | `0.00% <0.00%> (ø)` | | | [pulumi/infra/docker\_images.py](https://codecov.io/gh/grapl-security/grapl/pull/2084/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=grapl-security#diff-cHVsdW1pL2luZnJhL2RvY2tlcl9pbWFnZXMucHk=) | `0.00% <0.00%> (ø)` | | | [pulumi/python\_integration\_tests/\_\_main\_\_.py](https://codecov.io/gh/grapl-security/grapl/pull/2084/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=grapl-security#diff-cHVsdW1pL3B5dGhvbl9pbnRlZ3JhdGlvbl90ZXN0cy9fX21haW5fXy5weQ==) | `0.00% <0.00%> (ø)` | | | [pulumi/rust\_integration\_tests/\_\_main\_\_.py](https://codecov.io/gh/grapl-security/grapl/pull/2084/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=grapl-security#diff-cHVsdW1pL3J1c3RfaW50ZWdyYXRpb25fdGVzdHMvX19tYWluX18ucHk=) | `0.00% <0.00%> (ø)` | | | [...rust-proto/src/graplinc/grapl/api/graph/v1beta1.rs](https://codecov.io/gh/grapl-security/grapl/pull/2084/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=grapl-security#diff-c3JjL3J1c3QvcnVzdC1wcm90by9zcmMvZ3JhcGxpbmMvZ3JhcGwvYXBpL2dyYXBoL3YxYmV0YTEucnM=) | `54.10% <0.00%> (-0.31%)` | :arrow_down: | | [src/rust/sysmon-parser/src/util.rs](https://codecov.io/gh/grapl-security/grapl/pull/2084/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=grapl-security#diff-c3JjL3J1c3Qvc3lzbW9uLXBhcnNlci9zcmMvdXRpbC5ycw==) | `41.61% <0.00%> (+0.67%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=grapl-security). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=grapl-security)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.