Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rule 6.2.4 with login banners #225

Closed
antonatos opened this issue May 4, 2021 · 3 comments · Fixed by #238
Closed

rule 6.2.4 with login banners #225

antonatos opened this issue May 4, 2021 · 3 comments · Fixed by #238
Assignees

Comments

@antonatos
Copy link

in one of the servers the /etc/profile has this block (full banner not displayed here):

# banner

echo -e "\e[34m
   ,e#####me        ,e######m,         ,a###########O     ##h       /e#######mJ

[=] Server : $HOSTNAME
[=] IP     : $(ifconfig | grep '192' | head -n1 | awk '{print $2}')
[=] Kernel : $(uname -r)
[=] Uptime : $(uptime | awk '{print $3 $4}')

Welcome back $USER
"

which causes the rule 6.2.4 evaluation to be confused since the dot_in_path is wrong and results in creating multiple files due to stdout registration:

[root@test-deploy ~]# /bin/bash --login -c 'env | grep ^PATH=' | sed -e 's/PATH=//' -e 's/::/:/' -e 's/:$//' -e 's/:/\\n/g'

   ,e#####me        ,e######m,         ,a###########O     ##h       /e#######mJ

[=] Server \n test-deploy
[=] IP     \n 
[=] Kernel \n 3.10.0-1160.25.1.el7.x86_64
[=] Uptime \n 1\n04,2

Welcome back root

/opt/kafka/bin\n/usr/local/bin\n/opt/kafka/bin\n/usr/local/bin\n/usr/local/sbin\n/usr/local/bin\n/usr/sbin\n/usr/bin\n/root/bin\n/root/bin

An extra "grep "^PATH" before the sed commands seems to fix the issue

@uk-bolly uk-bolly self-assigned this May 6, 2021
@uk-bolly
Copy link
Member

uk-bolly commented May 6, 2021

hi @antonatos

We wanted to reach out after looking over the issue and we have some questions. Would you be able to give us some detail on your /etc/profile? Looking at the changes suggested they do work, however they might deviate from some best practices, we would normally find the sort of setting you have in a profile.d script. If they are placed within /etc/profile.d, we don’t see the issue you are experiencing. At this time we are leaning towards this being something that is better addressed in your environment. However before we make that call we would like to take a poke at what you are using, so we can address as many options as possible without impact.

Thanks

uk-bolly

@antonatos
Copy link
Author

antonatos commented May 6, 2021 via email

uk-bolly added a commit that referenced this issue Jun 23, 2021
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
@uk-bolly
Copy link
Member

Hi @antonatos

Thank you for your patience. Before making the decision, we have been waiting to see if anyone else has requested this either from the community or from our direct clients and we have not seen this appear again.
While it is very valid point there are many ways that people may be achieving their requirements and trying to allow for all the options and ways of achieving this is not something we could handle in each case.

However in this case, I have raised the PR as we are certain this is not an uncommon practice and it will be seen again.

Many thanks once again

uk-bolly

uk-bolly added a commit that referenced this issue Jun 23, 2021
@uk-bolly uk-bolly linked a pull request Jul 1, 2021 that will close this issue
@uk-bolly uk-bolly closed this as completed Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants