Skip to content

GitHub Token Revocation API Support#43699

Merged
barryyosi-panw merged 13 commits intodemisto:contrib/bowenaguero_masterfrom
bowenaguero:master
Apr 12, 2026
Merged

GitHub Token Revocation API Support#43699
barryyosi-panw merged 13 commits intodemisto:contrib/bowenaguero_masterfrom
bowenaguero:master

Conversation

@bowenaguero
Copy link
Copy Markdown
Contributor

@bowenaguero bowenaguero commented Mar 27, 2026

Adds support to the GitHub marketplace integration for the token revocation REST API endpoint. This is a newly introduced feature from GitHub.

Introduces a command that, when invoked with one or more valid GH access tokens as a provided argument, submits a revocation request to GitHub for the tokens.

Useful for IR scenarios where internal tokens have been leaked or exposed to the public and need immediate remediation.

Feature Release:
https://github.blog/changelog/2026-03-26-credential-revocation-api-now-supports-github-oauth-and-github-app-credentials/

Background:
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/token-expiration-and-revocation#token-revoked-by-a-third-party

API Docs:
https://docs.github.com/en/rest/credentials/revoke?apiVersion=2026-03-10

relates: https://jira-dc.paloaltonetworks.com/browse/CIAC-16393

Copilot AI review requested due to automatic review settings March 27, 2026 15:19
@content-bot content-bot added Contribution Thank you! Contributions are always welcome! External PR Xsoar Support Level Indicates that the contribution is for XSOAR supported pack labels Mar 27, 2026
@content-bot content-bot changed the base branch from master to contrib/bowenaguero_master March 27, 2026 15:20
@content-bot content-bot requested a review from kamalq97 March 27, 2026 15:21
@content-bot
Copy link
Copy Markdown
Contributor

Thank you for your contribution. Your generosity and caring are unrivaled! Make sure to register your contribution by filling the Contribution Registration form, so our content wizard @kamalq97 will know the proposed changes are ready to be reviewed.
For your convenience, here is a link to the contributions SLAs document.

@content-bot
Copy link
Copy Markdown
Contributor

Hi @bowenaguero, thanks for contributing to the XSOAR marketplace. To receive credit for your generous contribution please follow this link.

@content-bot
Copy link
Copy Markdown
Contributor

🤖 AI-Powered Code Review Available

Hi @kamalq97, you can leverage AI-powered code review to assist with this PR!

Available Commands:

  • @marketplace-ai-reviewer start review - Initiate a full AI code review
  • @marketplace-ai-reviewer re-review - Incremental review for new commits

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support in the GitHub pack integration for GitHub’s credential (token) revocation REST endpoint, exposing it as a new XSOAR command intended for incident response use.

Changes:

  • Added github-revoke-credentials command implementation and command routing in the GitHub integration.
  • Added YAML command definitions (including legacy/deprecated alias) and unit tests for the new command.
  • Bumped pack version and added release notes for the new feature.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Packs/GitHub/pack_metadata.json Version bump to release the new feature.
Packs/GitHub/ReleaseNotes/2_3_0.md Release note entry describing the new revoke-credentials command.
Packs/GitHub/Integrations/GitHub/GitHub_test.py Added unit tests covering success and validation/error paths for token revocation.
Packs/GitHub/Integrations/GitHub/GitHub.yml Added new command definitions (canonical + deprecated alias) and various argument formatting adjustments.
Packs/GitHub/Integrations/GitHub/GitHub.py Implemented github_revoke_credentials_command and registered it in the commands map.
Comments suppressed due to low confidence (1)

Packs/GitHub/Integrations/GitHub/GitHub.yml:7268

  • In github-list-workflows, both workflow and limit are marked as isArray: true, but the code expects workflow to be a single workflow filename and casts limit to int. If these are provided as lists (as the YAML schema implies), the command will fail (e.g., int(list) TypeError) or generate invalid URLs. Adjust the argument schemas to match the implementation (non-array scalar values).
    - description: The name of your workflow file.
      name: workflow
      isArray: true
      required: true
    - description: The number of workflows to return. Default is 100.
      isArray: true
      name: limit

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Packs/GitHub/ReleaseNotes/2_3_0.md Outdated
Comment thread Packs/GitHub/Integrations/GitHub/GitHub.py Outdated
Comment on lines 7261 to 7267
isArray: true
- description: The name of your workflow file.
name: workflow
isArray: true
required: true
- description: The number of workflows to return. Default is 100.
isArray: true
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In github-list-workflows, the repository argument is marked as isArray: true, but the implementation treats it as a single string when constructing the URL. This can cause invalid URLs if a list is passed. Update the YAML argument definition to not be an array (consistent with other workflow commands).

