Re: [PATCH/RFC] do not source/exec scripts on noexec mount points

2015-12-15 Thread konsolebox
On Tue, Dec 15, 2015 at 7:30 AM, Mike Frysinger wrote: > On 15 Dec 2015 06:47, konsolebox wrote: >> t On Mon, Dec 14, 2015 at 1:17 PM, Mike Frysinger wrote: >> > On 13 Dec 2015 16:50, konsolebox wrote: >> >> On Sun, Dec 13, 2015 at 5:01 AM, Mike Frysinger wrote: >> >> > Today, if you have a scrip

Re: SHELLOPTS=xtrace security hardening

2015-12-15 Thread Stephane Chazelas
2015-12-15 00:30:16 +0100, up201407...@alunos.dcc.fc.up.pt: [...] > >Should we also block SHELLOPTS=history > >HISTFILE=/some/file like /proc/$pid/fd/$fd and > >TZ=/proc/$pid/fd/$fd (like for your /bin/date command) as that > >allows DoS on other processes (like where those fds are for > >pipes). >

Re: SHELLOPTS=xtrace security hardening

2015-12-15 Thread Chet Ramey
On 12/14/15 6:30 PM, up201407...@alunos.dcc.fc.up.pt wrote: > Quoting "Stephane Chazelas" : > > I understand what you're saying. > As much as we would like, there's no way of stopping all attack vectors by > only hardening bash, not only that, but also taking away its useful features. > Though I s

rewriting a readonly var should exit

2015-12-15 Thread Aurelien ROUGEMONT
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE

Re: rewriting a readonly var should exit

2015-12-15 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/15/15 6:12 AM, Aurelien ROUGEMONT wrote: > Bash Version: 4.3 > Patch Level: 30 > Release Status: release > > Description: > in the posix shell specification [1] when a script tries to to > overwrite a readonly variable it should crash the

Re: rewriting a readonly var should exit

2015-12-15 Thread John McKown
Are you running BASH in POSIX mode? That's a option. Example: [tsh009@it-johnmckown-linux junk]$ cat ro.sh #!/bin/bash readonly x="x" x="y" echo "sno" [tsh009@it-johnmckown-linux junk]$ ./ro.sh ./ro.sh: line 3: x: readonly variable sno [tsh009@it-johnmckown-linux junk]$ vim ro.sh [tsh009@it-johnm

Re: rewriting a readonly var should exit

2015-12-15 Thread Andreas Schwab
Aurelien ROUGEMONT writes: > Description: > in the posix shell specification [1] when a script tries to to > overwrite a readonly variable it should crash the script. > > Repeat-By: > #!/bin/bash > readonly rovar="goodvalue" > rovar="badvalue" > echo "You shoul

Re: rewriting a readonly var should exit

2015-12-15 Thread Aurelien ROUGEMONT
On 12/15/2015 03:39 PM, Andreas Schwab wrote: > Aurelien ROUGEMONT writes: > >> Description: >> in the posix shell specification [1] when a script tries to to >> overwrite a readonly variable it should crash the script. >> >> Repeat-By: >> #!/bin/bash >> readonly rovar="goodv

Re: SHELLOPTS=xtrace security hardening

2015-12-15 Thread Stephane Chazelas
2015-12-15 09:01:05 -0500, Chet Ramey: [...] > > Mind explaining this one? > > I can't seem to write to HISTFILE in a non-interactive shell, or am i > > missing something? > > You just need to enable history (set -o history). History is independent > of whether or not the shell is interactive; it

Re: SHELLOPTS=xtrace security hardening

2015-12-15 Thread up201407890
Quoting "Chet Ramey" : On 12/15/15 11:37 AM, up201407...@alunos.dcc.fc.up.pt wrote: You just need to enable history (set -o history). History is independent of whether or not the shell is interactive; it's just enabled by default in interactive shells. doing a "set -o history" didn't work f

Re: SHELLOPTS=xtrace security hardening

2015-12-15 Thread Chet Ramey
On 12/15/15 12:33 PM, Stephane Chazelas wrote: > 2015-12-15 09:01:05 -0500, Chet Ramey: >> On 12/14/15 6:30 PM, up201407...@alunos.dcc.fc.up.pt wrote: >>> Quoting "Stephane Chazelas" : >>> >>> I understand what you're saying. >>> As much as we would like, there's no way of stopping all attack vecto

Re: SHELLOPTS=xtrace security hardening

2015-12-15 Thread Chet Ramey
On 12/15/15 11:37 AM, up201407...@alunos.dcc.fc.up.pt wrote: >> You just need to enable history (set -o history). History is independent >> of whether or not the shell is interactive; it's just enabled by default >> in interactive shells. > > doing a "set -o history" didn't work for me, only whe

Re: SHELLOPTS=xtrace security hardening

2015-12-15 Thread up201407890
Quoting "Stephane Chazelas" : I don't know if you can make a non-interactive bash write to the $HISTFILE, but bash, even when non-interactive, even when called as sh, with SHELLOPTS=history will *read* the HISTFILE. Thanks for clearing that up for me. Makes sense. Quoting "Chet Ramey" : I

Re: SHELLOPTS=xtrace security hardening

2015-12-15 Thread Stephane Chazelas
2015-12-15 09:01:05 -0500, Chet Ramey: > On 12/14/15 6:30 PM, up201407...@alunos.dcc.fc.up.pt wrote: > > Quoting "Stephane Chazelas" : > > > > I understand what you're saying. > > As much as we would like, there's no way of stopping all attack vectors by > > only hardening bash, not only that, but

Re: SHELLOPTS=xtrace security hardening

2015-12-15 Thread Chet Ramey
On 12/15/15 10:40 AM, Stephane Chazelas wrote: > 2015-12-15 09:01:05 -0500, Chet Ramey: > [...] >>> Mind explaining this one? >>> I can't seem to write to HISTFILE in a non-interactive shell, or am i >>> missing something? >> >> You just need to enable history (set -o history). History is independ