From 10de2d0540b0fb988cfb49119a54f92236d4d4bb Mon Sep 17 00:00:00 2001 From: Carlos Polop Date: Fri, 13 Feb 2026 18:06:22 +0100 Subject: [PATCH] test: enable chack workflows, add subuid check, and inject linpeas build failure --- .github/workflows/chack-agent-pr-triage.yml | 22 ++++++++---- .../ci-master-failure-chack-agent-pr.yml | 17 ++++++--- .../pr-failure-chack-agent-dispatch.yml | 20 +++++++---- .../16_Subuid_subgid_mappings.sh | 35 +++++++++++++++++++ linPEAS/builder/src/linpeasBuilder.py | 2 +- 5 files changed, 79 insertions(+), 17 deletions(-) create mode 100644 linPEAS/builder/linpeas_parts/6_users_information/16_Subuid_subgid_mappings.sh diff --git a/.github/workflows/chack-agent-pr-triage.yml b/.github/workflows/chack-agent-pr-triage.yml index ad60f40..4f4c332 100644 --- a/.github/workflows/chack-agent-pr-triage.yml +++ b/.github/workflows/chack-agent-pr-triage.yml @@ -7,8 +7,7 @@ on: jobs: chack_agent_triage: - # Temporarily disabled by maintainer request. - if: ${{ false && github.event.workflow_run.conclusion == 'success' }} + if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest permissions: contents: write @@ -83,12 +82,24 @@ jobs: ${{ steps.gate.outputs.base_ref }} \ +refs/pull/${{ steps.gate.outputs.pr_number }}/head + - name: Set up Node.js for Codex + if: ${{ steps.gate.outputs.should_run == 'true' }} + uses: actions/setup-node@v5 + with: + node-version: "20" + + - name: Install Codex CLI + if: ${{ steps.gate.outputs.should_run == 'true' }} + run: | + npm install -g @openai/codex + codex --version + - name: Run Chack Agent id: run_chack if: ${{ steps.gate.outputs.should_run == 'true' }} uses: carlospolop/chack-agent@master with: - provider: openrouter + provider: codex model_primary: CHEAP_BUT_QUALITY main_action: peass-ng sub_action: Chack-Agent PR Triage @@ -123,7 +134,7 @@ jobs: Output JSON only, following the provided schema: .github/chack-agent/pr-merge-schema.json - openrouter_api_key: ${{ secrets.OPENROUTER_API_KEY }} + openai_api_key: ${{ secrets.OPENAI_API_KEY }} - name: Parse Chack Agent decision id: parse @@ -157,8 +168,7 @@ jobs: merge_or_comment: runs-on: ubuntu-latest needs: chack_agent_triage - # Temporarily disabled by maintainer request. - if: ${{ false && github.event.workflow_run.conclusion == 'success' && needs.chack_agent_triage.outputs.should_run == 'true' && needs.chack_agent_triage.outputs.decision != '' }} + if: ${{ github.event.workflow_run.conclusion == 'success' && needs.chack_agent_triage.outputs.should_run == 'true' && needs.chack_agent_triage.outputs.decision != '' }} permissions: contents: write pull-requests: write diff --git a/.github/workflows/ci-master-failure-chack-agent-pr.yml b/.github/workflows/ci-master-failure-chack-agent-pr.yml index 4b63b4a..9cb566e 100644 --- a/.github/workflows/ci-master-failure-chack-agent-pr.yml +++ b/.github/workflows/ci-master-failure-chack-agent-pr.yml @@ -7,9 +7,8 @@ on: jobs: chack_agent_fix_master_failure: - # Temporarily disabled by maintainer request. if: > - ${{ false && github.event.workflow_run.conclusion == 'failure' && + ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.head_branch == 'master' && !startsWith(github.event.workflow_run.head_commit.message, 'Fix CI-master failures for run #') }} runs-on: ubuntu-latest @@ -98,11 +97,21 @@ jobs: echo "Leave the repo in a state ready to commit; changes will be committed and pushed automatically." } > chack_prompt.txt + - name: Set up Node.js for Codex + uses: actions/setup-node@v5 + with: + node-version: "20" + + - name: Install Codex CLI + run: | + npm install -g @openai/codex + codex --version + - name: Run Chack Agent id: run_chack uses: carlospolop/chack-agent@master with: - provider: openrouter + provider: codex model_primary: CHEAP_BUT_QUALITY main_action: peass-ng sub_action: CI-master Failure Chack-Agent PR @@ -113,7 +122,7 @@ jobs: tools_config_json: "{\"exec_enabled\": true}" session_config_json: "{\"long_term_memory_enabled\": false}" agent_config_json: "{\"self_critique_enabled\": false, \"require_task_list_init_first\": true}" - openrouter_api_key: ${{ secrets.OPENROUTER_API_KEY }} + openai_api_key: ${{ secrets.OPENAI_API_KEY }} - name: Commit and push fix branch if changed id: push_fix diff --git a/.github/workflows/pr-failure-chack-agent-dispatch.yml b/.github/workflows/pr-failure-chack-agent-dispatch.yml index 61e995e..954ea01 100644 --- a/.github/workflows/pr-failure-chack-agent-dispatch.yml +++ b/.github/workflows/pr-failure-chack-agent-dispatch.yml @@ -7,9 +7,8 @@ on: jobs: resolve_pr_context: - # Temporarily disabled by maintainer request. if: > - ${{ false && github.event.workflow_run.conclusion == 'failure' && + ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.pull_requests && github.event.workflow_run.pull_requests[0] && !startsWith(github.event.workflow_run.head_commit.message, 'Fix CI failures for PR #') }} @@ -58,8 +57,7 @@ jobs: chack_agent_on_failure: needs: resolve_pr_context - # Temporarily disabled by maintainer request. - if: ${{ false && needs.resolve_pr_context.outputs.author == 'carlospolop' && needs.resolve_pr_context.outputs.should_run == 'true' }} + if: ${{ needs.resolve_pr_context.outputs.author == 'carlospolop' && needs.resolve_pr_context.outputs.should_run == 'true' }} runs-on: ubuntu-latest permissions: contents: write @@ -156,11 +154,21 @@ jobs: echo "Leave the repo in a state ready to commit as when you finish, it'll be automatically committed and pushed." } > chack_prompt.txt + - name: Set up Node.js for Codex + uses: actions/setup-node@v5 + with: + node-version: "20" + + - name: Install Codex CLI + run: | + npm install -g @openai/codex + codex --version + - name: Run Chack Agent id: run_chack uses: carlospolop/chack-agent@master with: - provider: openrouter + provider: codex model_primary: CHEAP_BUT_QUALITY main_action: peass-ng sub_action: PR Failure Chack-Agent Dispatch @@ -172,7 +180,7 @@ jobs: tools_config_json: "{\"exec_enabled\": true}" session_config_json: "{\"long_term_memory_enabled\": false}" agent_config_json: "{\"self_critique_enabled\": false, \"require_task_list_init_first\": true}" - openrouter_api_key: ${{ secrets.OPENROUTER_API_KEY }} + openai_api_key: ${{ secrets.OPENAI_API_KEY }} - name: Commit and push if changed env: diff --git a/linPEAS/builder/linpeas_parts/6_users_information/16_Subuid_subgid_mappings.sh b/linPEAS/builder/linpeas_parts/6_users_information/16_Subuid_subgid_mappings.sh new file mode 100644 index 0000000..1af234c --- /dev/null +++ b/linPEAS/builder/linpeas_parts/6_users_information/16_Subuid_subgid_mappings.sh @@ -0,0 +1,35 @@ +# Title: Users Information - subuid/subgid mappings +# ID: UG_Subuid_subgid_mappings +# Author: Carlos Polop +# Last Update: 13-02-2026 +# Description: Show delegated user namespace ID ranges from /etc/subuid and /etc/subgid. +# License: GNU GPL +# Version: 1.0 +# Functions Used: print_2title +# Global Variables: $MACPEAS +# Initial Functions: +# Generated Global Variables: +# Fat linpeas: 0 +# Small linpeas: 1 + + +print_2title "User namespace mappings (subuid/subgid)" +if [ "$MACPEAS" ]; then + echo "Not applicable on macOS" +else + if [ -r /etc/subuid ]; then + echo "subuid:" + grep -v -E '^\s*#|^\s*$' /etc/subuid 2>/dev/null + else + echo "/etc/subuid not readable or not present" + fi + + if [ -r /etc/subgid ]; then + echo "" + echo "subgid:" + grep -v -E '^\s*#|^\s*$' /etc/subgid 2>/dev/null + else + echo "/etc/subgid not readable or not present" + fi +fi +echo "" diff --git a/linPEAS/builder/src/linpeasBuilder.py b/linPEAS/builder/src/linpeasBuilder.py index 7d289e8..df6fbf7 100644 --- a/linPEAS/builder/src/linpeasBuilder.py +++ b/linPEAS/builder/src/linpeasBuilder.py @@ -46,7 +46,7 @@ class LinpeasBuilder: def build(self): print("[+] Building variables...") - variables = self.__generate_variables() + variables = self.__generate_variabless() self.__replace_mark(PEAS_VARIABLES_MARKUP, variables, "") if len(re.findall(r"PSTORAGE_[a-zA-Z0-9_]+", self.linpeas_sh)) > 1: #Only add storages if there are storages (PSTORAGE_BACKUPS is always there so it doesn't count)