Suggested change
isArray: true
- description: The name of your workflow file.
name: workflow
isArray: true
required: true
- description: The number of workflows to return. Default is 100.
isArray: true
- description: The name of your workflow file.
name: workflow
required: true
- description: The number of workflows to return. Default is 100.

Copilot uses AI. Check for mistakes.
bowenaguero and others added 5 commits March 27, 2026 11:31
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@content-bot content-bot added Community Contribution Form Filled Whether contribution form filled or not. labels Mar 27, 2026
@kamalq97 kamalq97 assigned barryyosi-panw and unassigned kamalq97 Mar 29, 2026
@kamalq97 kamalq97 requested review from barryyosi-panw and removed request for kamalq97 March 29, 2026 10:43
@barryyosi-panw barryyosi-panw added the ready-for-ai-review The PR is ready for reviewing the PR with the AI Reviewer. label Apr 6, 2026
@marketplace-ai-reviewer marketplace-ai-reviewer removed the ready-for-ai-review The PR is ready for reviewing the PR with the AI Reviewer. label Apr 6, 2026
@marketplace-ai-reviewer
Copy link
Copy Markdown
Contributor

🤖 Analysis started. Please wait for results...

@marketplace-ai-reviewer
Copy link
Copy Markdown
Contributor

🤖 AI Review Disclaimer

This review was generated by an AI-powered tool and may contain inaccuracies. Please be advised, and we extend our sincere apologies for any inconvenience this may cause.

Copy link
Copy Markdown
Contributor

@marketplace-ai-reviewer marketplace-ai-reviewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution to the GitHub pack! I've reviewed your changes and found a few minor issues to address. Please check the integration code for a potential AttributeError on successful API responses and ensure the ghs_ prefix is used for server-to-server tokens. Finally, make sure to add 'GitHub' to the keywords list in the pack metadata. Let me know if you have any questions!

Additionally, please address the following file-level notes:

  • Packs/GitHub/pack_metadata.json: The vendor name 'GitHub' must be included in the keywords list.

@barryyosi-panw, @copilot-pull-request-reviewer[bot] please review and approve the results generated by the AI Reviewer by responding 👍 on this comment.

Comment thread Packs/GitHub/Integrations/GitHub/GitHub.py
Comment thread Packs/GitHub/Integrations/GitHub/GitHub.py
Comment thread Packs/GitHub/Integrations/GitHub/GitHub.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid unnecessary, cosmetic changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is addressed in my most recent commit

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 6, 2026

CLA assistant check
All committers have signed the CLA.

@barryyosi-panw barryyosi-panw added the ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. label Apr 8, 2026
@barryyosi-panw
Copy link
Copy Markdown
Contributor

Looks good to me!
Lets just wait for docs review to be completed.

@content-bot
Copy link
Copy Markdown
Contributor

For the Reviewer: Trigger build request has been accepted for this contribution PR.

@content-bot
Copy link
Copy Markdown
Contributor

For the Reviewer: Successfully created a pipeline in GitLab with url: https://gitlab.xdr.pan.local/xdr/cortex-content/content/-/pipelines/8137787

@content-bot content-bot removed the ready-for-instance-test In contribution PRs, this label will cause a trigger of a build with a modified pack from the PR. label Apr 8, 2026
@content-bot
Copy link
Copy Markdown
Contributor

Validate summary
The following errors were thrown as a part of this pr: RM110.
The following errors can be ignored: RM110.
If the AG100 validation in the pre-commit GitHub Action fails, the pull request cannot be force-merged.

Verdict: PR can be force merged from validate perspective? ❌

