Skip to content

Fix #738: add an SNMP source Kamelet - #2990

Merged
oscerd merged 2 commits into
apache:mainfrom
oscerd:ci-issue-738
Sep 1, 2026
Merged

Fix #738: add an SNMP source Kamelet#2990
oscerd merged 2 commits into
apache:mainfrom
oscerd:ci-issue-738

Conversation

@oscerd

@oscerd oscerd commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #738.

The issue asks for "a camel-snmp kamelet" without saying which shape. The component's own description — "Receive traps and poll SNMP capable devices" — is consumer shaped, and polling/trap-listening is what SNMP is overwhelmingly used for in an integration, so this adds a source. A producer Kamelet for GET/SET could follow if there is demand; happy to take that as a follow-up rather than guess at it now.

from:
  uri: "snmp:{{host}}:{{port}}"
  parameters:
    type: "{{type}}"
    oids: "{{?oids}}"
    protocol: "{{protocol}}"
    delay: "{{delay}}"
    snmpVersion: "{{snmpVersion}}"
    snmpCommunity: "{{snmpCommunity}}"
    treeList: "{{treeList}}"
    securityName: "{{?securityName}}"
    securityLevel: "{{securityLevel}}"
    authenticationProtocol: "{{?authenticationProtocol}}"
    authenticationPassphrase: "{{?authenticationPassphrase}}"
    privacyProtocol: "{{?privacyProtocol}}"
    privacyPassphrase: "{{?privacyPassphrase}}"
  steps:
  - to: "kamelet:sink"

Properties

Only host is required. type selects the mode; oids lists what to query.

property default notes
host required
port 161 161 for polling, 162 for trap listening
type POLL enum: POLL / GET_NEXT / TRAP
oids comma separated; needed for POLL and GET_NEXT, unused for TRAP
protocol udp enum: udp / tcp
delay 60000 poll interval; unused for TRAP
snmpVersion 0 0=v1, 1=v2c, 3=v3
snmpCommunity public credentials descriptor — see below
treeList false GET_NEXT only
securityName v3, credentials descriptor
securityLevel 3 v3: 1=noAuthNoPriv, 2=authNoPriv, 3=authPriv
authenticationProtocol enum: MD5 / SHA1
authenticationPassphrase format: password + credentials
privacyProtocol e.g. DES, AES128
privacyPassphrase format: password + credentials

On the community string

snmpCommunity keeps the component default of public. I want to be explicit about that choice rather than let it pass unnoticed, given the catalog's secure-by-default direction.

SNMP v1 and v2c send the community string in clear text on the wire. Changing the Kamelet default from public to something else would not make it secret — it would just make the Kamelet fail against devices left on the default, while still transmitting the value unencrypted. The real mitigation is v3 with authPriv, so the Kamelet:

  • marks snmpCommunity with the credentials descriptor so tooling groups it with secrets,
  • says in the property description that it is a clear-text shared secret,
  • and points at snmpVersion: 3 in the Kamelet description itself.

securityLevel defaults to 3 (authPriv), the strongest of the three, so an operator who moves to v3 gets authentication and privacy unless they deliberately weaken it.

Happy to be overruled if reviewers would rather have no default community at all.

Verification

script/validator reports no errors, script/generator adds the nav.adoc entry, mvn clean install passes from the repository root.

Parameter binding checked against the real component with camel run rather than by eye — unlike a network-dependent sink this one starts cleanly with no device present:

Routes startup (total:1 started:1 kamelets:1)
    Started snmp-probe (kamelet:snmp-source)
Apache Camel 4.21.0-SNAPSHOT (snmp-probe) started in 175ms

All thirteen parameters bound with no unknown option error; the consumer then polls a device that is not there, which is the expected quiet outcome.

No Citrus test — exercising this needs a real SNMP agent and the project's Citrus/Testcontainers toolchain has none, so it is marked Preview and does not carry kamelet.verified=true.

The icon is a plain SVG glyph authored for this Kamelet, consistent with how other protocol-based Kamelets (ssh-sink, ftp-sink) use generic glyphs rather than a vendor logo.


