[컴][linux] audit log

linux 에서 권한 부여 관련 log history / 행동 히스토리 / command history



Linux Auditing System

configuration

audit log path

  • /var/log/audit/audit.log
audit.log 는 아래와 같은 모양이다.
type=CRED_DISP msg=audit(1529285401.444:1738036): pid=11359 uid=0 auid=0 ses=238643 msg='op=PAM:setcred grantors=pam_env,pam_unix acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
type=USER_END msg=audit(1529285401.445:1738037): pid=11359 uid=0 auid=0 ses=238643 msg='op=PAM:session_close grantors=pam_loginuid,pam_keyinit,pam_limits,pam_systemd acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
type=CRED_DISP msg=audit(1529285401.453:1738038): pid=11360 uid=0 auid=0 ses=238644 msg='op=PAM:setcred grantors=pam_env,pam_unix acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
...

audit log 설명

----
type=USER_ACCT msg=audit(06/18/2018 10:12:35.793:1737897) : pid=6991 uid=cocktail auid=cocktail ses=234347 msg='op=PAM:accounting grantors=pam_unix,pam_localuser acct=root exe=/usr/bin/su hostname=cocktailfunding.com addr=? terminal=pts/0 res=success'
----
type=CRED_ACQ msg=audit(06/18/2018 10:12:35.793:1737898) : pid=6991 uid=cocktail auid=cocktail ses=234347 msg='op=PAM:setcred grantors=pam_unix acct=root exe=/usr/bin/su hostname=cocktailfunding.com addr=? terminal=pts/0 res=success'

audit log 에서 특정 내용만 검색


$>ausearch -ua 1000 -i -ts 06/17/2018

  • -ua 1000 
    • user ID, effective user ID, login user ID (auid) 가 1000 인 log 만 검색
    • user ID 는 process 를 실행한 account 를 이야기 한다. auid 는 login ID 이다. 누군가 'a' 라는 id 로 login 해서 sudo 로 실행을 하면 auid 는 'a' 가 되고, uid 는 root 가 될 것이다.
  • -i :  uid 숫자를 text account 로 interpret 해준다.
  • -ts : 시작시간 설정, 2018년 6월 17일
  • -te : 시작시간


See Also





[컴][php] php secure code 점검 tool

소스코드 검증 툴 / 검증 프로그램 / source code anaysis tool / secure code check / defective code 점검


PHP 안전 코드 분석 툴 PHP secure code anaysis tools

  1. Progpilot - Progpilot is a static analyzer tool for PHP that detects security vulnerabilities such as XSS and SQL Injection.
  2. RIPS
    1. RIPS is a static source code analyzer for vulnerabilities in PHP web applications. Please see notes on the sourceforge.net site.
    2. version 이 update 되면서, 상용으로 변경된듯 하다. 옛버전은 최신의 php 에 대한 지원을 하지 않는듯 하다.
  3. phpcs-security-audit - phpcs-security-audit is a set of PHP_CodeSniffer rules that finds flaws or weaknesses related to security in PHP and its popular CMS or frameworks. It currently has core PHP rules as well as Drupal 7 specific rules.
  4. VisualCodeGrepper (VCG)
    1. Scans C/C++, C#, VB, PHP, Java, and PL/SQL for security issues and for comments which may indicate defective code. The config files can be used to carry out additional checks for banned functions or functions which commonly cause security issues.
    2. windows 용이다. .msi 를 제공한다. 사용도 어렵지 않다.

See Also

  1. A reviewed list of useful PHP static analysis tools GitHub - exakat/php-static-analysis-tools
    • php 관련 tool 들의 링크를 모아놨다.
    • Bugs finders / Coding standards / DIY / Fixers / Metrics / SaaS / Misc

[컴][스크랩] 그래픽 관련 이야기

graphics /  그래픽 이론 / GTA 관련 그래픽


그래픽 관련 이야기



[컴] ffmpeg 으로 video 에서 audio format 변경하기

비디오에서 오디오 포맷 변경/ 오디오 타입 변경


ffmpeg download

  • ffmpeg 의 download 는 See Also . 1 을 확인하자.

Video 에서 audio format 변경하기

현재 video 에서 audio 의 format 을 바로 변경하는 법은 없는듯 하다. 대신에 다음2가지를 수행해주면 같은 효과를 얻을 수 있다.
  1. Video에서 audio 추출: 자신이 변환하고 싶은 format으로 추출하자.
  2. Video에 audio 더하기: video 에 audio 가 있어도 괜찮다. 그냥 덮어쓰게 된다.

Video에서 오디오 추출

video.mp4라는 video 파일의 오디오를 mp3 형식으로 추출할 때는 .mp3 로 적어주면 된다.

ffmpeg -i video.mp4 -vn -ab 256000 audio.mp3

aac 형식으로 추출하려면 간단히 aac 로 변경해 주면 된다.
ffmpeg -i video.mp4 -vn -ab 256000 audio.aac

Video 에 audio 더하기

ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a aac -strict experimental -shortest output.mp4

-shortest  를 넣으면, 가장짧은 길이의 영상(shortest clip)이 끝날때마다 인코딩(encoding)을 수행한다.

소요시간

내 경우에 audio.acc 를 이용해서 위의 명령을 실행했다. 2시간짜리 영상의 경우 대략 6분정도가 소요됐다.(cpu i3-2100, 3.1GHz)

See Also

  1. fmpeg 으로 video container 변경

References

  1. Useful FFmpeg Commands For Converting Audio & Video Files

[컴][책][링크] 무료 AI 그림도구



무료 AI 그림도구

[컵][웹]현금 영수증발행과 시스템 구축

현금 영수증 발행 API



현금 영수증발행과 시스템 구축


현금 영수증 발행을 하려면 "현금영수증 가맹점에 가입"해서 현금영수증 발행 가맹점이 되어야 한다.[ref. 1]

근데 대안으로 현금영수증 API를 이용하면, 가맹점에 가입하지 않아도 국세청에 현금영수증 신고를 할 수 있다.(api 제공을 하는 회사가 현금영수증 가맹점 자격을 갖는 것이다.)

현금 영수증 발행 API


파트너신청

링크허브에서 "파트너신청" 을 한다. 그러면 email 로 "견적서"와 함께

  • 비밀키(SecretKey)
  • 링크아이디(LinkID) 

를 보내준다.




이것을 가지고 "연동자료실"의 문서를 참고해서 test 를 하면 된다.


실사용

테스트를 마치고 나서는 다시 전화를 해서 실제 사용을 하겠다고 하면, 팝빌쪽에서 회원가입을 해주고, 채널을 열어준다. 이제 test code 에서 isTest(false) 를 해주고 사용하면 된다.

  • $CashbillService->IsTest(false);
현재(2018-05-03) 까지는 현금영수증 API 는 무료이다.


그리고 추가로 "계약서 2부" 를 보내준다. 계약서 1부는 날인을 해서 '팝빌'로 보내주면 된다.


See Also


References