Comment thread Packs/GitHub/Integrations/GitHub/GitHub.yml Outdated
Comment thread Packs/GitHub/ReleaseNotes/2_2_6.md Outdated
bowenaguero and others added 2 commits April 9, 2026 11:26
Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>
Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>
@barryyosi-panw barryyosi-panw merged commit 90c9918 into demisto:contrib/bowenaguero_master Apr 12, 2026
18 checks passed
@github-actions
Copy link
Copy Markdown

Thank you for your contribution. Your external PR has been merged and the changes are now included in an internal PR for further review. The internal PR will be merged to the master branch within 3 business days.

barryyosi-panw added a commit that referenced this pull request Apr 13, 2026
* GitHub Token Revocation API Support (#43699)

* feat: Add github-revoke-credentials command for token revocation

* update release notes and pack_metadata

* Update release notes and formatting

* Update Packs/GitHub/Integrations/GitHub/GitHub.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Packs/GitHub/ReleaseNotes/2_3_0.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Changed version bump from minor to revision

* Fix broken test

* run pre-commit

* Removed the unecessary deprecated command and made credentials a "secret"

* Remove unnecessary cosmetic changes

* Update Packs/GitHub/Integrations/GitHub/GitHub.yml

Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>

* Update Packs/GitHub/ReleaseNotes/2_2_6.md

Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>

* Bump pack from version GitHub to 2.2.7.

* Update README.md: Add GitHub credential revocation API endpoint and revoke �[K
credentials command details

---------

Co-authored-by: Bowen Aguero <127001006+bowenaguero@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>
Co-authored-by: Content Bot <bot@demisto.com>
Co-authored-by: barryyosi-panw <byosilevich@paloaltonetworks.com>
barryyosi-panw added a commit that referenced this pull request Apr 14, 2026
* GitHub Token Revocation API Support (#43699)

* feat: Add github-revoke-credentials command for token revocation

* update release notes and pack_metadata

* Update release notes and formatting

* Update Packs/GitHub/Integrations/GitHub/GitHub.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Packs/GitHub/ReleaseNotes/2_3_0.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Changed version bump from minor to revision

* Fix broken test

* run pre-commit

* Removed the unecessary deprecated command and made credentials a "secret"

* Remove unnecessary cosmetic changes

* Update Packs/GitHub/Integrations/GitHub/GitHub.yml

Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>

* Update Packs/GitHub/ReleaseNotes/2_2_6.md

Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>

* Bump pack from version GitHub to 2.2.7.

* Update README.md: Add GitHub credential revocation API endpoint and revoke �[K
credentials command details

---------

Co-authored-by: Bowen Aguero <127001006+bowenaguero@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>
Co-authored-by: Content Bot <bot@demisto.com>
Co-authored-by: barryyosi-panw <byosilevich@paloaltonetworks.com>
mcvic1rj pushed a commit to mcvic1rj/xsoar-content that referenced this pull request Apr 16, 2026
* GitHub Token Revocation API Support (demisto#43699)

* feat: Add github-revoke-credentials command for token revocation

* update release notes and pack_metadata

* Update release notes and formatting

* Update Packs/GitHub/Integrations/GitHub/GitHub.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update Packs/GitHub/ReleaseNotes/2_3_0.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Changed version bump from minor to revision

* Fix broken test

* run pre-commit

* Removed the unecessary deprecated command and made credentials a "secret"

* Remove unnecessary cosmetic changes

* Update Packs/GitHub/Integrations/GitHub/GitHub.yml

Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>

* Update Packs/GitHub/ReleaseNotes/2_2_6.md

Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>

* Bump pack from version GitHub to 2.2.7.

* Update README.md: Add GitHub credential revocation API endpoint and revoke �[K
credentials command details

---------

Co-authored-by: Bowen Aguero <127001006+bowenaguero@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Richard Bluestone <53567272+richardbluestone@users.noreply.github.com>
Co-authored-by: Content Bot <bot@demisto.com>
Co-authored-by: barryyosi-panw <byosilevich@paloaltonetworks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community Contribution Form Filled Whether contribution form filled or not. Contribution Thank you! Contributions are always welcome! docs-approved External PR Xsoar Support Level Indicates that the contribution is for XSOAR supported pack

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants