12. Exercise - Develop your own resources
June 7, 2022About 2 min
Suggested Resources to start on (Simple):
- Docker
idretrieves container idimageretrieves image namereporetrieves the repotagretrieves the tagportsretrieves the portscommandretrieves command
- Git
brancheschecks if branch existscurrent_branchretrieves current branchlast_commitretrieves last commit from loggit_logretrieve log of all commitstagretrieve tag for repo
Suggested Resources to start on (Medium):
- File resource
ownertests if the owner of the file matches the specified value.grouptests if the group to which a file belongs matches the specified value.sizetests if a file’s size matches, is greater than, or is less than the specified value.contentstests if contents in the file match the value specified in a regular expression.pathretrieves path to file
- Directory resource
ownertests if the owner of the file matches the specified value.grouptests if the group to which a file belongs matches the specified value.sizetests if a file’s size matches, is greater than, or is less than the specified value.contentstests if contents in the file match the value specified in a regular expression.pathretrieves path to directory
- Users
existtests if the named user existsgidtests the group identifiergrouptests the group to which the user belongsgroupstests two (or more) groups to which the user belongshometests the home directory path for the usermaxdaystests the maximum number of days between password changesmindaystests the minimum number of days between password changesshelltests the path to the default shell for the useruidtests the user identifierwarndaystests the number of days a user is warned before a password must be changed
- etc host allow/deny
daemondaemon returns a string containing the daemon that is allowed in the rule.client_listclient_list returns a 2d string array where each entry contains the clients specified for the rule.optionsoptions returns a 2d string array where each entry contains any options specified for the rule.
Suggested Resources to start on (Hard):
- etc shadow
usersA list of strings, representing the usernames matched by the filterpasswordsA list of strings, representing the encrypted password strings for entries matched by the where filter. Each string may not be an encrypted password, but rather a * or similar which indicates that direct logins are not allowed.last_changesA list of integers, indicating the number of days since Jan 1 1970 since the password for each matching entry was changed.min_daysA list of integers reflecting the minimum number of days a password must exist, before it may be changed, for the users that matched the filter.max_daysA list of integers reflecting the maximum number of days after which the password must be changed for each user matching the filter.warn_daysA list of integers reflecting the number of days a user is warned about an expiring password for each user matching the filter.inactive_daysA list of integers reflecting the number of days a user must be inactive before the user account is disabled for each user matching the filter.expiry_datesA list of integers reflecting the number of days since Jan 1 1970 that a user account has been disabled, for each user matching the filter. Value is nil if the account has not expired.countThe count property tests the number of records that the filter matched.
- etc fstab
device_nameis the name associated with the device.mount_pointis the directory at which the file system is configured to be mounted.file_system_typeis the type of file system of the device or partition.mount_optionsis the options for the device or partition.dump_optionsis a number used by dump to decide if a file system should be backed up.file_system_optionsis a number that specifies the order the file system should be checked.
- Tomcat server conf reader
parse_confparse the conf filefetch_connectorsretrieves keysport,protocol,timeout,redirect,sslprotocol,scheme,sslenable,clientauth,secure