Claude Code on behalf of Andrea Cosentino

Polls SNMP capable devices or receives SNMP traps via camel-snmp, whose
own description -- "Receive traps and poll SNMP capable devices" -- is
consumer shaped, so a source is the natural first Kamelet for it. A
producer Kamelet for GET/SET could follow if there is demand.

The type property selects POLL, GET_NEXT or TRAP; oids lists what to
query on the first two. SNMP v3 security is exposed in full (securityName,
securityLevel, authentication and privacy protocol/passphrase); both
passphrases are format: password and carry the credentials descriptor.

snmpCommunity keeps the component default of "public" but is marked with
the credentials descriptor and its description says plainly that v1/v2c
send it in clear text, with a pointer to v3 in the Kamelet description.
Making the community a non-default would not add security -- it is sent
unencrypted either way -- so the honest move is to label it rather than
pretend otherwise.

Marked Preview, no Citrus test: exercising this needs an SNMP agent and
there is none in the project's test toolchain.

Verified against the real camel-snmp component with `camel run`: the route
starts clean -- "Routes startup (total:1 started:1 kamelets:1)" -- with all
thirteen parameters bound, rather than failing on an unknown option.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@oscerd
oscerd merged commit d28ea86 into apache:main Sep 1, 2026
6 checks passed
oscerd added a commit to oscerd/camel-kamelets-validator that referenced this pull request Sep 1, 2026
KameletsCatalogTest.testGetKameletsByNamespace asserts an exact count for
the AWS namespace, so adding aws-bedrock-agent-sink takes it from 31 to
32 and the catalog module's tests fail.

Verified against the tree rather than just following the CI delta: 31
kamelets carry kamelet.namespace "AWS" on main, 32 with this branch.

Only the AWS namespace is count-asserted, which is why the SMPP and SNMP
Kamelets added in apache#2988, apache#2989 and apache#2990 did not trip it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
oscerd added a commit that referenced this pull request Sep 3, 2026
* Fix #1938: add an AWS Bedrock Agent sink Kamelet

The catalog already covers aws-bedrock (aws-bedrock-text-sink) and
aws-bedrock-agent-runtime (aws-bedrock-agent-runtime-sink). The
aws-bedrock-agent component had no Kamelet, which is the gap this closes:
managing the data source ingestion jobs of a knowledge base via
startIngestionJob, listIngestionJobs and getIngestionJob.

BedrockAgentProducer.determineOperation reads CamelAwsBedrockAgentOperation
from the message before falling back to the endpoint, and knowledgeBaseId
and dataSourceId are header-overridable the same way. A sink that pins
those three as properties therefore has to strip the family, or an inbound
header could redirect the call to a different knowledge base or a different
operation. Same shape as the aws-ec2-sink strip.

CamelAwsBedrockAgentIngestionJobId is excluded from the strip: it is the
one input the Kamelet deliberately takes from the message, since
getIngestionJob has to name a job.

Marked Preview, no Citrus test: exercising this needs a real Bedrock
knowledge base and there is no emulator for it in the project's toolchain.

Verified with `camel run` against the real component -- the route starts
with every parameter bound -- and the strip verified with the terminal
endpoint swapped for a log:

  in:  Operation=listIngestionJobs, KnowledgeBaseId=attacker-kb,
       DataSourceId=attacker-ds, IngestionJobId=job-42, keepMe=yes
  out: CamelAwsBedrockAgentIngestionJobId=job-42, keepMe=yes

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Fix #1938: update the AWS namespace count in KameletsCatalogTest

KameletsCatalogTest.testGetKameletsByNamespace asserts an exact count for
the AWS namespace, so adding aws-bedrock-agent-sink takes it from 31 to
32 and the catalog module's tests fail.

Verified against the tree rather than just following the CI delta: 31
kamelets carry kamelet.namespace "AWS" on main, 32 with this branch.

Only the AWS namespace is count-asserted, which is why the SMPP and SNMP
Kamelets added in #2988, #2989 and #2990 did not trip it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a camel-snmp kamelet

1 participant