Usage Example - vulcan-cyber/laprecon GitHub Wiki
___
/\_ \
\//\ \ __ _____ _ __ __ ___ ___ ___
\ \ \ /'__`\ /\ '__`\/\`'__\/'__`\ /'___\ / __`\ /' _ `\
\_\ \_/\ \L\.\_\ \ \L\ \ \ \//\ __//\ \__//\ \L\ \/\ \/\ \
/\____\ \__/.\_\\ \ ,__/\ \_\\ \____\ \____\ \____/\ \_\ \_\
\/____/\/__/\/_/ \ \ \/ \/_/ \/____/\/____/\/___/ \/_/\/_/
\ \_\
\/_/
Database initialization
If database was not yet initialized.
[?] Select module: DB
> DB
Registry
Repository
Analysis
Quit
[?] Select command: Init database
> Init database
Migrating ...
Done.
Repository module
In this example GitHub integration is used.
For this purpose we configure GitHub details in .env
file in advance
GITHUB_API_KEY=ghp_jfxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxAAe7
GITHUB_ORGANIZATION=vulcan-cyber
Enter Repository module
[?] Select module: Repository
DB
Registry
> Repository
Analysis
Quit
[?] Select repository platform: GitHub
> GitHub
GitLab
Fetch repositories
[?] Select command: Fetch repositories
> Fetch repositories
Fetch Dockerfiles
Fetch file-tree
MR manager
...
...
Pulling available repositories ...
Finished pulling code repositories .
Fetch file-tree
[?] Select command: Fetch file-tree
Fetch repositories
Fetch Dockerfiles
> Fetch file-tree
MR manager
...
...
Pulling code repositories file-trees ...
Processing DemoCodeApp ..
Processing DemoChat ..
Processing DemoAI ..
Finished fetching file-tree for code repositories .
Fetch Dockerfiles
** For GitHub - Dockerfiles fetching depends on prior file-tree fetching
[?] Select command: Fetch Dockerfiles
Fetch repositories
> Fetch Dockerfiles
Fetch file-tree
MR manager
...
...
[?] Select Dockerfiles detection method: via file-tree
via Search API
> via file-tree
Pulling dockerfiles ...
Processing DemoCodeApp ..
Processing DemoChat ..
found 2 files
Processing DemoAI ..
found 1 files
Finished fetching dockerfiles for code repositories .
MR Manager
[?] Select module: Repository
DB
Registry
> Repository
Analysis
Quit
[?] Select command: MR manager
Fetch repositories
Fetch Dockerfiles
Fetch file-tree
> MR manager
Opening MRs to label Dockerfiles
[?] Select operation: Open MRs
> Open MRs
Sync MRs
List MRs
Ensure dockerfiles and merge requests data is updated! Press Ctrl+C to go back menu
...
...
Starting ...
Processing DemoChat ..
Processing DemoAI ..
Finished merge requests creation process .
Let's list the MRs
[?] Select operation: List MRs
Open MRs
Sync MRs
> List MRs
Ensure merge requests are synced! Press Ctrl+C to go back menu
...
...
โโโโโโโโโโโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโโคโโโโโโโโโโโโคโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโ
โ Repository Name โ MR Number โ Status โ Created at โ Merged at โ Closed at โ
โโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโข
โ DemoChat โ 1 โ open โ 2024-04-18 11:36:16 โ - โ - โ
โ DemoAI โ 1 โ open โ 2024-04-18 11:36:18 โ - โ - โ
โโโโโโโโโโโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโโงโโโโโโโโโโโโงโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโ
After we merge the merge requests - we need to run MR sync
[?] Select operation: Sync MRs
Open MRs
> Sync MRs
List MRs
Starting ...
Processing MR 1 ..
Processing MR 1 ..
Finished merge requests sync process .
[?] Select operation: List MRs
Open MRs
Sync MRs
> List MRs
Ensure merge requests are synced! Press Ctrl+C to go back menu
...
...
โโโโโโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโคโโโโโโโโโโคโโโโโโโโโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโโโโโโโโโโ
โ Repository Name โ MR Number โ Status โ Created at โ Merged at โ Closed at โ
โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโข
โ DemoChat โ 1 โ closed โ 2024-04-18 11:36:16 โ 2024-04-18 11:48:42 โ 2024-04-18 11:48:42 โ
โ DemoAI โ 1 โ open โ 2024-04-18 11:36:18 โ - โ - โ
โโโโโโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโงโโโโโโโโโโงโโโโโโโโโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโโโโโโโโโโ
Registry module
In this example GAR integration is used.
For this purpose we configure GCP service account key file in .env
file in advance
GCP_KEY_PATH=./tmp/gcp_sa_key.json
Enter Registry module
[?] Select module: Registry
DB
> Registry
Repository
Analysis
Quit
[?] Select container registry platform: GAR (Google Artifact Registry)
ECR
> GAR (Google Artifact Registry)
[?] Region: asia
[?] Select authentication method: Service account key file
gcloud CLI (ADC)
> Service account key file
Fetch repositories
[?] Select command: Fetch repositories
> Fetch repositories
Fetch metadata
Fetch file-tree
...
...
Starting ...
Pull available repositories ...
Finished pulling repositories.
Fetch images metadata
[?] Select command: Fetch metadata
Fetch repositories
> Fetch metadata
Fetch file-tree
...
...
Pull repositories metadata ...
Processing vulcan-lab/test-repo/demo-ai-app ..
Processing vulcan-lab/test-repo/demo-chat-app ..
Processing vulcan-lab/test-repo/org-nginx-app ..
Finished pulling repositories metadata.
Fetch images file-tree
[?] Select command: Fetch file-tree
Fetch repositories
Fetch metadata
> Fetch file-tree
...
...
Starting ...
Pulling vulcan-lab/test-repo/demo-ai-app ..
Pulling vulcan-lab/test-repo/demo-chat-app ..
Pulling vulcan-lab/test-repo/org-nginx-app ..
Finished pulling images file-tree.
Analysis
[?] Select module: Analysis
DB
Registry
Repository
> Analysis
Quit
For example, let's run labels analysis.
Before, it is recommended to run code repositories Fetch Dockerfiles
and image registry Fetch metadata
[?] Select command: Labels
File-tree
> Labels
[?] Enter the label key prefix: demo_prefix
Starting ...
Labels analysis finished.