Claus Ibsen created CAMEL-27629:
-----------------------------------

             Summary: camel-aws-security-hub: describeHub takes no hub ARN, 
header labels, required operation
                 Key: CAMEL-27629
                 URL: https://issues.apache.org/jira/browse/CAMEL-27629
             Project: Camel
          Issue Type: Bug
          Components: camel-aws2
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Found while improving the option descriptions of camel-aws-security-hub for 
CAMEL-23832 (PR https://github.com/apache/camel/pull/30966).
These are separate problems of the component; the descriptions PR only 
documents the current behavior.

h4. 1. describeHub cannot select a hub without pojoRequest
{{SecurityHubProducer.describeHub()}} sends an empty {{DescribeHubRequest}} and 
reads no header. So the producer always describes the hub of the account in the 
region of the client. A user who wants the hub of a given ARN has to set 
{{pojoRequest=true}} and build the request object.
Proposed change: add a header such as {{CamelAwsSecurityHubHubArn}} that sets 
{{DescribeHubRequest.hubArn()}} when present.

h4. 2. The operation option is required but has a default
{{SecurityHubConfiguration.operation}} has {{@Metadata(required = true, 
defaultValue = "batchImportFindings")}}. The producer falls back to 
{{batchImportFindings}} when the option is not set, so the option is not 
required. The catalog and the tooling still show it as required.
Proposed change: remove {{required = true}}.

h4. 3. CamelAwsSecurityHubMaxResults has an incomplete label
{{SecurityHubConstants.MAX_RESULTS}} has the label {{getFindings}}. But 
{{SecurityHubProducer.getFindingHistory()}} and 
{{SecurityHubProducer.listEnabledProductsForImport()}} read it too. A header 
list filtered by operation hides it for those two operations.
Proposed change: use the label {{getFindings listEnabledProductsForImport 
getFindingHistory}}, as {{NEXT_TOKEN}} does.

h4. 4. 13 headers have no label
In {{SecurityHubConstants}}, the headers {{OPERATION}}, {{FINDINGS}}, 
{{FINDING_IDENTIFIERS}}, {{FILTERS}}, {{NOTE}}, {{SEVERITY}}, {{WORKFLOW}}, 
{{VERIFICATION_STATE}}, {{CONFIDENCE}}, {{CRITICALITY}}, 
{{USER_DEFINED_FIELDS}}, {{RELATED_FINDINGS}} and {{TYPES}} have no label. The 
other headers name the operation that uses them. {{FINDINGS}} is read by 
{{batchImportFindings}}, {{FILTERS}} by {{getFindings}}, the other ten by 
{{batchUpdateFindings}}, and {{OPERATION}} by every operation.
Proposed change: add the label of the operation to each of these headers (for 
{{OPERATION}}, all operations or {{producer}}).

h4. 5. Wrong Javadoc of SecurityHubOperations.getFindingAggregator
The Javadoc of the enum value {{SecurityHubOperations.getFindingAggregator}} 
says "Get aggregated findings count". The operation calls 
{{GetFindingAggregator}}, which returns the configuration of a finding 
aggregator: the aggregation region and the linked regions. It does not return a 
count.
Proposed change: change the Javadoc to "Get the configuration of a finding 
aggregator".

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to