Forge Home

bash_history

Puppet module for Bash history

11,169 downloads

7,820 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 1.0.6 (latest)
  • 1.0.5
  • 1.0.4
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
released Feb 16th 2016
This version is compatible with:
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'itmanagerro-bash_history', '1.0.6'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add itmanagerro-bash_history
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install itmanagerro-bash_history --version 1.0.6

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

itmanagerro/bash_history — version 1.0.6 Feb 16th 2016

#puppet-bash_history

Puppet module for installing and configuring an extended Bash history

####Table of Contents

  1. Features
  2. Supported OS
  3. Configuration
  4. Parameters
  5. Commands

##Features

Build Status Score Status Downloads Status Version Status Endorsement Status

Modules Count Release Count

  • Append and preserve Bash history in realtime
  • Directory Stack Builtins - directories history
  • Adding extra attributes
    • Client IP ($SSH_CLIENT - [192.168.0.1 65432 22])
    • Terminal ($TTY - [/dev/pty/01])
    • Username (SSH variable passed by SSH Keys)

##Supported OS I have tested the module on all these machines:

  • CentOS: 6.7 (Final)
  • Debian: 6.0.10 (Squeeze), 7.9 (Wheezy), 8.3 (Jessie)

It should work on any Redhat or Debian based operating systems.

If you need any other operating systems tested, please let me know.

I will use your requests for creating rspec for specific operating system.

##Configuration This module should require nothing more than minimal configuration.

If you need aditional features or if you have any issues, please contact me. ####Minimal configuration

include bash_history

####A more complex configuration

class { 'bash_history':
  hh_clientip => true,
  hh_terminal => true,
  hh_username => true,
}

####Example (complex)

[2016-01-01 01:01:01] [/dev/pts/0] [192.168.0.1 65535 22] [Mihai] ~~~ /usr/src/puppet-bash_history ~~~ ps aux
[2016-01-01 01:01:03] [/dev/pts/1] [192.168.0.4 56578 22] [Angela] ~~~ /root ~~~ Logged in as user root     pts/1        2016-01-01 01:01 (angela-pc.localdomain)
[2016-01-01 01:02:21] [/dev/pts/2] [192.168.0.8 35535 22] [George] ~~~ /root ~~~ cd /var/www
[2016-01-01 01:03:31] [/dev/pts/2] [192.168.0.8 64535 22] [George] ~~~ /var/www ~~~ rm -fr index.html
[2016-01-01 01:04:41] [/dev/pts/3] [192.168.0.6 56435 22] [Robert] ~~~ /opt ~~~ mkdir solr-testing
[2016-01-01 01:05:51] [/dev/pts/6] [192.168.0.3 45645 22] [Gina] ~~~ /tmp ~~~ cd /var/log
[2016-01-01 01:05:57] [/dev/pts/1] [192.168.0.4 56578 22] [Angela] ~~~ /root ~~~ Logged out from user root     pts/1        2016-01-01 01:01 (angela-pc.localdomain)
[2016-01-01 01:06:01] [/dev/pts/6] [192.168.0.3 34564 22] [Gina] ~~~ /var/log ~~~ tail -f mail.info

##Parameters

Parameter Description
hh_clientip Include $SSH_CLIENT to bash history (hh)
hh_terminal Include $(tty) to bash history (hh)
hh_username Include $REALUSER to bash history (hh)

hh_username require sshd_config "PermitUserEnvironment yes" and authorized_keys should include

environment="REALUSER=Mihai" ssh-rsa AAAAB2NzA3zaGFD4tdg4tSss[...]AD4fSArShnio3xB3cb2jeOsYQ== Mihai Cornateanu SSH KEY

####Example (parameters)

hh_clientip

[2016-01-01 01:01:01] [192.168.0.1 65535 22] ~~~ /usr/src/puppet-bash_history ~~~ ps aux

hh_terminal

[2016-01-01 01:01:01] [/dev/pts/0] ~~~ /usr/src/puppet-bash_history ~~~ ps aux

hh_username

[2016-01-01 01:01:01] [Mihai] ~~~ /usr/src/puppet-bash_history ~~~ ps aux

##Commands

Command Description
hh show full extended history
hh 10 show last 10 lines of extented history
hd show full directories stack
hd 10 show last 10 lines of directories stack

Copyright 2016 Mihai Cornateanu @ ITManager