Skip to content

Sync OWASP Slack Workspace Channels/Groups List #923

@arkid15r

Description

@arkid15r

Overview:
Develop a Django management command for OWASP NestBot that syncs Slack channels and groups from the OWASP Slack workspace. The command will fetch data from Slack’s API and populate the Conversation model in the slack app.

Functionality:

  1. Retrieve Slack channels and groups: Use Slack’s conversations.list API to fetch a list of channels and groups.
  2. Implement pagination: Since Slack API responses are paginated, ensure the command retrieves all channels with a limit of 200 per request.
  3. Store or update channel records: Populate or update the Conversation model with information about each channel.
  4. Error handling and logging: Ensure the command handles potential errors (e.g., API issues) and logs the actions for visibility.

Expected Data Fields:
Each Slack channel object contains the following fields:

  • id → Stored as entity_id
  • created → Stored as created_at
  • name → Channel name
  • is_private → Boolean indicating if the channel is private
  • is_archived → Boolean indicating if the channel is archived
  • is_general → Boolean indicating if it’s the general channel
  • topic.value → The topic of the channel
  • purpose.value → The purpose of the channel
  • creator → Stored as creator_id, the ID of the user who created the channel

Considerations:

  • The command should be idempotent, meaning it should update existing records and avoid duplicating data.

Command Execution:
Run the command using the following:

python manage.py slack_sync_conversation_list

This task will ensure that all Slack channels and groups from the OWASP workspace are correctly synced into the Conversation model, keeping the records up-to-date with the latest information from Slack.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions