GitHub Actions or Integration Secret Created
Identifies the creation of a GitHub Actions, Dependabot, or Codespaces secret at the organization, repository, environment, or user scope. Secrets are injected into CI/CD workflows at runtime, so an actor with write or admin access can create a secret to establish durable access or to stage credentials that workflows will consume, allowing malicious automation to persist even after the initial access path is closed. This technique has been observed in software supply-chain attacks such as Shai-Hulud. Because creating secrets is also routine for platform and deployment teams, this rule works best as a building block correlated with the actor, the token used, and any surrounding workflow changes.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2026/09/22"
3integration = ["github"]
4maturity = "production"
5updated_date = "2026/09/22"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies the creation of a GitHub Actions, Dependabot, or Codespaces secret at the organization, repository,
11environment, or user scope. Secrets are injected into CI/CD workflows at runtime, so an actor with write or admin access
12can create a secret to establish durable access or to stage credentials that workflows will consume, allowing malicious
13automation to persist even after the initial access path is closed. This technique has been observed in software
14supply-chain attacks such as Shai-Hulud. Because creating secrets is also routine for platform and deployment teams, this
15rule works best as a building block correlated with the actor, the token used, and any surrounding workflow changes.
16"""
17false_positives = [
18 """
19 Onboarding a new deployment environment or rotating CI credentials. Confirm the secret name (`github.key`) and that
20 a change ticket exists.
21 """,
22]
23from = "now-9m"
24language = "esql"
25license = "Elastic License v2"
26name = "GitHub Actions or Integration Secret Created"
27note = """## Triage and analysis
28
29> **Disclaimer**:
30> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
31
32### Investigating GitHub Actions or Integration Secret Created
33
34GitHub records secret creation through `org.create_actions_secret`, `repo.create_actions_secret`, and `environment.create_actions_secret` for Actions secrets, and through `org.create_integration_secret`, `repo.create_integration_secret`, and `user.create_integration_secret` for Codespaces and Dependabot secrets. The audit log records the secret name but never its value. Secrets are made available to workflows at runtime, so a secret created by a compromised or unexpected actor can give malicious automation durable access to cloud or service credentials. Review the actor and token (`user.name`, `github.actor_ip`, `github.hashed_token`, `github.programmatic_access_type`), the scope and name of the secret (`event.action`, `github.org`, `github.repo`, `github.name`), and whether a workflow that consumes the secret was added or changed around the same time to determine whether the creation was legitimate.
35
36### Possible investigation steps
37
38- Identify the actor and the scope of the secret using `user.name`, `event.action`, `github.org`, `github.repo`, and the secret name in `github.name`, and confirm whether the actor normally manages CI secrets.
39- Review `github.actor_ip`, `github.hashed_token`, and `github.programmatic_access_type` to determine whether the secret was created interactively or with a PAT or OAuth token, and whether the source is expected for that actor.
40- Check whether a workflow file that references the new secret (via `secrets.<NAME>`) was added or modified in the same repository and time window, which can indicate the secret is being wired into attacker-controlled automation.
41- Review the actor's recent activity for related persistence actions, such as new PATs, SSH keys, OAuth grants, or outside-collaborator additions.
42- Correlate with any surrounding change ticket or rotation schedule to confirm whether the secret creation was planned.
43
44### False positive analysis
45
46- Scheduled credential rotation or first-time environment setup by platform engineering or deployment teams. Confirm the secret name (`github.name`) and that a change ticket exists before dismissing.
47- Automation that provisions secrets as part of onboarding a new service or repository. Validate against deployment records and scope exceptions to the specific actor or repository where appropriate.
48
49### Response and remediation
50
51- If the secret was not created by an authorized actor, delete it and rotate any cloud or service credentials it may have referenced.
52- Review the repository's workflow files for unexpected `secrets.` usage and remove any malicious or unauthorized workflows.
53- Revoke the token identified by `github.hashed_token` and the actor's other tokens if the creation was not approved, and require the user to reauthenticate.
54- Review the actor's recent audit activity for additional persistence mechanisms, such as new tokens, SSH keys, or collaborator and permission changes.
55- Engage incident response per your organization's playbooks if a supply-chain or account compromise is suspected.
56"""
57references = [
58 "https://www.wiz.io/blog/shai-hulud-2-0-ongoing-supply-chain-attack",
59 "https://www.elastic.co/blog/shai-hulud-worm-npm-supply-chain-compromise",
60 "https://github.com/SigmaHQ/sigma/blob/master/rules/application/github/audit/github_new_secret_created.yml",
61 "https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions",
62]
63risk_score = 21
64rule_id = "85567aa3-04ee-4010-8e27-f6b751c0efd1"
65severity = "low"
66tags = [
67 "Domain: Cloud",
68 "Domain: SaaS",
69 "Platform: GitHub",
70 "Use Case: Threat Detection",
71 "Tactic: Persistence",
72 "Tactic: Credential Access",
73 "Data Source: Github",
74 "Data Source: GitHub Audit Logs",
75 "Service: GitHub Actions",
76 "Rule Type: ES|QL",
77 "Resources: Investigation Guide",
78]
79timestamp_override = "event.ingested"
80type = "esql"
81
82query = '''
83from logs-github.audit-* metadata _id, _index, _version
84| where
85 data_stream.dataset == "github.audit"
86 and (github.actor_is_bot is not null and github.actor_is_bot == false)
87 and event.action in (
88 "org.create_actions_secret",
89 "repo.create_actions_secret",
90 "environment.create_actions_secret",
91 "org.create_integration_secret",
92 "repo.create_integration_secret",
93 "user.create_integration_secret"
94 )
95| keep
96 _id,
97 _index,
98 _version,
99 @timestamp,
100 event.action,
101 user.name,
102 github.org,
103 github.repo,
104 github.actor_ip,
105 github.hashed_token,
106 github.programmatic_access_type,
107 github.user_agent,
108 github.name,
109 github.actor_is_bot
110'''
111
112[rule.alert_suppression]
113group_by = ["github.repo", "user.name"]
114missing_fields_strategy = "suppress"
115
116[rule.alert_suppression.duration]
117unit = "m"
118value = 60
119
120
121[[rule.threat]]
122framework = "MITRE ATT&CK"
123[[rule.threat.technique]]
124id = "T1098"
125name = "Account Manipulation"
126reference = "https://attack.mitre.org/techniques/T1098/"
127[[rule.threat.technique.subtechnique]]
128id = "T1098.001"
129name = "Additional Cloud Credentials"
130reference = "https://attack.mitre.org/techniques/T1098/001/"
131
132
133
134[rule.threat.tactic]
135id = "TA0003"
136name = "Persistence"
137reference = "https://attack.mitre.org/tactics/TA0003/"
138[[rule.threat]]
139framework = "MITRE ATT&CK"
140[[rule.threat.technique]]
141id = "T1552"
142name = "Unsecured Credentials"
143reference = "https://attack.mitre.org/techniques/T1552/"
144
145
146[rule.threat.tactic]
147id = "TA0006"
148name = "Credential Access"
149reference = "https://attack.mitre.org/tactics/TA0006/"
150
151[rule.investigation_fields]
152field_names = [
153 "@timestamp",
154 "event.action",
155 "user.name",
156 "github.org",
157 "github.repo",
158 "github.actor_ip",
159 "github.hashed_token",
160 "github.programmatic_access_type",
161 "github.user_agent",
162 "github.name",
163 "github.actor_is_bot",
164]
Triage and analysis
Disclaimer: This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
Investigating GitHub Actions or Integration Secret Created
GitHub records secret creation through org.create_actions_secret, repo.create_actions_secret, and environment.create_actions_secret for Actions secrets, and through org.create_integration_secret, repo.create_integration_secret, and user.create_integration_secret for Codespaces and Dependabot secrets. The audit log records the secret name but never its value. Secrets are made available to workflows at runtime, so a secret created by a compromised or unexpected actor can give malicious automation durable access to cloud or service credentials. Review the actor and token (user.name, github.actor_ip, github.hashed_token, github.programmatic_access_type), the scope and name of the secret (event.action, github.org, github.repo, github.name), and whether a workflow that consumes the secret was added or changed around the same time to determine whether the creation was legitimate.
Possible investigation steps
- Identify the actor and the scope of the secret using
user.name,event.action,github.org,github.repo, and the secret name ingithub.name, and confirm whether the actor normally manages CI secrets. - Review
github.actor_ip,github.hashed_token, andgithub.programmatic_access_typeto determine whether the secret was created interactively or with a PAT or OAuth token, and whether the source is expected for that actor. - Check whether a workflow file that references the new secret (via
secrets.<NAME>) was added or modified in the same repository and time window, which can indicate the secret is being wired into attacker-controlled automation. - Review the actor's recent activity for related persistence actions, such as new PATs, SSH keys, OAuth grants, or outside-collaborator additions.
- Correlate with any surrounding change ticket or rotation schedule to confirm whether the secret creation was planned.
False positive analysis
- Scheduled credential rotation or first-time environment setup by platform engineering or deployment teams. Confirm the secret name (
github.name) and that a change ticket exists before dismissing. - Automation that provisions secrets as part of onboarding a new service or repository. Validate against deployment records and scope exceptions to the specific actor or repository where appropriate.
Response and remediation
- If the secret was not created by an authorized actor, delete it and rotate any cloud or service credentials it may have referenced.
- Review the repository's workflow files for unexpected
secrets.usage and remove any malicious or unauthorized workflows. - Revoke the token identified by
github.hashed_tokenand the actor's other tokens if the creation was not approved, and require the user to reauthenticate. - Review the actor's recent audit activity for additional persistence mechanisms, such as new tokens, SSH keys, or collaborator and permission changes.
- Engage incident response per your organization's playbooks if a supply-chain or account compromise is suspected.
References
Related rules
- GitHub SAML SSO Disabled
- GitHub OAuth Application Authorized
- GitHub Actions Workflow Modification Blocked
- GitHub Activity from Credential Scanner User Agent
- GitHub SSH or Deploy Key Added