Commit 374f138
fix: hide workDir from agent container to prevent secrets exposure
Sensitive tokens (GITHUB_TOKEN, ANTHROPIC_API_KEY, etc.) are written in
plaintext to docker-compose.yml inside the workDir (/tmp/awf-*). Since
the agent container mounts /tmp:/tmp:rw, any code inside the container
could read these secrets via `cat /tmp/awf-*/docker-compose.yml`.
Primary fix: Add tmpfs overlay on workDir (same pattern as mcp-logs
hiding) so the agent sees an empty in-memory filesystem instead of the
real directory containing docker-compose.yml with all tokens.
Secondary fix (defense-in-depth): Restrict file permissions on workDir
(0o700) and config files (0o600) so non-root processes on the host
cannot read them either.
Both normal mode and chroot mode are covered with appropriate paths.
Closes #62, closes #206, closes #210
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 999a1c8 commit 374f138
3 files changed
Lines changed: 125 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1420 | 1420 | | |
1421 | 1421 | | |
1422 | 1422 | | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
1423 | 1456 | | |
1424 | 1457 | | |
1425 | 1458 | | |
| |||
1566 | 1599 | | |
1567 | 1600 | | |
1568 | 1601 | | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
1569 | 1654 | | |
1570 | 1655 | | |
1571 | 1656 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
726 | 734 | | |
727 | 735 | | |
728 | 736 | | |
729 | 737 | | |
| 738 | + | |
| 739 | + | |
730 | 740 | | |
731 | | - | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
732 | 745 | | |
733 | 746 | | |
734 | 747 | | |
| |||
852 | 865 | | |
853 | 866 | | |
854 | 867 | | |
855 | | - | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
856 | 871 | | |
857 | | - | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
858 | 875 | | |
859 | 876 | | |
860 | 877 | | |
| |||
960 | 977 | | |
961 | 978 | | |
962 | 979 | | |
963 | | - | |
| 980 | + | |
964 | 981 | | |
965 | 982 | | |
966 | 983 | | |
| 984 | + | |
| 985 | + | |
967 | 986 | | |
968 | 987 | | |
969 | | - | |
| 988 | + | |
970 | 989 | | |
971 | 990 | | |
972 | 991 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
856 | 856 | | |
857 | 857 | | |
858 | 858 | | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
859 | 870 | | |
860 | 871 | | |
861 | 872 | | |
| |||
0 commit comments