Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0ca5ff5
Rd 10787 separate build from prep (#59)
therightstuff Jun 1, 2023
501063e
1.0.39 → 1.0.40. Changes: 0ca5ff5 Rd 10787 separate build from prep (…
Jun 1, 2023
cde6ff8
feat: support java 17 & 21 (#61)
nadav3396 May 5, 2024
2765771
fix: bring back developers (#62)
nadav3396 May 6, 2024
85f68e5
fix: Update public key (#63)
nadav3396 May 6, 2024
1fee17a
fix: update mvn signing keys (#64)
nadav3396 May 6, 2024
c8292c8
1.0.40 → 1.0.41. Changes: 1fee17a fix: update mvn signing keys (#64)
May 6, 2024
92252db
feat: add support for aws sdk v2 (Rd 12691) (#65)
nadav3396 May 16, 2024
5adc9c4
1.0.41 → 1.0.42. Changes: 92252db feat: add support for aws sdk v2 (R…
May 16, 2024
7ebb712
RD-12747 - secret scrubbing (#66)
harelmo-lumigo May 22, 2024
24062f4
1.0.42 → 1.0.43. Changes: 7ebb712 RD-12747 - secret scrubbing (#66)
May 22, 2024
09bf2e5
Rd 12757 java tracer support kafka instrumentation (#67)
nadav3396 May 26, 2024
ebe9361
1.0.43 → 1.0.44. Changes: 09bf2e5 Rd 12757 java tracer support kafka …
May 26, 2024
9252fa5
chore: add gradle instructions to the readme (#70)
nadav3396 Jun 6, 2024
7c785df
1.0.44 → 1.0.45. Changes: 9252fa5 chore: add gradle instructions to t…
Jun 6, 2024
add1397
RD-12747 - document the secret scrubbing behavior (#69)
harelmo-lumigo Jun 9, 2024
ccb259e
1.0.45 → 1.0.46. Changes: add1397 RD-12747 - document the secret scru…
Jun 9, 2024
abd9183
Update README (#72)
harelmo-lumigo Jun 10, 2024
93a6a12
1.0.46 → 1.0.47. Changes: abd9183 Update README (#72)
Jun 10, 2024
2f74bf6
feat: support auto-trace with layer (#73)
nadav3396 Jun 26, 2024
0773071
fix: version release (#74)
nadav3396 Jun 26, 2024
39a9013
hotfix: use new maven access token (#75)
nadav3396 Jun 26, 2024
bf0b2cd
hotfix: config credentials (#76)
nadav3396 Jun 26, 2024
fb27b5a
hotfix: bump version (#77)
nadav3396 Jun 26, 2024
69d0788
1.0.48 → 1.0.49. Changes: fb27b5a hotfix: bump version (#77)
Jun 26, 2024
3c5744e
docs: update layers md [skip ci]
Jun 26, 2024
fb3d173
feat: support il-central-1 region (#79)
moshe-shaham-lumigo Feb 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.39
current_version = 1.0.49
commit = True
tag = True

Expand All @@ -11,4 +11,6 @@ tag = True

[bumpversion:file:src/main/java/io/lumigo/core/configuration/Configuration.java]

[bumpversion:file:scripts/prepare_layer_files.sh]

[bumpversion:file:src/main/resources/lumigo-version.txt]
41 changes: 17 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,55 +33,47 @@ workflows:

- lumigo-orb/be-deploy:
context: common
save_project_folder: false
requires:
- lumigo-orb/is_environment_available

- lumigo-orb/integration-test-prep:
context:
- common
- java
deploy_spec: java
install_maven_dependencies: true
run_test_cleanup: false
- lumigo-orb/prep-it-resources:
context: common
requires:
- lumigo-orb/be-deploy
- lumigo-orb/is_environment_available

- lumigo-orb/integration-test-cleanup:
name: pre-test-cleanup
- lumigo-orb/prep-k8s-and-operator:
context: common
requires:
- lumigo-orb/integration-test-prep
- lumigo-orb/is_environment_available

- lumigo-orb/integration-test-limited-flows:
- lumigo-orb/integration-test-parallel:
context: common
deploy_spec: java
run_test_cleanup: false
requires:
- pre-test-cleanup
- lumigo-orb/be-deploy
- lumigo-orb/prep-it-resources
- lumigo-orb/prep-k8s-and-operator

- lumigo-orb/integration-test-parallel:
- lumigo-orb/e2e-test:
context: common
deploy_spec: java
run_test_cleanup: false
requires:
- lumigo-orb/integration-test-limited-flows
- lumigo-orb/be-deploy
- lumigo-orb/prep-it-resources
- lumigo-orb/prep-k8s-and-operator

- lumigo-orb/integration-test-cleanup:
name: post-test-cleanup
context: common
requires:
- lumigo-orb/integration-test-parallel

- lumigo-orb/e2e-test:
context: common
requires:
- lumigo-orb/integration-test-limited-flows
- lumigo-orb/e2e-test

- lumigo-orb/workflow-completed-successfully:
context: common
requires:
- test
- lumigo-orb/integration-test-parallel
- test
- lumigo-orb/e2e-test

- deploy:
Expand All @@ -108,4 +100,5 @@ jobs:
- lumigo-orb/checkout_code
- run: mvn clean install
- run: ../utils/common_bash/defaults/code_cov.sh
- run: cd .. && git clone git@github.com:lumigo-io/larn.git
- run: ./scripts/bd_to_prod.sh
1 change: 0 additions & 1 deletion .github/CODEOWNERS

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/send-pr-details-on-close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Send PR close event to the environment manager

on:
pull_request:
types: [closed]

jobs:
send-pr-close-event-to-env-manager:
runs-on: ubuntu-latest
steps:
- name: Send PR Close Event To Env Manager
run: |
full_repository_name="${{github.repository}}"
# the repository name is everything after the slash "lumigo-io/" in the full repository name
repository_name="${full_repository_name#lumigo-io/}"

source_branch_name="${{github.head_ref}}"

is_merged="${{github.event.pull_request.merged}}"
if [ "$is_merged" = "true" ]; then
event="PR_MERGED"
else
event="PR_CLOSED"
fi

request_type="POST"
route="v1/github_actions_trigger"

body="{"
body+=" \"event\": \"${event}\""
body+=" , \"repository_name\": \"${repository_name}\""
body+=" , \"source_branch_name\": \"${source_branch_name}\""
body+="}"

params=(\
-s \
--header "x-api-key: ${{secrets.ENV_MANAGER_API_KEY}}" \
--header "Content-Type: application/json" \
--compressed \
--request "$request_type" \
--data "$body")

# ENV_MANAGER_API_ROOT="https://XXXX.execute-api.us-west-2.amazonaws.com/prod/env-manager/v1"
params+=("${{secrets.ENV_MANAGER_API_ROOT}}/${route}")
curl "${params[@]}" | tr -d '\r'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,4 @@ _meta
.serverless
package-lock.json
src/main/resources/lumigo-agent.jar
.vscode/
109 changes: 101 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Java Tracer

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/lumigo-io/java-tracer/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/lumigo-io/java-tracer/tree/master)
![Version](https://img.shields.io/badge/version-1.0.39-green.svg)
![Version](https://img.shields.io/badge/version-1.0.49-green.svg)
[![codecov](https://codecov.io/gh/lumigo-io/java-tracer/branch/master/graph/badge.svg?token=D3IZ5hQwaQ)](https://codecov.io/gh/lumigo-io/java-tracer)

Supported Runtimes: Java 8, Java 11
Supported Runtimes: Java 8, Java 11, Java 17, Java 21

## Building With Lumigo
Include lumigo java tracer dependency

### Maven

Include lumigo java tracer dependency, for [Maven](https://maven.apache.org) projects, use:
For [Maven](https://maven.apache.org) projects, use:

```xml
<repositories>
Expand All @@ -25,16 +25,34 @@ Include lumigo java tracer dependency, for [Maven](https://maven.apache.org) pro
<dependency>
<groupId>io.lumigo</groupId>
<artifactId>java-tracer</artifactId>
<version>1.0.39</version>
<version>1.0.49</version>
</dependency>

<dependency>
<groupId>io.lumigo</groupId>
<artifactId>lumigo-agent</artifactId>
<version>1.0.39</version>
<version>1.0.49</version>
</dependency>
```

### Gradle
For [Gradle](https://gradle.org) projects, use:

```groovy
repositories {
maven {
url 'https://raw.githubusercontent.com/lumigo-io/java-tracer/master/local-repository/'
}
}
```

```groovy
dependencies {
implementation 'io.lumigo:java-tracer:1.0.49'
implementation 'io.lumigo:lumigo-agent:1.0.49'
}
```

Find the latest version here (the format of the version will be n.n.n):

## Wrapping your Lambda
Expand Down Expand Up @@ -70,6 +88,13 @@ Find the latest version here (the format of the version will be n.n.n):
}
}
```

## Lambda Auto tracing with lambda layer

* Add to your lambda a new layer with the arn from here
* Add environment variable `JAVA_TOOL_OPTIONS` and set it to `-javaagent:/opt/lumigo-java/lumigo-agent.jar` (This is instead of the flag for more than java11 support)
* Add the `LUMIGO_TRACER_TOKEN` env var.


### Configuration

Expand Down Expand Up @@ -99,7 +124,75 @@ class MyFunction implements RequestHandler<String, String> {
}
```

### Java 11 Support
### Support Java 11 and Above

Add the environment variable `JAVA_TOOL_OPTIONS` to your Lambda functions and set it to
`-Djdk.attach.allowAttachSelf=true` in addition to the manual code mentioned above.
`-Djdk.attach.allowAttachSelf=true` in addition to the manual code mentioned above (This is not needed for the auto trace with lambda layer).

### Supported Instrumentation Libraries

- Aws SDK V1
- Aws SDK V2
- Apache HTTP Client
- Apache Kafka

### Secret scrubbing

The tracer will automatically scrub values for keys in payload objects such as HTTP request / response body, Lambda events, return value etc. that match (case-sensitively) the following regex patterns at any depth:
- `.*pass.*`
- `.*key.*`
- `.*secret.*`
- `.*credential.*`
- `.*passphrase.*`
- `SessionToken`
- `x-amz-security-token`
- `Signature`
- `Authorization`

This behavior can be overridden by setting the `LUMIGO_SECRET_MASKING_REGEX` environment variable to a JSON array of regex patterns to match, e.g.: `[".+top.secret.+", ".+pazzword.+"]`.

#### Notes
1. providing a bad regex pattern (e.g., invalid JSON string) will result in an error and fallback to the default patterns.
2. Only values that are strings are redacted - objects, numbers etc. will stay intact even though their keys match the patterns.

#### Escaping special characters
When the patterns contain special characters such as double quotes (`"`) or backslashes (`\`), those should be escaped with a backslash (`\`).

For example, the pattern for keys with whitespaces and quotes like `"key\s+spaced"` becomes `\"key\\\\s+spaced\"`. That's because each double quotes turns into `\"`, and the `\s+` expression requires the backslash character to be escaped both in the string context (`\s+` => `\\s+`) and again in a JSON string context (`\\s+` => `\\\\s+`). When placed into the env-var as an array-item, this becomes:
```
["\\"key\\\\s+spaced\\""]
```

#### Examples

`LUMIGO_SECRET_MASKING_REGEX` set to `[".*top\\\\s+secret.*", ".*password.*"]` for a payload object like:
```json
{
"top secret": {
"password": "123456"
},
"top secret object": {
"this will not be scrubbed since the parent is an object": "123456"
},
"password": "123456",
"top secret:": "123456",
"not so secret": "value",
"ToP sEcReT": "is case sensitive"
}
```
will result in the following payload shown in the Lumigo platform:
```json
{
"top secret": {
"password": "****"
},
"top secret object": {
"this will not be scrubbed since the parent is an object": "123456"
},
"password": "****",
"top secret:": "****",
"not so secret": "value",
"ToP sEcReT": "is case sensitive"
}
```

15 changes: 6 additions & 9 deletions agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</properties>
<groupId>io.lumigo</groupId>
<artifactId>lumigo-agent</artifactId>
<version>1.0.39</version>
<version>1.0.49</version>

<name>Lumigo java tracer agent</name>
<description>The Lumigo java tracer for serverless functions</description>
Expand All @@ -22,7 +22,7 @@
<url>https://github.com/lumigo-io/java-tracer</url>
<connection>scm:git:https://github.com:lumigo-io/java-tracer.git</connection>
<developerConnection>scm:git:https://github.com:lumigo-io/java-tracer.git</developerConnection>
<tag>1.0.39</tag>
<tag>1.0.49</tag>
</scm>

<developers>
Expand All @@ -32,12 +32,6 @@
<organization>Lumigo</organization>
<organizationUrl>https://lumigo.io/</organizationUrl>
</developer>
<developer>
<name>Uri Parush</name>
<email>uri@lumigo.io</email>
<organization>Lumigo</organization>
<organizationUrl>https://lumigo.io</organizationUrl>
</developer>
</developers>

<organization>
Expand Down Expand Up @@ -104,9 +98,12 @@
<archive>
<manifestEntries>
<Agent-Class>io.lumigo.agent.Agent</Agent-Class>
<Can-Redefine-Classes>false</Can-Redefine-Classes>
<Main-Class>io.lumigo.agent.Agent</Main-Class>
<Premain-Class>io.lumigo.agent.Agent</Premain-Class>
<Can-Redefine-Classes>true</Can-Redefine-Classes>
<Can-Retransform-Classes>true</Can-Retransform-Classes>
<Can-Set-Native-Method-Prefix>false</Can-Set-Native-Method-Prefix>
<Implementation-Vendor>Lumigo</Implementation-Vendor>
</manifestEntries>
</archive>
</configuration>
Expand Down
Loading