Skip to content

Instantly share code, notes, and snippets.

@wheel5up
Created October 19, 2023 16:48
Show Gist options
  • Save wheel5up/a09962db6c57121171e8b8d692a5759f to your computer and use it in GitHub Desktop.
Save wheel5up/a09962db6c57121171e8b8d692a5759f to your computer and use it in GitHub Desktop.
AWS Securityhub to Jira flow
@startuml
state seachForJiraIssue:Search for Jira issue \nby AWS finding ID
state createOrUpdateJiraIssue <<choice>>
state SetJiraKeyFromSearch: Use the search response\nto set the Jira issue key
state createJiraIssue:Create Jira issue from finding
state SetJiraKeyFromCreate: Use the create response\nto set the Jira issue key
state moreThanOneJiraIssue: Fail State\nfinding ID's should be unique
state transitionJiraIssue: Reopen issue before update
state updateJiraIssue: Update Jira Issue
state closeJiraIssueCNR: Close Jira Issue\nCannot Reproduce
state closeJiraIssueDONE: Close Jira Issue\nResolved
state UnknownComplianceStatus: Fail State
state noMoreUpdates: Pass state
state transitionOrUpdateJiraIssue <<choice>>
state closeJiraIssueChoice <<choice>>
state closeJiraIssueReason <<choice>>
note right of createOrUpdateJiraIssue:Check the number of issues\nreturned in the query
note right of transitionOrUpdateJiraIssue:If closed\nreopen
note right of closeJiraIssueChoice:If AWS Record state\n = ARCHIVED;\nclose issue
[*] --> seachForJiraIssue
seachForJiraIssue -[#green,thickness=3]-> createOrUpdateJiraIssue
createOrUpdateJiraIssue -[#green,thickness=3]-> SetJiraKeyFromSearch: One issue found
createOrUpdateJiraIssue -[#green,thickness=3]-> createJiraIssue: No issue Found
createOrUpdateJiraIssue -[#red,thickness=3]-> moreThanOneJiraIssue: Multiple Issues
SetJiraKeyFromSearch -[#green,thickness=3]-> transitionOrUpdateJiraIssue
createJiraIssue -[#green,thickness=3]-> SetJiraKeyFromCreate: Get Jira Key
transitionOrUpdateJiraIssue -[#green,thickness=3]-> transitionJiraIssue: Reopen
transitionOrUpdateJiraIssue -[#green,thickness=3]-> updateJiraIssue: Update
transitionJiraIssue -[#green,thickness=3]-> updateJiraIssue: Update
updateJiraIssue -[#green,thickness=3]-> closeJiraIssueChoice : Check AWS Compliance Status
SetJiraKeyFromCreate -[#green,thickness=3]> closeJiraIssueChoice: Close issue?
closeJiraIssueChoice -[#green,thickness=3]-> closeJiraIssueReason : Close
closeJiraIssueChoice -[#green,thickness=3]-> noMoreUpdates: Noop
closeJiraIssueReason -[#green,thickness=3]-> closeJiraIssueCNR: Cannot Reproduce
closeJiraIssueReason -[#green,thickness=3]-> closeJiraIssueDONE: Resolved
closeJiraIssueReason -[#red,thickness=3]-> UnknownComplianceStatus: unknown compliance status
moreThanOneJiraIssue -[#green,thickness=3]-> [*] : End
noMoreUpdates -[#green,thickness=3]-> [*] : End
closeJiraIssueDONE -[#green,thickness=3]-> [*] : End
closeJiraIssueCNR -[#green,thickness=3]-> [*] : End
UnknownComplianceStatus -[#green,thickness=3]-> [*] : End
@enduml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment